2003-05-03 Andrew Cagney <cagney@redhat.com>

* disasm.h (print_insn): Declare.
	* disasm.c (init_gdb_disassemble_info): New function.
	(gdb_disassembly): Call init_gdb_disassemble_info.
	(gdb_print_insn): New function.
	* v850-tdep.c (v850_scan_prologue): Call gdb_print_insn, instead
	of TARGET_PRINT_INSN.  Send debug info to "gdb_stdlog".
	* mcore-tdep.c: Include "disasm.h"
	(mcore_dump_insn): Call gdb_print_insn, instead of TARGET_PRINT_INSN.
	* d10v-tdep.c: Include "disasm.h".
	(display_trace): Call gdb_print_insn, instead of print_insn.
	(print_insn): Delete function.
	* printcmd.c: Include "disasm.h".
	(print_insn): Delete function.
	(print_formatted): Call gdb_print_insn, instead of print_insn.
	* Makefile.in (printcmd.o): Update dependencies.
	(mcore-tdep.o, d10v-tdep.o): Ditto.

2003-05-03  Andrew Cagney  <cagney@redhat.com>

	* tuiDisassem.c (tui_disassemble): Call gdb_print_insn, instead of
	TARGET_PRINT_INSN.  Do not initialize a disassemble_info object.
This commit is contained in:
Andrew Cagney 2003-05-03 19:13:04 +00:00
parent 633a0b73d4
commit 92bf2b80f2
10 changed files with 79 additions and 70 deletions

View file

@ -42,6 +42,7 @@
#include "ui-out.h"
#include "gdb_assert.h"
#include "block.h"
#include "disasm.h"
extern int asm_demangle; /* Whether to demangle syms in asm printouts */
extern int addressprint; /* Whether to print hex addresses in HLL " */
@ -175,8 +176,6 @@ static void print_formatted (struct value *, int, int, struct ui_file *);
static struct format_data decode_format (char **, int, int);
static int print_insn (CORE_ADDR, struct ui_file *);
static void sym_info (char *, int);
@ -310,7 +309,7 @@ print_formatted (struct value *val, register int format, int size,
/* We often wrap here if there are long symbolic names. */
wrap_here (" ");
next_address = VALUE_ADDRESS (val)
+ print_insn (VALUE_ADDRESS (val), stream);
+ gdb_print_insn (VALUE_ADDRESS (val), stream);
next_section = VALUE_BFD_SECTION (val);
break;
@ -2240,31 +2239,6 @@ printf_command (char *arg, int from_tty)
do_cleanups (old_cleanups);
}
/* Print the instruction at address MEMADDR in debugged memory,
on STREAM. Returns length of the instruction, in bytes. */
/* FIXME: cagney/2003-04-28: Should instead be using the generic
disassembler but first need to clean that up and stop it trying to
access the exec file. */
static int
print_insn (CORE_ADDR memaddr, struct ui_file *stream)
{
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
deprecated_tm_print_insn_info.endian = BFD_ENDIAN_BIG;
else
deprecated_tm_print_insn_info.endian = BFD_ENDIAN_LITTLE;
if (TARGET_ARCHITECTURE != NULL)
deprecated_tm_print_insn_info.mach = TARGET_ARCHITECTURE->mach;
/* else: should set .mach=0 but some disassemblers don't grok this */
deprecated_tm_print_insn_info.stream = stream;
return TARGET_PRINT_INSN (memaddr, &deprecated_tm_print_insn_info);
}
void
_initialize_printcmd (void)
{