libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libunwind] unwinding through dynamically modified code?


From: David Mosberger
Subject: Re: [libunwind] unwinding through dynamically modified code?
Date: Tue, 23 Mar 2004 22:24:40 -0800

>>>>> On Tue, 23 Mar 2004 23:48:03 -0600 (CST), Todd L Miller <address@hidden> 
>>>>> said:

  Todd>         I'm not quite sure I understand the difference.  I'm
  Todd> away from my references right now, but isn't the stack pointer
  Todd> defined to be r12?

Yes, but the stack-pointer gets special treatment in the unwind
conventions because it would be inefficient to have to save it even
when there is a fixed-size memory-stack.

  Todd> (At least, during normal operation, but that's precisely what
  Todd> I'm supposed to be describing with the unwind information,
  Todd> right?)  Or is this distinction more for the benefit of
  Todd> libunwind?

I suppose that's one way to look at it.  The frame-registers (IP, SP,
and BSP) are special because they're effectively "read-only" for
unwinding purposes.  In contrast, normal "preserved" registers are
read-write.  Register r12 has a bit of a dual-role: on the one hand,
it holds the current stack-pointer, but it can also be viewed as a
(sometimes) preserved register.  UNW_IA64_SP refers to the former
role, whereas UNW_IA64_GR+12 refers to the latter.  The analogous is
true for ar.bsp, where UNW_IA64_BSP refers to the frame-register usage
and UNW_IA64_AR_BSP refers to the (sometimes) preserved register
usage.

In any case, for your purposes, just using UNW_IA64_SP (or
UNW_IA64_BSP) should give you what you want.  In fact, if you tried to
use UNW_DYN_ADD with any register other than UNW_IA64_SP, you'd get a
UNW_EBADREG error.

        --david


reply via email to

[Prev in Thread] Current Thread [Next in Thread]