Re: Retrieving PC from (traversing) the stack on Alpha

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Fri, 17 Dec 1999 00:35:57 +0100


Brian Hall wrote:
> 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 get_wchan, which traverses the frame list to find the first PC
that's not in a scheduling function.

Check also __builtin_frame_address(N) and __builtin_return_address(N) in
the GCC info. They do exactly what you want if they work, but I
understand that only N == 0 works on some processors. If that's the
case for your Alpha, __builtin_frame_address(0) is still a clean way to
get the first frame.

Don't ask me for any more clues as I don't have an Alpha!

have a nice day,
-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/