GDB进程记录/重放执行日志 [英] Gdb process record/replay execution log

查看:125
本文介绍了GDB进程记录/重放执行日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



感谢
Raj

有人告诉我在gdb中使用过程记录/重放功能时,执行日志将被存储在哪里?

更新

  #include  ; 

int main(int argc,char const * argv [])
{
printf(Hello World\\\
);
printf(你好吗?\\\
);
char * c = NULL;
printf(%c\,* c);
返回0;
}

当我解引用 c 。我想用这个例子来弄清楚在一个段错误之后如何使用reverse-next / reverse-continue返回。我能够做到reverse-next,并在记录执行时达到第一个printf语句,我在这个语句中放置了一个断点。在此之后,当我尝试gdb中的下一个命令时,发现光标在printf语句中移动,但在终端上看不到任何输出。总之,我想知道是否记录/重放功能可以用来在执行历史记录后执行历史记录?

解决方案

<我认为你必须用

 记录保存文件名

默认文件名是gdb_record.process_id,其中process_id是调试过程的进程ID。也就是说,如果您没有指定它,请查看调试器的CWD。

更新



关于insn-number-max的额外问题:

 信息记录




显示有关进程记录状态及其内存
执行的各种统计信息日志缓冲区,包括:

$ ul
无论是在记录模式还是重放模式下。

  • 最低录制指令编号(从当前执行日志开始记录指令开始计数)。
  • 记录指令编号最高。
  • 即将播放的当前指令(如果在播放中模式)。

  • 执行日志中包含的指令数量。
  • 执行中可能包含的最大指令数量
    log 。

  • 我不确定,但这可能表明毕竟整个事物都留在了记忆中。当然,一个64位系统和大量的swap(以及ulimit unlimited)会使这个为'虚拟'的限制

    Could somebody tell me where would the execution log be stored when using the process record/replay feature in gdb?

    Thanks Raj

    Update

    #include <stdio.h>
    
    int main (int argc, char const *argv[])
    {
        printf("Hello World\n");
        printf("How are you?\n");
        char *c = NULL;
        printf("%c\n", *c);
        return 0;
    }      
    

    The code above seg faults when I dereference c. I want to use this example to figure out how I can use reverse-next/reverse-continue to go back after a segfault. I am able to do reverse-next and reach the first printf statement at which I put a break point when recording the execution. After this, when I try the "next" command in gdb, I see that the cursor moves through the printf statements but I don't see any output printed on the terminal. In summary, I want to know if the record/replay feature can be used to go through the execution history even after a segfault?

    解决方案

    I thought you had to manually specify that with

    record save filename
    

    The default filename is gdb_record.process_id, where process_id is the process ID of the debugged process. That means, if you don't specify it, look in the CWD of the debugger

    Update

    With respect to your extra question on insn-number-max:

    info record 
    

    Show various statistics about the state of process record and its in-memory execution log buffer, including:

    • Whether in record mode or replay mode.
    • Lowest recorded instruction number (counting from when the current execution log started recording instructions).
    • Highest recorded instruction number.
    • Current instruction about to be replayed (if in replay mode).
    • Number of instructions contained in the execution log.
    • Maximum number of instructions that may be contained in the execution log.

    I'm not to sure but this might indicate that the whole is kept in memory after all. Of course, a 64bit system and plenty of swap (and ulimit unlimited) will make this a 'virtual' limitation

    这篇关于GDB进程记录/重放执行日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆