call stack backtrace from a C program

call stack backtrace from a C program

Post by drcolos.. » Fri, 02 Feb 2001 12:14:04



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

Post by Andrew Gabri » Sat, 03 Feb 2001 04:24:39




Quote:> 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?

Here's one I posted earlier...

     http://www.deja.com/getdoc.xp?AN=508578081&fmt=text

--
Andrew Gabriel

 
 
 

1. call stack backtrace from a C program (Solaris)

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. Arithmatic operations

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

4. Change resolution on solaris

5. Stack backtrace from signal handler

6. ip adress

7. Stack Backtrace for Solaris 2.3/SunPro C 2.0

8. bash

9. How to backtrace stack frames?

10. Seeking stack backtrace function

11. adb and dbx gives different stack backtraces

12. How to backtrace stack frames?

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