Gdb Record / Play Log

Can someone tell me where the execution log will be stored when using the process recording / playback function 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; } 

Code above seg errors when I search for c . I want to use this example to figure out how I can use reverse-next / reverse-continue to return after segfault. I can do the opposite of the following and achieve the first printf statement, at which I set a breakpoint when writing execution. After that, when I try to execute the "next" command in gdb, I see that the cursor moves through the printf statements, but I do not see the output printed on the terminal. So, I want to know if the recording / playback function can use the execution history even after segfault?

+3
source share
1 answer

I thought you need to manually specify this with

 record save filename 

The default file name is gdb_record.process_id, where process_id is the process ID of the debugged process. This means that if you do not specify it, look in the debugger CWD

Update

As for your additional question about insn-number-max:

 info record 

Display various statistics about the status of a process record and its memory run-time buffer, including:

  • In recording or playback mode.
  • The lowest recorded instruction number (given when the current execution log began to record instructions).
  • The maximum recorded instruction number.
  • The current instruction to be played (if in playback mode).
  • The number of instructions contained in the execution log.
  • The maximum number of instructions that may be contained in the execution enter.

I am not sure, but this may mean that in general everything is stored in memory. Of course, a 64-bit system and many swaps (and ulimit unlimited) will make this a 'virtual' restriction

+5
source

All Articles