views:

256

answers:

4

Hi,

jstack is very helpful to me in checking stack traces of live running processes.

Is there any tool in C++ to do this task. I am working with Solaris/GCC compilers.

Actually GDB/DBX can do that. But my process is hanging some times that to very rarely. So when that is hanging I want to know where it is going wrong. Just track that in live.

Thanks D. L. Kumar

+1  A: 

I believe that GDB has that capability too, refer gdb documentation for the same

Ram
Actually GDB/DBX can do that. But my process is hanging some times that to very rarely. So when that is hanging I want to know where it is going wrong.
+1  A: 

Considering you are running on Solaris, and you don't want to use GDB, DTrace seems the obvious remaining solution.

But are you perhaps dismissing GDB for the wrong reasons? You can attach GDB to existing hanging processes.

MSalters
+1  A: 

I wrote a article about dumping the stack in C/C++ with Windows and Unix/Linux at DDJ some years ago. Maybe it helps you:

See http://www.ddj.com/architect/185300443

RED SOFT ADAIR
+3  A: 

Lessee... on solaris, can't use gdb... I think what you're looking for is 'pstack' On my solaris 8 system it's located at

/usr/bin/pstack
usage:  pstack [-F] { pid | core } ...

and

man pstack

shows a nice list of related tools you may find very useful in diagnosis.

veefu