aboutsummaryrefslogtreecommitdiff
path: root/gdb/arch-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/arch-utils.c')
-rw-r--r--gdb/arch-utils.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index b1cec80..c011b0f 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -37,6 +37,7 @@
#include "floatformat.h"
+#include "dis-asm.h"
struct displaced_step_closure *
simple_displaced_step_copy_insn (struct gdbarch *gdbarch,
@@ -973,6 +974,25 @@ default_guess_tracepoint_registers (struct gdbarch *gdbarch,
regcache_raw_supply (regcache, pc_regno, regs);
}
+int
+default_print_insn (bfd_vma memaddr, disassemble_info *info)
+{
+ disassembler_ftype disassemble_fn;
+
+ if (exec_bfd != NULL)
+ {
+ gdb_assert (info->arch == bfd_get_arch (exec_bfd));
+ gdb_assert (info->endian == (bfd_big_endian (exec_bfd)
+ ? BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE));
+ gdb_assert (info->mach == bfd_get_mach (exec_bfd));
+ }
+ disassemble_fn = disassembler (info->arch, info->endian == BFD_ENDIAN_BIG,
+ info->mach, exec_bfd);
+
+ gdb_assert (disassemble_fn != NULL);
+ return (*disassemble_fn) (memaddr, info);
+}
+
/* -Wmissing-prototypes */
extern initialize_file_ftype _initialize_gdbarch_utils;