call stack backtrace from a C program (Solaris)

call stack backtrace from a C program (Solaris)

Post by drcolos.. » Sat, 03 Feb 2001 10:37:28



I'm trying to get a call stack trace in a C program
under Solaris 2.6 or later.  Does anyone know how
to do it?

The info I'm looking for would be similar to this:
...
(10)  0x00045e08  integ + 0x408  [./two_brn.e]
(11)  0x0006468c  trajcem + 0x128  [./two_brn.e]
(12)  0x00055490  fly_traj + 0xf58  [./two_brn.e]
(13)  0x0004052c  top_level + 0x14  [./two_brn.e]
(14)  0x000567e4  _start + 0x34  [./two_brn.e]

which shows what the code was doing when it dies.

Under HP-UX and IRIX, a printout like the above can
be obtained by calling U_STACK_TRACE() and
trace_back_stack_and_print(), respectively.

TIA,

--G

Sent via Deja.com
http://www.deja.com/

 
 
 

call stack backtrace from a C program (Solaris)

Post by Bjorn Rees » Sun, 04 Feb 2001 02:22:27



> I'm trying to get a call stack trace in a C program
> under Solaris 2.6 or later.  Does anyone know how
> to do it?

Use pstack. For an example see

  http://home1.stofanet.dk/breese/debug/debug.tar.gz

 
 
 

call stack backtrace from a C program (Solaris)

Post by Scott Neugrosch » Sun, 04 Feb 2001 12:24:13



> I'm trying to get a call stack trace in a C program
> under Solaris 2.6 or later.  Does anyone know how
> to do it?

> The info I'm looking for would be similar to this:
> ...
> (10)  0x00045e08  integ + 0x408  [./two_brn.e]
> (11)  0x0006468c  trajcem + 0x128  [./two_brn.e]
> (12)  0x00055490  fly_traj + 0xf58  [./two_brn.e]
> (13)  0x0004052c  top_level + 0x14  [./two_brn.e]
> (14)  0x000567e4  _start + 0x34  [./two_brn.e]

> which shows what the code was doing when it dies.

> Under HP-UX and IRIX, a printout like the above can
> be obtained by calling U_STACK_TRACE() and
> trace_back_stack_and_print(), respectively.

> TIA,

> --G

> Sent via Deja.com
> http://www.deja.com/

Did it once under SCO SysV R3.2.4 wasn't very fun.
 
 
 

1. call stack backtrace from a C program

I'm trying to get a call stack trace in a C program
under Solaris 2.6 or later.  Does anyone know how
to do it?

The info I'm looking for would be similar to this:
...
(10)  0x00045e08   integ + 0x408  [./two_brn.e]
(11)  0x0006468c   trajcem + 0x128  [./two_brn.e]
(12)  0x00055490   fly_traj + 0xf58  [./two_brn.e]
(13)  0x0004052c   top_level + 0x14  [./two_brn.e]
(14)  0x000567e4   _start + 0x34  [./two_brn.e]

which shows what the code was doing when it dies.

Under HP-UX and IRIX, a printout like the above can
be obtained by calling U_STACK_TRACE() and
trace_back_stack_and_print(), respectively.

TIA,

--G

Sent via Deja.com
http://www.deja.com/

2. Does Linux Support Static NAT?

3. Stack Backtrace for Solaris 2.3/SunPro C 2.0

4. NEED X-TALK for HP-UX

5. Stack backtrace from signal handler

6. Automatic fsck - log file?

7. How to backtrace stack frames?

8. RedHat8.0/Apache2.0 and proxypass

9. Seeking stack backtrace function

10. adb and dbx gives different stack backtraces

11. How to backtrace stack frames?

12. Interpreting the results from backtrace()/ backtrace() usability

13. AXI TCPIP stack not not sending FIN when server program calls close(fd)