aboutsummaryrefslogtreecommitdiff
path: root/opcodes/disassemble.c
diff options
context:
space:
mode:
authorPip Cet <pipcet@gmail.com>2017-04-06 17:17:15 +0100
committerNick Clifton <nickc@redhat.com>2017-04-06 17:20:02 +0100
commit62ecb94c4a2929c1aace3fb5470d2a5100255811 (patch)
treee2be6cbc234c3a38863d3e6899a9da01e07983a1 /opcodes/disassemble.c
parent0dedf3777db42712f460123ac0c63c49de5456f5 (diff)
downloadgdb-62ecb94c4a2929c1aace3fb5470d2a5100255811.zip
gdb-62ecb94c4a2929c1aace3fb5470d2a5100255811.tar.gz
gdb-62ecb94c4a2929c1aace3fb5470d2a5100255811.tar.bz2
Add support for disassembling WebAssembly opcodes.
include * dis-asm.h: Add prototypes for wasm32 disassembler. opcodes * Makefile.am: Add wasm32-dis.c. * configure.ac: Add wasm32-dis.c to wasm32 target. * disassemble.c: Add wasm32 disassembler code. * wasm32-dis.c: New file. * Makefile.in: Regenerate. * configure: Regenerate. * po/POTFILES.in: Regenerate. * po/opcodes.pot: Regenerate. gas * testsuite/gas/wasm32/allinsn.d: Adjust test for disassembler changes. * testsuite/gas/wasm32/disass.d: New test. * testsuite/gas/wasm32/disass.s: New test. * testsuite/gas/wasm32/disass-2.d: New test. * testsuite/gas/wasm32/disass-2.s: New test. * testsuite/gas/wasm32/reloc.d: Adjust test for changed reloc names. * testsuite/gas/wasm32/reloc.s: Update test for changed assembler syntax. * testsuite/gas/wasm32/wasm32.exp: Run new tests. Expect allinsn test to succeed.
Diffstat (limited to 'opcodes/disassemble.c')
-rw-r--r--opcodes/disassemble.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/opcodes/disassemble.c b/opcodes/disassemble.c
index eef0658..dd7d3a3 100644
--- a/opcodes/disassemble.c
+++ b/opcodes/disassemble.c
@@ -94,6 +94,7 @@
#define ARCH_vax
#define ARCH_visium
#define ARCH_w65
+#define ARCH_wasm32
#define ARCH_xstormy16
#define ARCH_xc16x
#define ARCH_xgate
@@ -474,6 +475,11 @@ disassembler (bfd *abfd)
disassemble = print_insn_w65;
break;
#endif
+#ifdef ARCH_wasm32
+ case bfd_arch_wasm32:
+ disassemble = print_insn_wasm32;
+ break;
+#endif
#ifdef ARCH_xgate
case bfd_arch_xgate:
disassemble = print_insn_xgate;
@@ -580,6 +586,9 @@ disassembler_usage (FILE *stream ATTRIBUTE_UNUSED)
#ifdef ARCH_s390
print_s390_disassembler_options (stream);
#endif
+#ifdef ARCH_wasm32
+ print_wasm32_disassembler_options (stream);
+#endif
return;
}
@@ -650,6 +659,11 @@ disassemble_init_for_target (struct disassemble_info * info)
disassemble_init_powerpc (info);
break;
#endif
+#ifdef ARCH_wasm32
+ case bfd_arch_wasm32:
+ disassemble_init_wasm32 (info);
+ break;
+#endif
#ifdef ARCH_s390
case bfd_arch_s390:
disassemble_init_s390 (info);