libunwind-devel
[Top][All Lists]
Advanced

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

Re: [libunwind] alloca()


From: David Mosberger
Subject: Re: [libunwind] alloca()
Date: Wed, 10 Dec 2003 10:16:43 -0800

>>>>> On Wed, 10 Dec 2003 17:34:24 +0100, Johan Walles <address@hidden> said:

  Johan> We have a (dynamically generated) function that uses a
  Johan> dynamic amount of user stack.  The amount of stack used is a
  Johan> linear function of the parameters it is called with.

  Johan> This is the same situation you'd have when unwinding through
  Johan> an ordinary C function using alloca().  What I'm wondering
  Johan> is, how do we tell libunwind this?  Can we somehow tell
  Johan> libunwind that the user stack is modified by another
  Johan> register?  Or do we just say that r42 contains the unmodified
  Johan> usp (see below)?

It's the latter.  That is, for this code:

  Johan> 0x20000000627381d0:    [MII]       alloc r40=ar.pfs,24,16,0
  Johan> 0x20000000627381d1:                mov r41=b0
  Johan> 0x20000000627381d2:                add r42=r12,r0

you'd use something along the lines of:

        _U_dyn_op_save_reg (op, _U_QP_TRUE, 2, UNW_REG_SP, UNW_REG_GR + 42);

  --david


reply via email to

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