Gdb reverse stepping - not supported on linux?

(gdb) reverse-step
Target child does not support this command.

This is on Linux 2.6.18

Does the kernel not support it? Do I need a special gcc arg?

 gcc --version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-52)
+3
source share
2 answers

This is on Linux 2.6.18

Does the kernel not support it?

The kernel has nothing to do with it. What version of gdb are you using?

Given that your GCC dates back to 2008, and that GDB added support for reverse execution in version 7.0, released in 2009, I assume your GDB is just too damned.

+1
source

It seems to me that you forgot to enable the GDB record.

(gdb) record
(gdb) continue
(gdb) reverse-continue
Continuing.

For example, it 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 problem 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.
0
source