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


------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to