From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,64d603116415300c X-Google-Attributes: gid111c93,public X-Google-Thread: 13bc9c,64d603116415300c X-Google-Attributes: gid13bc9c,public From: sawst46+@pitt.edu (Scott Wood) Subject: Re: Retrieving PC from (traversing) the stack on Alpha Date: 1999/12/17 Message-ID: #1/1 X-Deja-AN: 561791777 References: X-Trace: typhoon1.gnilink.net 945400094 151.201.29.18 (Thu, 16 Dec 1999 22:08:14 EST) Organization: Who needs it? User-Agent: slrn/0.9.5.3 (UNIX) NNTP-Posting-Date: Thu, 16 Dec 1999 22:08:14 EST Newsgroups: comp.os.linux.alpha,revue.linux-kernel On 16 Dec 1999 23:05:05 +0100, Brian Hall wrote: >Okay, after some research, I think I figured out how to get at the needed >Alpha registers: > >register unsigned long fptr __asm__("$15"); /* get frame pointer? */ >register unsigned long sptr __asm__("$30"); /* get stack pointer? */ > >Now, my understanding of the problem is that I need to go back two frames on >the stack to get the PC of interest, and three for the RA of interest. How do I >do this? I haven't had much luck yet trying to figure out how to navigate the >kernel stack. I see the pt_regs structure, but I'm not exactly sure how to >figure the frame size, since that can vary with each frame. Look at dik_show_trace in arch/alpha/kernel/traps.c; it examines each quadword on the stack and only considers addresses inside the text segment. -Scott