libunwind-devel
[Top][All Lists]
Advanced

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

Re: [libunwind] one more question.


From: David Mosberger
Subject: Re: [libunwind] one more question.
Date: Fri, 16 May 2003 11:03:19 -0700

>>>>> On Fri, 16 May 2003 14:34:48 +0200, Ronald Veldema <address@hidden> said:

  Ronald> on an ia64, once I get libunwind working, which registers do
  Ronald> I need to scan to get my (conservative) garbage collector working ?
  Ronald> I'm guessing, everything that I can get at from
  Ronald> unw_get_reg().

To be more precise:

        - everything for which unw_get_reg() doesn't return an error
        - everything for which unw_get_fpreg() doesn't return an error

You can loop over all registers (0 - UNW_REG_LAST) and use
unw_is_fpreg() to decide whether unw_get_reg() or unw_get_fpreg()
needs to be called.  You might also want to do some quick sanity check
whether the returned value could possibly be a pointer (e.g.,
predicate registers will only ever return a value of either 0 or 1).
You could also skip any integer register whose NaT bit is set or
fp-register that contains a NaTVal.  But this obviously would require
some ia64-specific code (you can use #ifdef UNW_TARGET_IA64 to test
for this).

  Ronald> Is there a define exported somewhere that I can use to get
  Ronald> at everything ?

Is the above sufficient?

  Roland> How do I get at the register stack that has
  Ronald> been dumped somewhere given a unwind cursor ?

You read UNW_IA64_BSP and UNW_IA64_CFM.  The least significant 7 bits
in the latter tell you the size of the frame (SOF).  Then you read the
SOF registers starting at the BSP (be sure to skip over the RNaT
collection slot).  You could use helper routines similar to the ones
in rse.h to make this easier.

        --david


reply via email to

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