|
From: Philippe W. <phi...@sk...> - 2015-04-01 20:03:56
|
On Wed, 2015-04-01 at 12:37 +0200, Matthias Schwarzott wrote: > Hi! > > Sometimes I want to write a core-dump of the current status when I am in > gdb attached to valgrind. > But the gdb-command gcore does not work with vgdb. ? Here is works (gdb 7.9) (gdb) gcore Saved corefile core.42000 (gdb) mo h general valgrind monitor commands: .... (the last command to show this gdb is connected to a V gdbsrv. However, it looks like the core dump might not be fully functional: (gdb) core core.42000 [New LWP 14340] warning: Error reading shared library list entry at 0x2118e0 Program terminated with signal SIGTRAP, Trace/breakpoint trap. #0 test () at trivialleak.c:8 8 leak = (void*)malloc( 1 ); (gdb) bt #0 test () at trivialleak.c:8 #1 0x0804840f in main () at trivialleak.c:12 (gdb) (the shared lib list entry looks bizarre to me). > Else I propose to add a monitor command to trigger the already > implemented core-dump writing of valgrind. It is intended to remove this capability to generate a core dump from inside valgrind, as this is fragile/missing some registers values/contains one single thread/... > My experimental patch adds a monitor command "v.do core". > It can be called multiple times and will just write multiple coredumps > vgcore.PID.NO > > Does gdbserver know about the currently selected thread in gdb? GDB typically has to indicate to gdbsrv on which thread to work. > > I will post this patch the next days. I think it would be better to see how gcore works (e.g. with multiple threads), and if needed fix the problems if they are some, rather than to invest on the valgrind core dump feature that it on its way out (if I have the time to cleanup in 3.11 the --db-attach that has been announced obsolete in 3.10) Philippe |