Re: "record save" failure
Hui Zhu <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <CANFwon26TA-z0t5TNM4EJFHxA-Sr3cSZhc_-+y_Fn1OzpZ83-A@mail.gmail.com> |
Prec didn't support multithread. Thanks, Hui On Tue, Jan 21, 2014 at 9:31 PM, Cedric Roux <[email protected]> wrote: > Hi GNU gdb people, > > I'm trying to analyse an unfriendly program and I gave a try > to the "record" thing gdb provides. > > Except it fails. > > Below is an excerpt of the log. > Am I doing something wrong? forgetting to type something? > Does the "record" thing works with multi-threaded programs? > I used the "set scheduler-locking on" command to run only the > desired thread. > > As you see, I record more than 5 millions instructions between > breakpoint 3 and breakpoint 2. The "record save" fails and a > following "info record" crashes gdb. My computer is a 64b intel p6000 > thing with debian testing (last updated in october of last year or > something). I compiled gdb 7.6.2 locally with gcc 4.8.1. > > I hacked a bit gdb (but just a bit) to dump the "record list" at > the beginning of "record_full_save" and I get a different dump > compared to "record_full_save" (which does more than dump the > list, it replays the instructions, which I don't do). So I'm a > bit lost. (I compared with a simple multi-threaded program I quickly > wrote, and for which "record" works.) > > Any hint or whatever (maybe there is a bug somewhere in gdb...) is > very welcome. > > Regards and thanks for gdb which is a great program, > Cédric. > > momo@sed:~$ dbg/bin/gdb -p 23553 > GNU gdb (GDB) 7.6.2 > [...] > This GDB was configured as "x86_64-unknown-linux-gnu". > [...] > Attaching to process 23553 > [...] > [New LWP 23554] > [Thread debugging using libthread_db enabled] > Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". > [...] > 0x00007ffff325824d in poll () from /lib/x86_64-linux-gnu/libc.so.6 > (gdb) hb *0x00007fffe8c63f22 > Hardware assisted breakpoint 1 at 0x7fffe8c63f22 > (gdb) cont > Continuing. > [New Thread 0x7fffe4372700 (LWP 23570)] > [New Thread 0x7fffe4b73700 (LWP 23571)] > [New Thread 0x7fffdeaff700 (LWP 23572)] > [New Thread 0x7fffca553700 (LWP 23594)] > [New Thread 0x7fffc87ff700 (LWP 23595)] > [New Thread 0x7fffc7ffe700 (LWP 23596)] > [New Thread 0x7fffc77fd700 (LWP 23597)] > [New Thread 0x7fffc6ce9700 (LWP 23598)] > [New Thread 0x7fffc64e8700 (LWP 23599)] > [Thread 0x7fffc77fd700 (LWP 23597) exited] > [Thread 0x7fffc7ffe700 (LWP 23596) exited] > [Thread 0x7fffc87ff700 (LWP 23595) exited] > [Thread 0x7fffc6ce9700 (LWP 23598) exited] > [Thread 0x7fffc64e8700 (LWP 23599) exited] > [Thread 0x7fffca553700 (LWP 23594) exited] > [New Thread 0x7fffca553700 (LWP 23600)] > [New Thread 0x7fffc64e8700 (LWP 23601)] > [Thread 0x7fffc64e8700 (LWP 23601) exited] > [Switching to Thread 0x7fffca553700 (LWP 23600)] > > Breakpoint 1, 0x00007fffe8c63f22 in ?? () from XXX.so > (gdb) cont > Continuing. > > Breakpoint 1, 0x00007fffe8c63f22 in ?? () from XXX.so > (gdb) hb *0x00007fffe8ad361c > Hardware assisted breakpoint 2 at 0x7fffe8ad361c > (gdb) hb *0x00007fffe8c0f066 > Hardware assisted breakpoint 3 at 0x7fffe8c0f066 > (gdb) cont > Continuing. > > Breakpoint 3, 0x00007fffe8c0f066 in ?? () from XXX.so > (gdb) set record full insn-number-max 10000000 > (gdb) record full > (gdb) set scheduler-locking on > (gdb) cont > Continuing. > > Breakpoint 2, 0x00007fffe8ad361c in ?? () from XXX.so > (gdb) info record > Active record target: record-full > Record mode: > Lowest recorded instruction number is 1. > Highest recorded instruction number is 5681093. > Log contains 5681093 instructions. > Max logged instructions is 10000000. > (gdb) record save TOTOTATA > warning: target file /proc/23553/cmdline contained unexpected null > characters > Couldn't get registers: No such process. > (gdb) info record > Active record target: record-full > Segmentation fault