From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,ea6f1c490b7a1aa1,start X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1993-08-12 05:59:01 PST Path: gmd.de!xlink.net!howland.reston.ans.net!math.ohio-state.edu!cs.utexas.edu!not-for-mail From: swanton@moose.usmcs.maine.edu (George P. Swanton) Newsgroups: comp.sys.dec Subject: How to find *address* of return address on stack? Date: 12 Aug 1993 07:57:30 -0500 Organization: UTexas Mail-to-News Gateway Sender: daemon@cs.utexas.edu Message-ID: <9308121257.AA25930@moose.usmcs.maine.edu> NNTP-Posting-Host: cs.utexas.edu 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