diff mbox

[COMMITTED,1/3] ARM: extract_arm_insn function need to read instrs correctly in be8 case

Message ID 1414964484-6270-1-git-send-email-victor.kamensky@linaro.org
State New
Headers show

Commit Message

vkamensky Nov. 2, 2014, 9:41 p.m. UTC
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-11-02  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(-)

Comments

vkamensky Nov. 3, 2014, 5:11 p.m. UTC | #1
On 3 November 2014 04:17, Yao Qi <yao@codesourcery.com> wrote:
> Victor Kamensky <victor.kamensky@linaro.org> writes:
>
>> 2014-11-02  Victor Kamensky  <victor.kamensky@linaro.org>
>>
>>       * arm-tdep.c (extract_arm_insn): Use
>>       gdbarch_byte_order_for_code to read arm instruction.
>
> Victor,
> The changelog entry should be added to the corresponding ChangeLog files
> on commit.  They are missing from your commits.  I add them back.

Sorry, I did not realize that. Will do in the future.
I assume those ChangeLog pieces should not be
removed from commit messages. I.e they will present
in both places corresponding ChangeLog file and
commit messages. Is it correct?

Thanks,
Victor

> --
> Yao (齐尧)
>
> Subject: [PATCH] Add missing changelog entries
>
> Some changelog entries are missing in previous commits.  Add them.
>
> diff --git a/gdb/ChangeLog b/gdb/ChangeLog
> index f09715c..928efef 100644
> --- a/gdb/ChangeLog
> +++ b/gdb/ChangeLog
> @@ -1,3 +1,20 @@
> +2014-11-02  Victor Kamensky  <victor.kamensky@linaro.org>
> +
> +       * dwarf2loc.c (read_pieced_value): Do big endian
> +       processing only if gdb_regnum is not -1.
> +       (write_pieced_value): Ditto.
> +
> +2014-11-02  Victor Kamensky  <victor.kamensky@linaro.org>
> +
> +       * arm-linux-tdep.c (arm_linux_init_abi): Use
> +       info.byte_order_for_code to choose endianity of breakpoint
> +       instructions snippets.
> +
> +2014-11-02  Victor Kamensky  <victor.kamensky@linaro.org>
> +
> +       * arm-tdep.c (extract_arm_insn): Use
> +       gdbarch_byte_order_for_code to read arm instruction.
> +
>  2014-11-02  Doug Evans  <xdje42@gmail.com>
>
>         * mdebugread.c (parse_procedure): Delete unnecessary forward decl.
Yao Qi Nov. 4, 2014, 2:20 p.m. UTC | #2
Victor Kamensky <victor.kamensky@linaro.org> writes:

> I assume those ChangeLog pieces should not be
> removed from commit messages. I.e they will present
> in both places corresponding ChangeLog file and
> commit messages. Is it correct?

That is correct.
diff mbox

Patch

diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 43520cc..9e632a7 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -13811,7 +13811,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;
 }