Thanks Andreas, that was helpful. But I do not understand how this is
harmless. If GDB does not perform exception return then I cannot
follow the execution of my program by doing the command ni (next
instruction) continuously.

On Thu, Mar 22, 2012 at 6:12 PM, Andreas Fritiofson
<andreas.fritiof...@gmail.com> wrote:
> On Thu, Mar 22, 2012 at 5:06 PM, Justin Drake <drakefjus...@gmail.com> wrote:
>> I am getting the following error on the OpenOCD terminal:
>>
>> Error: address + size wrapped(0xfffffffe, 0x00000004)
>>
>> What address is referred to? What do the two addresses 0xfffffffe and
>> 0x00000004 correspond to?
>
> In ARMv7-M, 0xfffffffX is a special value for the return address that
> is placed in the link register when an exception is taken. When the
> exception handler returns and the PC gets loaded with this special
> value, the core knows that it should perform exception return instead
> of a normal branch. This is one of the nifty features that makes it
> possible to write exception handlers as regular C functions.
>
> However, when GDB follows the stack trace from inside an exception
> handler, it ignores the fact that 0xfffffffX is a special value and
> tries to load a word (0x00000004 bytes) from that address as if it was
> a regular return address. OpenOCD warns that the read wraps around the
> 32-bit address space, and also emits some MEM_AP errors from trying to
> access these locations. Upon receiving the errors, GDB assumes it has
> reached the start of the stack trace and stops.
>
> The error is completely harmless but could be avoided if GDB was made
> aware of the special value and how to get the true return address.
>
> /Andreas

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to