aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorGraham Markall <graham.markall@embecosm.com>2016-10-13 09:34:16 +0100
committerGraham Markall <graham.markall@embecosm.com>2016-11-03 17:14:38 +0000
commit90f61cceac73fe40dcd21b3590c247bfa624ac00 (patch)
tree73dec9b2d5a4a15e48b072dc98c92e5393ebee80 /opcodes
parent2e27220211249bfeb38b10e630b33fbd170fce6c (diff)
downloadgdb-90f61cceac73fe40dcd21b3590c247bfa624ac00.zip
gdb-90f61cceac73fe40dcd21b3590c247bfa624ac00.tar.gz
gdb-90f61cceac73fe40dcd21b3590c247bfa624ac00.tar.bz2
arc: Swap highbyte and lowbyte in print_insn_arc
highbyte and lowbyte actually refer to the low byte and the high byte respectively, but are used consistently in this swapped order. This commit swaps them round so that highbyte refers to the high byte and lowbyte refers to the low byte. There should be no functional change after this commit. opcodes/ChangeLog: * arc-dis.c (print_insn_arc): Swap highbyte and lowbyte.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog4
-rw-r--r--opcodes/arc-dis.c8
2 files changed, 8 insertions, 4 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 634ad27..fe26838 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,5 +1,9 @@
2016-11-03 Graham Markall <graham.markall@embecosm.com>
+ * arc-dis.c (print_insn_arc): Swap highbyte and lowbyte.
+
+2016-11-03 Graham Markall <graham.markall@embecosm.com>
+
* arc-dis.c (find_format_from_table): Replace use of ARC_SHORT
with arc_opcode_len.
(find_format_long_instructions): Likewise.
diff --git a/opcodes/arc-dis.c b/opcodes/arc-dis.c
index a1aaf34..64bfecd 100644
--- a/opcodes/arc-dis.c
+++ b/opcodes/arc-dis.c
@@ -921,8 +921,8 @@ print_insn_arc (bfd_vma memaddr,
}
memset (&iter, 0, sizeof (iter));
- lowbyte = ((info->endian == BFD_ENDIAN_LITTLE) ? 1 : 0);
- highbyte = ((info->endian == BFD_ENDIAN_LITTLE) ? 0 : 1);
+ highbyte = ((info->endian == BFD_ENDIAN_LITTLE) ? 1 : 0);
+ lowbyte = ((info->endian == BFD_ENDIAN_LITTLE) ? 0 : 1);
if (info->section && info->section->owner)
header = elf_elfheader (info->section->owner);
@@ -1025,13 +1025,13 @@ print_insn_arc (bfd_vma memaddr,
return size;
}
- insn_len = arc_insn_length (buffer[lowbyte], buffer[highbyte], info);
+ insn_len = arc_insn_length (buffer[highbyte], buffer[lowbyte], info);
pr_debug ("instruction length = %d bytes\n", insn_len);
switch (insn_len)
{
case 2:
- insn[0] = (buffer[lowbyte] << 8) | buffer[highbyte];
+ insn[0] = (buffer[highbyte] << 8) | buffer[lowbyte];
break;
default: