I wanted to try out reverse-step and other reverse commands. I compiled the program below with gcc -g main.c. I ran gdb and did the following and got the following
(gdb) record
Process record: the program is not being run.
(gdb) b main
Breakpoint 1 at 0x1148: file main.c, line 3.
(gdb) r
Starting program: /tmp/a.out
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Breakpoint 1, main (argc=1, argv=0x7fffffffe7b8) at main.c:3
3 puts("Hello");
(gdb) record
(gdb) br 6
Breakpoint 2 at 0x555555555175: file main.c, line 6.
(gdb) step
Process record does not support instruction 0xc5 at address 0x7ffff7f1dfc9.
Process record: failed to record execution log.
Program stopped.
0x00007ffff7f1dfc9 in ?? () from /usr/lib/libc.so.6
(gdb)
What's wrong? Without record I'd get the error multi-thread does not support this command.. Is there another command I need? Or a way to build/run this as a single thread?
#include <stdio.h>
int main(int argc, char *argv[]) {
puts("Hello");
puts("a");
puts("b");
puts("c");
puts("d");
puts("Hello 2");
}