|
From: Sanders, R. M. <san...@za...> - 2007-05-17 14:31:45
|
Hello all,
I'm having a problem getting valgrind (3.2.3) to invoke a debugger=20
when it encounters a problem. I'm running a pretty much stock RHES4 =
rel3
system with valgrind 3.2.3 My test program is dirt simple:
=3D=3D=3D
#include <stdio.h>
int main()
{
int a;
printf("A is %d\n",a);
}
=3D=3D=3D
Compiled by:
cc -g testprog.c -o testprog
valgrind invoked by:
valgrind --leak-check=3Dfull --show-reachable=3Dyes --verbose =
--db-attach=3Dyes --db-command=3D"ddd %f %p" testprog
Valgrind correctly detects the unitialized variable a and asks to start =
a debugger session. When I respond 'y'
it invokes ddd, which correctly loads the testprog. The problem is that =
the stack being reported at that point is
totally bogus.
Related or not, if I have an abort() statement in the code valgrind =
shows the same garbled stack. If I use ddd to
pull up the core file produced by the abort(), all is well.
I have noticed that ddd shows many more libraries being opened when =
invoked from the commandline on the core file as opposed to
being invoked directly from valgrind.
=20
Any suggestions?
Rob
|