comp.lang.ada
 help / color / mirror / Atom feed
From: Corey Minyard <minyard@acm.org>
Subject: Re: Plea for help
Date: 1997/01/26
Date: 1997-01-26T00:00:00+00:00	[thread overview]
Message-ID: <m2ybdgvyfz.fsf@acm.org> (raw)
In-Reply-To: 9701231552.AA07941@most


"W. Wesley Groleau (Wes)" <wwgrol@PSESERV3.FW.HAC.COM> writes:

> I'm looking for C or Ada code to give the addresses of all
> the stack frames above its call site, on SPARC/Solaris,
> Pentium/SCO Unix and/or PowerMac/MachTen.

This cannot directly be done by user code on the SPARC.  To do a
RELIABLE stack traceback on the SPARC requires interrupts to be turned
off.  It can be done without it, but it will occasionally crash.  I
wrote one of these for VxWorks on SPARC, but I could not use it on
Solaris because it would occasionally crash.  Perhaps there is a
system call to do it, but that would be the only way.

On Pentium, it is easy, just get the frame pointer and follow it back
(assuming frame pointers are not turned off.

> 
> We have Ada code on HP RISC boxes that contains a C routine--I'll shorten
> the routine name to Trace.  When called, trace generates a string of the
> form "<TRACE|xxxx|xxxx|xxxx|xxxx|xxxx|xxxxxx|...> where each xxxx is the
> address of a stack frame.  An "offline" tool uses linker and debug info
> to translate each trace into a symbolic stack dump similar to what one
> gets from a debugger.  (Thanks very much to an anonymous comp.lang.ada
> reader for the HP RISC version!)
> 

According to the HPUX documentation, you have to look at the symbol
table to determine the procedure type to get a reliable traceback, so
I gave up.  Is this on HPUX?  I'd like to see a good HPPA traceback
routine.

-- 
Corey Minyard               Internet:  minyard@acm.org
  Work: minyard@nortel.ca       UUCP:  minyard@wf-rch.cirr.com





       reply	other threads:[~1997-01-26  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <9701231552.AA07941@most>
1997-01-26  0:00 ` Corey Minyard [this message]
1997-01-27  0:00   ` Plea for help Richard Kenner
1997-01-27  0:00 ` Fergus Henderson
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox