Google
  Web www.spinics.net

Re: VALUE OF VARIABLE FROM ARM REGISTER USING STACK FRAME BACKTRACE

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


Using only CAPITALS is seen as shouting. If you want people to reply,
don't insult them by shouting your question around.

Please do not cross post between lists. Take the most appropriate list
and post your message there (gcc list removed from CC line).

Oh, and please break lines at ~72 characters, that makes your message
much easier to read.

On Mon, Apr 28, 2008 at 11:23:53PM -0700, ashim saikia wrote:
> Hi,
> Can anybody suggest me how to get a value of a variable from
> ARMregister. I want to get the variable value in register while
> backtracing the stack frame.I can get the value of a local variable
> that isstored in stack, but I do have a problem if the variable is
> stored inARM register.
> 
> If the variable is in register, then, Is there anyspecific location
> for ARM registers in the Stack frame so that I can usethe frame
> pointer to retrieve the value of the variable.

No, the registers are CPU internal registers and so will not be on the
stack.

> Usingdwarf information, I can get that the variable is in register,
> butwhere in the stack frame the register is located that I have a
> problem?Because from dwarf info if I get that the variable is in
> stack, than Ican use the frame pointer and add location to the frame
> pointer and canget the value. But in case, if the variable is stored
> in register thanI cannot use the frame pointer of the stack frame. So
> how do I get thatvariable value?
> 
> 
> For example, if I have a variable 'VAR'. Iwant to retrieve the value
> of this VAR by tracing the stack frame. Now ifthis variable was in
> stack while executing the function, I can get thelocation of the same
> in the stack frame and get the value. If the 'VAR'is stored in a
> register, say 'R2', than I need to know the location ofregister in
> the stack frame. So, how do I find out the value of thevariable in
> Register.

Just do not optimise the source so the compiler will put most (if not
all) variables on the stack. Use -O0 or just leave the -O flag away
from the compiler command line.


Erik

-- 
Erik Mouw -- mouw@xxxxxxxxxxxx

Attachment: signature.asc
Description: Digital signature

-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

[Site Home]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux ARM Kernel]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Tools]     [DDR & Rambus]     [Monitors]

Powered by Linux

Google PageRank Checking tool