aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorTamar Christina <tamar.christina@arm.com>2018-10-19 10:31:42 +0100
committerTamar Christina <tamar.christina@arm.com>2018-10-19 10:33:11 +0100
commit0b347048e7e33070212a408dc2371075ee60b556 (patch)
tree55dfcb25a5e55e764242fab9898b76cde0f92e12 /gas
parent33d64ca5db656f1f377de18f94403d8b3b91e3a1 (diff)
downloadgdb-0b347048e7e33070212a408dc2371075ee60b556.zip
gdb-0b347048e7e33070212a408dc2371075ee60b556.tar.gz
gdb-0b347048e7e33070212a408dc2371075ee60b556.tar.bz2
Arm: Fix disassembler crashing on -b binary when thumb file and thumb not forced.
The disassembler for Arm has some aborts in it in places it assumes can never be reached. Under normal circumstances they indeed cannot be reached because the right options are selected from the ARM attributes in the ELF file. However when disassembling with -b binary then if you do not get the options right the disassembler just aborts. This changes it so it just prints how it was trying to interpret the instruction and prints UNKNOWN instructions next to it. This way the user has an idea of what's going. gas/ChangeLog: * testsuite/gas/arm/undefined-insn-arm.d: New test. * testsuite/gas/arm/undefined-insn-thumb.d: New test. * testsuite/gas/arm/undefined-insn.s: New test. opcodes/ChangeLog: * arm-dis.c (UNKNOWN_INSTRUCTION_32BIT): Format specifier for arm mode. (UNKNOWN_INSTRUCTION_16BIT): Format specifier for thumb mode. (print_insn_arm, print_insn_thumb16, print_insn_thumb32): Use them.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/testsuite/gas/arm/undefined-insn-arm.d5
-rw-r--r--gas/testsuite/gas/arm/undefined-insn-thumb.d5
-rw-r--r--gas/testsuite/gas/arm/undefined-insn.s1
4 files changed, 17 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index ff9de52..7f9b0e4 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2018-10-19 Tamar Christina <tamar.christina@arm.com>
+
+ * testsuite/gas/arm/undefined-insn-arm.d: New test.
+ * testsuite/gas/arm/undefined-insn-thumb.d: New test.
+ * testsuite/gas/arm/undefined-insn.s: New test.
+
2018-10-19 Fredrik Noring <noring@nocrew.org>
* testsuite/gas/mips/r5900.s: Extend the R5900 short loop fix
diff --git a/gas/testsuite/gas/arm/undefined-insn-arm.d b/gas/testsuite/gas/arm/undefined-insn-arm.d
new file mode 100644
index 0000000..265a507
--- /dev/null
+++ b/gas/testsuite/gas/arm/undefined-insn-arm.d
@@ -0,0 +1,5 @@
+#name: Undefined binary printing in arm mode
+#skip: *-unknown-pe *-*-vxworks
+#source: undefined-insn.s
+#objdump: -D -b binary -m armv7e-m
+#...
diff --git a/gas/testsuite/gas/arm/undefined-insn-thumb.d b/gas/testsuite/gas/arm/undefined-insn-thumb.d
new file mode 100644
index 0000000..72385f0
--- /dev/null
+++ b/gas/testsuite/gas/arm/undefined-insn-thumb.d
@@ -0,0 +1,5 @@
+#name: Undefined binary printing in thumb mode
+#skip: *-unknown-pe *-*-vxworks
+#source: undefined-insn.s
+#objdump: -D -b binary -m armv7e-m -M force-thumb
+#...
diff --git a/gas/testsuite/gas/arm/undefined-insn.s b/gas/testsuite/gas/arm/undefined-insn.s
new file mode 100644
index 0000000..cf59a03
--- /dev/null
+++ b/gas/testsuite/gas/arm/undefined-insn.s
@@ -0,0 +1 @@
+ .inst 0xffffffff