* Makefile.in (cris-tdep.o): Update dependencies.
* cris-tdep.c: Include "gdb_assert.h".
(cris_gdbarch_init): Set print_insn.
(_initialize_cris_tdep): Do not set deprecated_tm_print_insn.
(cris_delayed_get_disassembler): Simplify, directly call the
disassembler returned by cris_get_disassembler.
* hppa-tdep.c (hppa_gdbarch_init): Set print_insn.
(_initialize_hppa_tdep): Do not set deprecated_tm_print_insn.
* ns32k-tdep.c (ns32k_gdbarch_init): Set print_insn.
(_initialize_ns32k_tdep): Do not set deprecated_tm_print_insn.
* mn10300-tdep.c (mn10300_gdbarch_init): Set print_insn.
(_initialize_mn10300_tdep): Do not set deprecated_tm_print_insn.
* mcore-tdep.c (mcore_gdbarch_init): Set print_insn.
(_initialize_mcore_tdep): Do not set deprecated_tm_print_insn.
* frv-tdep.c (frv_gdbarch_init): Set print_insn.
(_initialize_frv_tdep): Do not set deprecated_tm_print_insn.
* sparc-tdep.c (sparc_gdbarch_init): Set print_insn.
(gdb_print_insn_sparc): Delete function.
(_initialize_sparc_tdep): Do not set deprecated_tm_print_insn or
deprecated_tm_print_insn_info.
* v850-tdep.c (v850_gdbarch_init): Set print_insn.
(_initialize_v850_tdep): Do not set deprecated_tm_print_insn.
(v850_gdbarch_init): Do not set deprecated_tm_print_insn_info.
* xstormy16-tdep.c (xstormy16_gdbarch_init): Set print_insn.
(_initialize_xstormy16_tdep): Do not set deprecated_tm_print_insn.
* s390-tdep.c (gdb_print_insn_s390): Delete function.
(_initialize_s390_tdep): Do not set deprecated_tm_print_insn.
(s390_gdbarch_init): Set print_insn.
+2003-08-27 Andrew Cagney <cagney@redhat.com>
+
+ * Makefile.in (cris-tdep.o): Update dependencies.
+ * cris-tdep.c: Include "gdb_assert.h".
+ (cris_gdbarch_init): Set print_insn.
+ (_initialize_cris_tdep): Do not set deprecated_tm_print_insn.
+ (cris_delayed_get_disassembler): Simplify, directly call the
+ disassembler returned by cris_get_disassembler.
+ * hppa-tdep.c (hppa_gdbarch_init): Set print_insn.
+ (_initialize_hppa_tdep): Do not set deprecated_tm_print_insn.
+ * ns32k-tdep.c (ns32k_gdbarch_init): Set print_insn.
+ (_initialize_ns32k_tdep): Do not set deprecated_tm_print_insn.
+ * mn10300-tdep.c (mn10300_gdbarch_init): Set print_insn.
+ (_initialize_mn10300_tdep): Do not set deprecated_tm_print_insn.
+ * mcore-tdep.c (mcore_gdbarch_init): Set print_insn.
+ (_initialize_mcore_tdep): Do not set deprecated_tm_print_insn.
+ * frv-tdep.c (frv_gdbarch_init): Set print_insn.
+ (_initialize_frv_tdep): Do not set deprecated_tm_print_insn.
+ * sparc-tdep.c (sparc_gdbarch_init): Set print_insn.
+ (gdb_print_insn_sparc): Delete function.
+ (_initialize_sparc_tdep): Do not set deprecated_tm_print_insn or
+ deprecated_tm_print_insn_info.
+ * v850-tdep.c (v850_gdbarch_init): Set print_insn.
+ (_initialize_v850_tdep): Do not set deprecated_tm_print_insn.
+ (v850_gdbarch_init): Do not set deprecated_tm_print_insn_info.
+ * xstormy16-tdep.c (xstormy16_gdbarch_init): Set print_insn.
+ (_initialize_xstormy16_tdep): Do not set deprecated_tm_print_insn.
+ * s390-tdep.c (gdb_print_insn_s390): Delete function.
+ (_initialize_s390_tdep): Do not set deprecated_tm_print_insn.
+ (s390_gdbarch_init): Set print_insn.
+
2003-08-27 Andrew Cagney <cagney@redhat.com>
* ppc-linux-tdep.c (ppc64_call_dummy_address): Delete function.
cris-tdep.o: cris-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(inferior_h) \
$(gdbtypes_h) $(gdbcore_h) $(gdbcmd_h) $(target_h) $(value_h) \
$(opcode_cris_h) $(arch_utils_h) $(regcache_h) $(symfile_h) \
- $(solib_h) $(solib_svr4_h) $(gdb_string_h)
+ $(solib_h) $(solib_svr4_h) $(gdb_string_h) $(gdb_assert_h)
c-typeprint.o: c-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \
$(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(target_h) \
$(language_h) $(demangle_h) $(c_lang_h) $(typeprint_h) $(cp_abi_h) \
#include "opcode/cris.h"
#include "arch-utils.h"
#include "regcache.h"
+#include "gdb_assert.h"
/* To get entry_point_address. */
#include "symfile.h"
static int
cris_delayed_get_disassembler (bfd_vma addr, disassemble_info *info)
{
- deprecated_tm_print_insn = cris_get_disassembler (exec_bfd);
- return TARGET_PRINT_INSN (addr, info);
+ int (*print_insn) (bfd_vma addr, disassemble_info *info);
+ /* FIXME: cagney/2003-08-27: It should be possible to select a CRIS
+ disassembler, even when there is no BFD. Does something like
+ "gdb; target remote; disassmeble *0x123" work? */
+ gdb_assert (exec_bfd != NULL);
+ print_insn = cris_get_disassembler (exec_bfd);
+ gdb_assert (print_insn != NULL);
+ return print_insn (addr, info);
}
/* Copied from <asm/elf.h>. */
gdbarch_register (bfd_arch_cris, cris_gdbarch_init, cris_dump_tdep);
- /* Used in disassembly. */
- deprecated_tm_print_insn = cris_delayed_get_disassembler;
-
/* CRIS-specific user-commands. */
c = add_set_cmd ("cris-version", class_support, var_integer,
(char *) &usr_cmd_cris_version,
set_solib_svr4_fetch_link_map_offsets
(gdbarch, cris_linux_svr4_fetch_link_map_offsets);
+ /* FIXME: cagney/2003-08-27: It should be possible to select a CRIS
+ disassembler, even when there is no BFD. Does something like
+ "gdb; target remote; disassmeble *0x123" work? */
+ set_gdbarch_print_insn (gdbarch, cris_delayed_get_disassembler);
+
return gdbarch;
}
break;
}
+ set_gdbarch_print_insn (gdbarch, print_insn_frv);
+
return gdbarch;
}
_initialize_frv_tdep (void)
{
register_gdbarch_init (bfd_arch_frv, frv_gdbarch_init);
-
- deprecated_tm_print_insn = print_insn_frv;
}
/* Helper for function argument information. */
set_gdbarch_fetch_pointer_argument (gdbarch, hppa_fetch_pointer_argument);
+ set_gdbarch_print_insn (gdbarch, print_insn_hppa);
+
/* Hook in ABI-specific overrides, if they have been registered. */
gdbarch_init_osabi (info, gdbarch);
void break_at_finish_at_depth_command (char *arg, int from_tty);
gdbarch_register (bfd_arch_hppa, hppa_gdbarch_init, hppa_dump_tdep);
- deprecated_tm_print_insn = print_insn_hppa;
add_cmd ("unwind", class_maintenance, unwind_command,
"Print unwind table entry at given address.",
/* Should be using push_dummy_call. */
set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
+ set_gdbarch_print_insn (gdbarch, print_insn_mcore);
+
return gdbarch;
}
void
_initialize_mcore_tdep (void)
{
- extern int print_insn_mcore (bfd_vma, disassemble_info *);
gdbarch_register (bfd_arch_mcore, mcore_gdbarch_init, mcore_dump_tdep);
- deprecated_tm_print_insn = print_insn_mcore;
#ifdef MCORE_DEBUG
add_show_from_set (add_set_cmd ("mcoredebug", no_class,
/* Should be using push_dummy_call. */
set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
+ set_gdbarch_print_insn (gdbarch, print_insn_mn10300);
+
return gdbarch;
}
{
/* printf("_initialize_mn10300_tdep\n"); */
- deprecated_tm_print_insn = print_insn_mn10300;
-
register_gdbarch_init (bfd_arch_mn10300, mn10300_gdbarch_init);
}
/* Should be using push_dummy_call. */
set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
+ set_gdbarch_print_insn (gdbarch, print_insn_ns32k);
+
/* Hook in OS ABI-specific overrides, if they have been registered. */
gdbarch_init_osabi (info, gdbarch);
{
gdbarch_register (bfd_arch_ns32k, ns32k_gdbarch_init, NULL);
- deprecated_tm_print_insn = print_insn_ns32k;
}
value, arglen);
}
}
-static int
-gdb_print_insn_s390 (bfd_vma memaddr, disassemble_info * info)
-{
- bfd_byte instrbuff[S390_MAX_INSTR_SIZE];
- int instrlen, cnt;
-
- instrlen = s390_readinstruction (instrbuff, (CORE_ADDR) memaddr, info);
- if (instrlen < 0)
- {
- (*info->memory_error_func) (instrlen, memaddr, info);
- return -1;
- }
- for (cnt = 0; cnt < instrlen; cnt++)
- info->fprintf_func (info->stream, "%02X ", instrbuff[cnt]);
- for (cnt = instrlen; cnt < S390_MAX_INSTR_SIZE; cnt++)
- info->fprintf_func (info->stream, " ");
- instrlen = print_insn_s390 (memaddr, info);
- return instrlen;
-}
-
/* Not the most efficent code in the world */
/* Should be using push_dummy_call. */
set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
+ set_gdbarch_print_insn (gdbarch, print_insn_s390);
+
return gdbarch;
}
/* Hook us into the gdbarch mechanism. */
register_gdbarch_init (bfd_arch_s390, s390_gdbarch_init);
- if (!deprecated_tm_print_insn) /* Someone may have already set it */
- deprecated_tm_print_insn = gdb_print_insn_s390;
}
// OBSOLETE }
#endif
-\f
-static int
-gdb_print_insn_sparc (bfd_vma memaddr, disassemble_info *info)
-{
- /* It's necessary to override mach again because print_insn messes it up. */
- info->mach = TARGET_ARCHITECTURE->mach;
- return print_insn_sparc (memaddr, info);
-}
-\f
-
#define SPARC_F0_REGNUM FP0_REGNUM /* %f0 */
#define SPARC_F1_REGNUM (FP0_REGNUM + 1)/* %f1 */
#define SPARC_O0_REGNUM O0_REGNUM /* %o0 */
/* Hook us into the gdbarch mechanism. */
gdbarch_register (bfd_arch_sparc, sparc_gdbarch_init, sparc_dump_tdep);
- deprecated_tm_print_insn = gdb_print_insn_sparc;
- deprecated_tm_print_insn_info.mach = TM_PRINT_INSN_MACH; /* Selects sparc/sparclite */
/* OBSOLETE target_architecture_hook = sparc_target_architecture_hook; */
}
break;
}
+ set_gdbarch_print_insn (gdbarch, print_insn_sparc);
+
/* Hook in OS ABI-specific overrides, if they have been registered. */
gdbarch_init_osabi (info, gdbarch);
if (v850_processor_type_table[i].mach == info.bfd_arch_info->mach)
{
v850_register_names = v850_processor_type_table[i].regnames;
- deprecated_tm_print_insn_info.mach = info.bfd_arch_info->mach;
break;
}
}
/* Should be using push_dummy_call. */
set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
+ set_gdbarch_print_insn (gdbarch, print_insn_v850);
+
return gdbarch;
}
void
_initialize_v850_tdep (void)
{
- deprecated_tm_print_insn = print_insn_v850;
register_gdbarch_init (bfd_arch_v850, v850_gdbarch_init);
}
/* Should be using push_dummy_call. */
set_gdbarch_deprecated_dummy_write_sp (gdbarch, deprecated_write_sp);
+ set_gdbarch_print_insn (gdbarch, print_insn_xstormy16);
+
return gdbarch;
}
extern int print_insn_xstormy16 ();
register_gdbarch_init (bfd_arch_xstormy16, xstormy16_gdbarch_init);
- deprecated_tm_print_insn = print_insn_xstormy16;
}