* arm-tdep.c (install_copro_load_store): PC is set 4-byte aligned.
	(install_b_bl_blx): Likewise.
This commit is contained in:
Yao Qi 2011-09-18 14:18:07 +00:00
parent ab254057b8
commit 2b16b2e33b
2 changed files with 14 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2011-09-18 Yao Qi <yao@codesourcery.com>
* arm-tdep.c (install_copro_load_store): PC is set 4-byte aligned.
(install_b_bl_blx): Likewise.
2011-09-17 Yao Qi <yao@codesourcery.com>
* arm-tdep.c (install_ldr_str_ldrb_strb): Renamed to ...

View File

@ -5475,6 +5475,8 @@ install_copro_load_store (struct gdbarch *gdbarch, struct regcache *regs,
dsc->tmp[0] = displaced_read_reg (regs, dsc, 0);
rn_val = displaced_read_reg (regs, dsc, rn);
/* PC should be 4-byte aligned. */
rn_val = rn_val & 0xfffffffc;
displaced_write_reg (regs, dsc, 0, rn_val, CANNOT_WRITE_PC);
dsc->u.ldst.writeback = writeback;
@ -5555,10 +5557,15 @@ install_b_bl_blx (struct gdbarch *gdbarch, struct regcache *regs,
dsc->u.branch.link = link;
dsc->u.branch.exchange = exchange;
dsc->u.branch.dest = dsc->insn_addr;
if (link && exchange)
/* For BLX, offset is computed from the Align (PC, 4). */
dsc->u.branch.dest = dsc->u.branch.dest & 0xfffffffc;
if (dsc->is_thumb)
dsc->u.branch.dest = dsc->insn_addr + 4 + offset;
dsc->u.branch.dest += 4 + offset;
else
dsc->u.branch.dest = dsc->insn_addr + 8 + offset;
dsc->u.branch.dest += 8 + offset;
dsc->cleanup = &cleanup_branch;
}