aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>2001-09-05 23:44:44 +0000
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>2001-09-05 23:44:44 +0000
commit2bf0cb65923ab3e2fafe3304af2aa95a24822cf9 (patch)
tree581e882359913fb6e130fe161676385b4e13a574 /gdb/gdbarch.c
parenta4f30b31c8bdfd8723b0a19c6220785ecd63473a (diff)
downloadgdb-2bf0cb65923ab3e2fafe3304af2aa95a24822cf9.zip
gdb-2bf0cb65923ab3e2fafe3304af2aa95a24822cf9.tar.gz
gdb-2bf0cb65923ab3e2fafe3304af2aa95a24822cf9.tar.bz2
2001-09-05 Elena Zannoni <ezannoni@redhat.com>
* gdbarch.sh: Move include of dis-asm.h so it is generated earlier in gdbarch.h. (TARGET_PRINT_INSN): Multiarch. * gdbarch.h: Regenerate. * gdbarch.c: Regenerate. * arch-utils.c (legacy_print_insn): New function. * arch-utils.h (legacy_print_insn): Export. * cris-tdep.c (cris_delayed_get_disassembler): Use TARGET_PRINT_INSN, instead of tm_print_insn. * d10v-tdep.c (print_insn): Ditto. * d30v-tdep.c (print_insn): Ditto. * m32r-tdep.c (dump_insn): Ditto. * v850-tdep.c (v850_scan_prologue): Ditto. * mcore-tdep.c (mcore_dump_insn): Ditto. * sh-tdep.c (sh_gdbarch_init): Set print_insn gdbarch field.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index ced8354..c78e82d 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -249,6 +249,7 @@ struct gdbarch
gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
gdbarch_addr_bits_remove_ftype *addr_bits_remove;
gdbarch_software_single_step_ftype *software_single_step;
+ gdbarch_print_insn_ftype *print_insn;
gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
};
@@ -385,6 +386,7 @@ struct gdbarch startup_gdbarch =
0,
0,
0,
+ 0,
/* startup_gdbarch() */
};
@@ -484,6 +486,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
gdbarch->extra_stack_alignment_needed = 1;
gdbarch->convert_from_func_ptr_addr = core_addr_identity;
gdbarch->addr_bits_remove = core_addr_identity;
+ gdbarch->print_insn = legacy_print_insn;
gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
/* gdbarch_alloc() */
@@ -780,6 +783,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
/* Skip verify of addr_bits_remove, invalid_p == 0 */
/* Skip verify of software_single_step, has predicate */
+ /* Skip verify of print_insn, invalid_p == 0 */
/* Skip verify of skip_trampoline_code, invalid_p == 0 */
}
@@ -1472,6 +1476,12 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"SOFTWARE_SINGLE_STEP(sig, insert_breakpoints_p)",
XSTRING (SOFTWARE_SINGLE_STEP (sig, insert_breakpoints_p)));
#endif
+#ifdef TARGET_PRINT_INSN
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "TARGET_PRINT_INSN(vma, info)",
+ XSTRING (TARGET_PRINT_INSN (vma, info)));
+#endif
#ifdef SKIP_TRAMPOLINE_CODE
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -2210,6 +2220,13 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->software_single_step
/*SOFTWARE_SINGLE_STEP ()*/);
#endif
+#ifdef TARGET_PRINT_INSN
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_PRINT_INSN = 0x%08lx\n",
+ (long) current_gdbarch->print_insn
+ /*TARGET_PRINT_INSN ()*/);
+#endif
#ifdef SKIP_TRAMPOLINE_CODE
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
@@ -4330,6 +4347,24 @@ set_gdbarch_software_single_step (struct gdbarch *gdbarch,
gdbarch->software_single_step = software_single_step;
}
+int
+gdbarch_print_insn (struct gdbarch *gdbarch, bfd_vma vma, disassemble_info *info)
+{
+ if (gdbarch->print_insn == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_print_insn invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_print_insn called\n");
+ return gdbarch->print_insn (vma, info);
+}
+
+void
+set_gdbarch_print_insn (struct gdbarch *gdbarch,
+ gdbarch_print_insn_ftype print_insn)
+{
+ gdbarch->print_insn = print_insn;
+}
+
CORE_ADDR
gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, CORE_ADDR pc)
{