From: Andy H. <And...@au...> - 2009-05-21 23:49:57
|
tom fogal wrote: > Andy Howell <And...@au...> writes: >> Julian Seward wrote: >>>> When I specify --db-attach with helgrind, the debugger is attached to t >> he >>>> thread in question, not the its parent process. Is there a way to make it >>>> attach to the process instead? >>> Not sure I quite understand. When you say "parent process", do you mean >>> "the root thread of the process" ? >>> >>> J >>> >> Yes, exactly. In the debugger I only see one thread, so I can't >> inspect my other threads to see what is going on. > [snip] > > Use `info threads', and `thread <num>' to switch. > > -tom > Tom, Thats the problem, unless I call gdb via my script to set the parent pid, there are no threads: (gdb) info threads (gdb) Looks like gdb is getting that via the '%f' parameter passed by the --db-command. That is set to /proc/PID/fd/FILE_DESCRIPTOR where FILE_DESCRIPTOR is the descriptor for the binary. Since my script is redirecting gdb to use the parent pid of the thread in question, I need to find a way to work out the proper descriptor. I tried to force gdb to read the symbols from the binary with: symbol-file BINARY_NAME -readnow But that didn't help. Once I figure out how to grab the symbol table, I should be fine. Thanks, Andy |