Examining the calling stack in C

Examining the calling stack in C

Post by Nicolas Rouquet » Fri, 09 Dec 1994 04:47:45



In Solaris 2.x, a signal handler is passed a pointer to a ucontext_t(5)
structure which includes the stack of the thread where the signal was
received.  This should be sufficient to "walk" up the stack and
examine each frame to find out which functions were called.

Is there a simple way of doing this walk when we only care to know which of
N known functions of the program have been called?

--
Nicolas Rouquette                      Artificial Intelligence Group

Phone: (818) 306-6196                  4800 Oak Grove Dr.
  Fax: (818) 306-6912                  Pasadena, CA 91109

 
 
 

1. Can I examine the PCs stored on the call stack?

I'm trying to write memory allocation/deallocation routine that keeps
track of where memory is allocated/freed.  Is there any way for me to
retreive the program counters that are stored on the stack?

Thanks,
John Engstrom

Sent via Deja.com http://www.deja.com/
Before you buy.

2. Enabling write cache on SCSI disks

3. Calling TkMan connaisseurs: please examine v2.0

4. ppp & ddial: how to stop process?

5. Security from outside call-ins

6. Sample IP device driver

7. Call Stack for Apache

8. unforgettablelanguages.com - any users?

9. va_arg - Uninitialized call stack on Solaris 5.5.1

10. application call stack on SPARC v9

11. how to print the call stack of a thread

12. accessing call stack and symbol table

13. Showing the 'call stack'