API for call stack traceback?

I don't mean to diss the use of debuggers like dbx, but there are times when other tools would suit a problem better.Is there a routine I can call from a C++ program to print a current call stack traceback in the current thread?
[243 byte] By [herteg] at [2007-11-26 10:17:05]
# 1
Try one of these:man printstackman pstack
clamage45 at 2007-7-7 2:11:26 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2
Is there way how to get debug information from program compiled with -g? I mean source file and line. I use printstack, but source file and line could be more comfotable :).
Olda79 at 2007-7-7 2:11:26 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3
You can do this:sprintf(buf, "dbx -q -s /dev/null -c \"where;quit\" - %d", (int)getpid());system(buf);:-)))
Denis_Antrushin at 2007-7-7 2:11:26 > top of Java-index,Development Tools,Solaris and Linux Development Tools...