On 01/22/2011 11:07 PM, Richard Earnshaw wrote: >> > If it is a bug here, this patch is to address it. These two lines of >> > code is to compute the offset of `str pc'. In this patch, we can do >> > this in a different way, >> > >> > str pc, [sp, #-4] >> > ldr r4, [sp, #-4] >> > >> > > No, code must not write below the stack -- the value can get corrupted > if an interrupt occurs. (I'm not sure if that's possible in this > specific case as the debugger ought to be in control; but it's bad > practice to violate the ABI in this way). When these two instructions are running, debugger is not in control. How about this insn sequence, which should comply with ABI? sub sp, #4 str pc, [sp] ldr r4, [sp] add sp, #4 Tested new patch in ARM native GDB with arm-disp-step.exp. No failures. -- Yao (齐尧)