(gdb) reverse-step
Target child does not support this command.
This is in Linux 2.6.18
Does the kernel not support it? Is there a special gcc arg I need?
gcc --version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-52)
The command would be " reverse-step ", or " reverse-next ". If you run into the error: Target child does not support this command. then try adding target record at the beginning of execution, after starting run . Edit: Since GDB 7.6 target record is deprecated, use target record-full instead.
If the target environment supports it, gdb can allow you to “rewind” the program by running it backward. A target environment that supports reverse execution should be able to “undo” the changes in machine state that have taken place as the program was executing normally. Variables, registers etc.
To execute one line of code, type "step" or "s". If the line to be executed is a function call, gdb will step into that function and start executing its code one line at a time. If you want to execute the entire function with one keypress, type "next" or "n".
I'm no expert, but it appears that maybe you forgot to enable gdb recording.
(gdb) record
(gdb) continue
(gdb) reverse-continue
Continuing.
For example, this worked for me
Breakpoint 1, main (argc=1, argv=0x7ffe673b5638) at ...
7 int lol = 0xbeefface;
(gdb) record
(gdb) continue
Continuing.
Program stopped.
0x00007f710c188746 in __GI__exit ...
(gdb) reverse-continue
Continuing.
...
No more reverse-execution history.
main (argc=1, argv=0x7ffe673b5638) at ...
7 int lol = 0xbeefface;
I was able to reproduce your issue with
Breakpoint 1, main (argc=1, argv=0x7ffeb7945198) at main.c:7
7 int lol = 0xbeefface;
(gdb) b _exit
Breakpoint 2 at 0x7fc62dbb8710: file ...
(gdb) continue
Continuing.
Breakpoint 2, __GI__exit ...
(gdb) reverse-continue
Target native does not support this command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With