Is there a function that I can call to do a stack trace from within a
program? I need one for Solaris (and also OSF).
The only thing necessary for the triumph of good
is for evil men to do nothing.
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!
7. stack trace
13. stack trace?