[patch] Fix PR tdep/12352: Handle str pc, [Rd, #imm] in displaced stepping
Ulrich Weigand
uweigand@de.ibm.com
Mon Feb 14 14:39:00 GMT 2011
Yao Qi wrote:
> A new patch is attached in which PUSH/POP is used. I also noticed that
> Insn4 should be 'add r4, r4, #16' rather than 'add r4, r4, #8',
> explained in the comments. After that, the offset of my board is 8.
I think this is wrong: the "pipeline offset" of 8 bytes is already
added to the PC value when it is retrieved by displaced_read_reg
(this applies to any use of PC as source operand in any instruction).
The special case relating to STR PC is about an optional *additional*
offset of 4 bytes (such that PC + 12 instead of PC + 8 is stored);
the "offset" value computed by this routine should therefore be
0 or 4 (not 8 or 12).
> Run patched arm-disp-step.exp on native GDB configured as
> armv7l-unknown-linux-gnueabi. No failures.
Maybe it would be good to add a test that verifies the value
stored under displaced stepping is identical to the value
stored when running the instruction natively?
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
More information about the Gdb-patches
mailing list