|
From: Chris J. <ch...@at...> - 2004-02-19 11:42:44
|
Hi all, I've been working on adding Valgrind support to GDB. I've written a GDB target that allows you to debug a process running under Valgrind. The threads emulated by vg_scheduler.c show up as normal threads and a special thread 1 represents the real state of the process. For the implementation I moved the VG_(threads) array to a shared memory region which can be accessed by GDB to obtain the state of the emulated threads. I also added support for single step and breakpoints to Valgrind. The patches to Valgrind 2.0.0 and GDB 6.0 are available on my website (www.atomice.com). I was hoping that these patches could lead to an official method of exposing the state of Valgrind's emulated threads to external debuggers. Inevitably this would mean designing some kind of fixed structure containing a subset of the thread state that wouldn't change from version to version. At present the patches I've written are sensitive to changed in the ThreadState structure. I think it would also be useful once an external debugger interface is in place to add an option to skins such as memcheck to trap when a problem is detected so a programmer can use the debugger to find the cause of the problem. Comments and critcism welcome (and encouraged!) Chris -- http://www.atomice.com |