I'm trying to get my C program to stack trace itself using gdb.
Upon detecting an error my program does a
system("gdb -x configfile programname programPID > outputfile");
Where the configfile contains the lines:-
Now that works fine from a bash shell but all I get when my program
hits it is a frozen program that needs a Ctrl-C.
Whats going on? Can I use this technique to stack trace my program?
It is a multi-threaded (pthreads) program, compiled using -gstabs+ in
the compile line, with gcc 3.1.
I don't want to have to write my own stack tracing routines!