GDB 7's process record/replay & BDW-GC
ludo-mXXj517/[email protected] (Ludovic Courtès) Tue, 27 Oct 2009 22:52:11 +0100
| Newsgroups | gmane.comp.programming.garbage-collection.boehmgc,gmane.comp.gdb.bugs.general |
|---|---|
| Message-ID | <[email protected]> |
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=E2=80=99s record facility is confused by libgc=E2=80=99=
s tricks:
--8<---------------cut here---------------start------------->8---
$ cat > ,,t.c <<EOF
#include <gc/gc.h>
int =20
main (int argc, char *argv[])
{
GC_INIT ();
GC_malloc (123);
return 0;
}
EOF
$ gcc -Wall ,,t.c -lgc
$ gdb ./a.out=20
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.h=
tml>
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=3D1, argv=3D0x7fffffffc8e8) at ,,t.c:6
6 GC_INIT ();
(gdb) record
(gdb) c
Continuing.
warning: Process record ignores the memory change of instruction at addre=
ss 0x7ffff7612e5a because it can't get the value of the segment register.
warning: Process record ignores the memory change of instruction at addre=
ss 0x7ffff784e8c3 because it can't get the value of the segment register.
Process record doesn't support instruction 0xf6e at address 0x7ffff789f2f=
2.
Process record: failed to record execution log.
Program received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff789f2f0 in memset () from /nix/store/s88vdfglm94x7jn0vqm24pqhq=
460s0c7-glibc-2.9/lib/libc.so.6
(gdb) bt
#0 0x00007ffff789f2f0 in memset () from /nix/store/s88vdfglm94x7jn0vqm24=
pqhq460s0c7-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=3D1, argv=3D0x7fffffffc8e8) at ,,t.c=
:6
(gdb) c
Continuing.
Process record doesn't support instruction 0xf6e at address 0x7ffff789f2f=
2.
Process record: failed to record execution log.
Program received signal SIGABRT, Aborted.
0x00007ffff789f2f0 in memset () from /nix/store/s88vdfglm94x7jn0vqm24pqhq=
460s0c7-glibc-2.9/lib/libc.so.6
(gdb) bt
#0 0x00007ffff789f2f0 in memset () from /nix/store/s88vdfglm94x7jn0vqm24=
pqhq460s0c7-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=3D1, argv=3D0x7fffffffc8e8) at ,,t.c=
:6
--8<---------------cut here---------------end--------------->8---
Is it a known issue? Any idea how to fix it?
Thanks,
Ludo=E2=80=99.
[*] The =E2=80=98multi-thread=E2=80=99 target doesn=E2=80=99t support rev=
erse execution, but the
=E2=80=98record=E2=80=99 target does. Thus =E2=80=98record=E2=80=99 =
is the only way to get reverse
execution for multi-threaded programs.