From: Andy H. <And...@au...> - 2009-05-21 23:19:00
|
Julian Seward wrote: >> When I specify --db-attach with helgrind, the debugger is attached to the >> 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 > Julian, Yes, exactly. In the debugger I only see one thread, so I can't inspect my other threads to see what is going on. I made a script to query /proc and figure out the parent and launch gdb: #!/bin/sh file=$1; pid=$2; if [ -f /proc/${pid}/status ]; then ppid=`grep 'PPid:' /proc/${pid}/status|sed -e 's/PPid:[^0-9]*//'` echo "pid $pid ppid $ppid file $file" /usr/bin/gdb $file $ppid else echo "can't find tgid for $pid" exit 1; fi I pass this to valgrind as: --db-command=/home/andy/script/vg_gdb %f %p I see all the threads, but gdb can't find the symbol tables. I have worked out how to find them. Thanks, Andy |