[Gc] GDB 7's process record/replay & BDW-GC

Ludovic Courtès ludo at gnu.org
Tue Oct 27 13:52:11 PST 2009


Hello,

GDB 7.0 provides process record/replay facilities, which in turn provide
support for reverse execution[*] (info "(gdb) Process Record and
Replay").

Unfortunately, GDB’s record facility is confused by libgc’s tricks:

--8<---------------cut here---------------start------------->8---
$ cat > ,,t.c <<EOF
#include <gc/gc.h>

int   
main (int argc, char *argv[])
{
  GC_INIT ();
  GC_malloc (123);
  return 0;
}
EOF

$ gcc -Wall ,,t.c -lgc
$ gdb ./a.out 

warning: Can not parse XML syscalls information; XML support was disabled at compile time.
GNU gdb (GDB) 7.0
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/ludo/src/guile/a.out...done.
(gdb) r
Starting program: /home/ludo/src/guile/a.out
[Thread debugging using libthread_db enabled]

Program exited normally.
(gdb) b main
Breakpoint 1 at 0x400783: file ,,t.c, line 6.
(gdb) r
Starting program: /home/ludo/src/guile/a.out
[Thread debugging using libthread_db enabled]

Breakpoint 1, main (argc=1, argv=0x7fffffffc8e8) at ,,t.c:6
6         GC_INIT ();
(gdb) record
(gdb) c
Continuing.
warning: Process record ignores the memory change of instruction at address 0x7ffff7612e5a because it can't get the value of the segment register.
warning: Process record ignores the memory change of instruction at address 0x7ffff784e8c3 because it can't get the value of the segment register.
Process record doesn't support instruction 0xf6e at address 0x7ffff789f2f2.
Process record: failed to record execution log.

Program received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff789f2f0 in memset () from /nix/store/s88vdfglm94x7jn0vqm24pqhq460s0c7-glibc-2.9/lib/libc.so.6
(gdb) bt
#0  0x00007ffff789f2f0 in memset () from /nix/store/s88vdfglm94x7jn0vqm24pqhq460s0c7-glibc-2.9/lib/libc.so.6
#1  0x00007ffff7b8a7c8 in GC_init_headers () at ../headers.c:197
#2  0x00007ffff7b904cb in GC_init () at ../misc.c:788
#3  0x0000000000400788 in main (argc=1, argv=0x7fffffffc8e8) at ,,t.c:6
(gdb) c
Continuing.
Process record doesn't support instruction 0xf6e at address 0x7ffff789f2f2.
Process record: failed to record execution log.

Program received signal SIGABRT, Aborted.
0x00007ffff789f2f0 in memset () from /nix/store/s88vdfglm94x7jn0vqm24pqhq460s0c7-glibc-2.9/lib/libc.so.6
(gdb) bt
#0  0x00007ffff789f2f0 in memset () from /nix/store/s88vdfglm94x7jn0vqm24pqhq460s0c7-glibc-2.9/lib/libc.so.6
#1  0x00007ffff7b8a7c8 in GC_init_headers () at ../headers.c:197
#2  0x00007ffff7b904cb in GC_init () at ../misc.c:788
#3  0x0000000000400788 in main (argc=1, argv=0x7fffffffc8e8) at ,,t.c:6
--8<---------------cut here---------------end--------------->8---

Is it a known issue?  Any idea how to fix it?

Thanks,
Ludo’.

[*] The ‘multi-thread’ target doesn’t support reverse execution, but the
    ‘record’ target does.  Thus ‘record’ is the only way to get reverse
    execution for multi-threaded programs.



More information about the Gc mailing list