aboutsummaryrefslogtreecommitdiff
path: root/gdb/disasm.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-04-30 22:01:38 +0000
committerAndrew Cagney <cagney@redhat.com>2003-04-30 22:01:38 +0000
commit810ecf9ffe999cbdb524b772e9ab7e6a8e343ad0 (patch)
treeaaf5178990e3d804c0d74b2bbed434db163d1b9d /gdb/disasm.c
parent165a7f90d40e63c70f8a1059bc9dc7a906f42351 (diff)
downloadgdb-810ecf9ffe999cbdb524b772e9ab7e6a8e343ad0.zip
gdb-810ecf9ffe999cbdb524b772e9ab7e6a8e343ad0.tar.gz
gdb-810ecf9ffe999cbdb524b772e9ab7e6a8e343ad0.tar.bz2
2003-04-30 Andrew Cagney <cagney@redhat.com>
* gdbarch.sh (deprecated_tm_print_insn_info): Rename "tm_print_insn_info". (TARGET_PRINT_INSN_INFO): Delete macro. (dis_asm_read_memory): Delete function declaration. (dis_asm_memory_error, dis_asm_print_address): Ditto. (tm_print_insn_info): Delete variable definition. (_initialize_gdbarch): Do not initialize "tm_print_insn_info". * gdbarch.h, gdbarch.c: Re-generate. * d10v-tdep.c (display_trace): Replace "tm_print_insn_info" with "deprecated_tm_print_insn_info". * mcore-tdep.c (mcore_dump_insn): Ditto. * mips-tdep.c (mips_gdbarch_init): Ditto. * sparc-tdep.c (_initialize_sparc_tdep): Ditto. * v850-tdep.c (v850_scan_prologue, v850_gdbarch_init): Ditto. * ia64-tdep.c (_initialize_ia64_tdep): Ditto. * printcmd.c (print_insn): Use "deprecated_tm_print_insn_info" instead of TARGET_PRINT_INSN_INFO, add comment. * s390-tdep.c (s390_get_frame_info): Instead of "dis_asm_read_memory", use "deprecated_tm_print_insn_info". (s390_check_function_end, s390_is_sigreturn): Ditto. * corefile.c (dis_asm_read_memory): Move to "disasm.c". (dis_asm_memory_error, dis_asm_print_address): Ditto. * disasm.c: Include "gdbcore.h". (_initialize_disasm): New function, initialize "deprecated_tm_print_insn_info". (deprecated_tm_print_insn_info): New variable. (dis_asm_read_memory): Moved from "corefile.c", made static. (dis_asm_print_address, dis_asm_memory_error): Ditto. * Makefile.in (disasm.o): Update dependencies. 2003-04-28 Andrew Cagney <cagney@redhat.com> * gdbint.texinfo (Target Architecture Definition): Replace read_fp, TARGET_READ_FP and FP_REGNUM, with deprecated_read_fp, DEPRECATED_TARGET_READ_FP and DEPRECATED_REGNUM.
Diffstat (limited to 'gdb/disasm.c')
-rw-r--r--gdb/disasm.c42
1 files changed, 41 insertions, 1 deletions
diff --git a/gdb/disasm.c b/gdb/disasm.c
index 511855b..e460255 100644
--- a/gdb/disasm.c
+++ b/gdb/disasm.c
@@ -24,8 +24,8 @@
#include "value.h"
#include "ui-out.h"
#include "gdb_string.h"
-
#include "disasm.h"
+#include "gdbcore.h"
/* Disassemble functions.
FIXME: We should get rid of all the duplicate code in gdb that does
@@ -43,6 +43,28 @@ struct dis_line_entry
CORE_ADDR end_pc;
};
+/* Like target_read_memory, but slightly different parameters. */
+static int
+dis_asm_read_memory (bfd_vma memaddr, bfd_byte *myaddr, unsigned int len,
+ disassemble_info *info)
+{
+ return target_read_memory (memaddr, (char *) myaddr, len);
+}
+
+/* Like memory_error with slightly different parameters. */
+static void
+dis_asm_memory_error (int status, bfd_vma memaddr, disassemble_info *info)
+{
+ memory_error (status, memaddr);
+}
+
+/* Like print_address with slightly different parameters. */
+static void
+dis_asm_print_address (bfd_vma addr, struct disassemble_info *info)
+{
+ print_address (addr, info->stream);
+}
+
/* This variable determines where memory used for disassembly is read from. */
int gdb_disassemble_from_exec = -1;
@@ -391,3 +413,21 @@ gdb_disassembly (struct ui_out *uiout,
gdb_flush (gdb_stdout);
}
+
+
+/* FIXME: cagney/2003-04-28: This global deprecated_tm_print_insn_info
+ is going away. */
+disassemble_info deprecated_tm_print_insn_info;
+
+extern void _initialize_disasm (void);
+
+void
+_initialize_disasm (void)
+{
+ INIT_DISASSEMBLE_INFO_NO_ARCH (deprecated_tm_print_insn_info, gdb_stdout,
+ (fprintf_ftype)fprintf_filtered);
+ deprecated_tm_print_insn_info.flavour = bfd_target_unknown_flavour;
+ deprecated_tm_print_insn_info.read_memory_func = dis_asm_read_memory;
+ deprecated_tm_print_insn_info.memory_error_func = dis_asm_memory_error;
+ deprecated_tm_print_insn_info.print_address_func = dis_asm_print_address;
+}