This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH V4 1/3] ARM: extract_arm_insn function need to read instrs correctly in be8 case
- From: Victor Kamensky <victor dot kamensky at linaro dot org>
- To: gdb-patches at sourceware dot org, Yao Qi <yao at codesourcery dot com>
- Cc: Andrew Pinski <pinskia at gmail dot com>, victor dot kamensky at linaro dot org
- Date: Sun, 26 Oct 2014 20:10:32 -0700
- Subject: [PATCH V4 1/3] ARM: extract_arm_insn function need to read instrs correctly in be8 case
- Authentication-results: sourceware.org; auth=none
- References: <1414379434-5217-1-git-send-email-victor dot kamensky at linaro dot org>
extract_arm_insn function needs to read instructions in
gdbarch_byte_order_for_code byte order, because in case armv7b,
even data is big endian, instructions are still little endian.
Currently function uses gdbarch_byte_order which would be
big endian in armv7b case.
Because of this issue pretty much all gdb.reverse/ tests are
failing with 'Process record does not support instruction' message.
Fix is to change gdbarch_byte_order to gdbarch_byte_order_for_code,
when passed to extract_unsigned_integer that reads instruction.
gdb/ChangeLog:
2014-10-21 Victor Kamensky <victor.kamensky@linaro.org>
* arm-tdep.c (extract_arm_insn): Use
gdbarch_byte_order_for_code to read arm instruction.
---
gdb/arm-tdep.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index e2559ec..e7a1ec5 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -13860,7 +13860,7 @@ extract_arm_insn (insn_decode_record *insn_record, uint32_t insn_size)
return 1;
insn_record->arm_insn = (uint32_t) extract_unsigned_integer (&buf[0],
insn_size,
- gdbarch_byte_order (insn_record->gdbarch));
+ gdbarch_byte_order_for_code (insn_record->gdbarch));
return 0;
}
--
1.8.1.4