Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: cowan@btgmax.zko.dec.com (Ken Cowan)
Subject: Re: How to find *address* of return address on stack?
Date: Thu, 12 Aug 1993 13:43:43 GMT	[thread overview]
Message-ID: <1993Aug12.134343.27616@jac.nuo.dec.com> (raw)
In-Reply-To: 9308121257.AA25930@moose.usmcs.maine.edu

In article <9308121257.AA25930@moose.usmcs.maine.edu>, swanton@moose.usmcs.maine.edu (George P. Swanton) writes:
|>Can anyone suggest a reliable method to determine the offset of the
|>return address within a stack frame given a stack pointer?
|>(This is for the Decstation 3000/400 AXP w/OSF/1 and needn't be portable)
|>
|>Basically we're trying to get a package working that does it's own threads
|>(csim). It doesn't use setjmp/longjmp, rather it copies hunks of the 
|>stack around and tweaks the return address so a thread 'returns' to a 
|>particular cleanup function instead of the procedure the created it.
|>
|>We've found enogh info in the exception package to find stack frames
|>and *get* ra's but we need to be able to get the *address* of the ra
|>on the stack.
|>
|>I've RTF'd the online version of the assembly language reference, 
|>the man pages dealing with most of the exc_ routines and the related
|>*.h files. We are in the process of acquiring the 600p tech reference
|>so please don't suggest that (though quotes from the same would be
|>marvelous).
|>
|>Any suggestions greatly appreciated.
|>gps
|>swanton@moose.usmcs.maine.edu
|>
|>

  You really need the Alpha OSF/1 calling standard.   This level of implementation
is very complicated and tends to have very obscure, precise rules.  

  There are at least some procedures that have no stack at all.  They keep
the return address in a register denoted by the return address register
field of the procedure descriptor.  
--
Ken Cowan, ZK2-3/Q8				cowan@rtl.enet.dec.com
Digital Equipment Corporation			decwrl!rtl!cowan
110 Spit Brook Rd,
Nashua, NH 03062


      reply	other threads:[~1993-08-12 13:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-08-12 12:57 How to find *address* of return address on stack? George P. Swanton
1993-08-12 13:43 ` Ken Cowan [this message]
read-only archive

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