Fix prologue analysis for ldr.w and ldrd instruction

Prologue analysis for ldr.w and ldrd instruction obtains offset from
first two bytes that contains opcode of instruction. It should obtain
offset from next two bytes that actually contain operands.

       * arm-tdep.c (thumb_analyze_prologue): Fix offset calculation for
	ldr.w and ldrd instructions.

Signed-off-by: Taimoor Mirza <tmirza@codesourcery.com>
This commit is contained in:
Taimoor Mirza 2014-05-16 11:39:05 +05:00
parent 791849751d
commit cac395eae4
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2014-05-16 Taimoor Mirza <tmirza@codesourcery.com>
* arm-tdep.c (thumb_analyze_prologue): Fix offset calculation for
ldr.w and ldrd instructions.
2014-05-15 Doug Evans <dje@google.com>
* dwarf2read.c (read_structure_type): Delete outdated comments.

View File

@ -1071,7 +1071,7 @@ thumb_analyze_prologue (struct gdbarch *gdbarch,
unsigned int constant;
CORE_ADDR loc;
offset = bits (insn, 0, 11);
offset = bits (inst2, 0, 11);
if (insn & 0x0080)
loc = start + 4 + offset;
else
@ -1087,7 +1087,7 @@ thumb_analyze_prologue (struct gdbarch *gdbarch,
unsigned int constant;
CORE_ADDR loc;
offset = bits (insn, 0, 7) << 2;
offset = bits (inst2, 0, 7) << 2;
if (insn & 0x0080)
loc = start + 4 + offset;
else