This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Fix PR tdep/12352: Handle str pc, [Rd, #imm] in displaced stepping
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: yao at codesourcery dot com (Yao Qi)
- Cc: Richard dot Earnshaw at buzzard dot freeserve dot co dot uk (Richard Earnshaw), gdb-patches at sourceware dot org, julian at codesourcery dot com
- Date: Mon, 14 Feb 2011 15:16:25 +0100 (CET)
- Subject: Re: [patch] Fix PR tdep/12352: Handle str pc, [Rd, #imm] in displaced stepping
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