aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2003-04-12 00:31:30 +0000
committerAlexandre Oliva <aoliva@redhat.com>2003-04-12 00:31:30 +0000
commit2252e863673a8c1b0c7a3753cf600a96a574e619 (patch)
tree0e96171a0cce34401e1215bad6f0b6097082ccb6 /gdb
parent2a8e99b308e528f8139cfa767fe518d53c6c6e30 (diff)
downloadfsf-binutils-gdb-2252e863673a8c1b0c7a3753cf600a96a574e619.zip
fsf-binutils-gdb-2252e863673a8c1b0c7a3753cf600a96a574e619.tar.gz
fsf-binutils-gdb-2252e863673a8c1b0c7a3753cf600a96a574e619.tar.bz2
* Makefile.in (libbfd_h): Added missing setting.
* mips-tdep.c (mips_gdbarch_init): Set disassembler_options according to the selected ABI.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/Makefile.in1
-rw-r--r--gdb/mips-tdep.c52
3 files changed, 35 insertions, 24 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 789b3d3..9c95fca 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2003-04-11 Alexandre Oliva <aoliva@redhat.com>
+
+ * Makefile.in (libbfd_h): Added missing setting.
+ * mips-tdep.c (mips_gdbarch_init): Set disassembler_options
+ according to the selected ABI.
+
2003-04-11 Jeff Johnston <jjohnstn@redhat.com>
* gdb_indent.sh: Recognize pid_t and sigset_t as types.
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 4a13551..a9c2a2c 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -574,6 +574,7 @@ elf_sh_h = $(INCLUDE_DIR)/elf/sh.h
elf_arm_h = $(INCLUDE_DIR)/elf/arm.h $(elf_reloc_macros_h)
elf_bfd_h = $(BFD_SRC)/elf-bfd.h
libaout_h = $(BFD_SRC)/libaout.h
+libbfd_h = $(BFD_SRC)/libbfd.h
remote_sim_h = $(INCLUDE_DIR)/gdb/remote-sim.h
demangle_h = $(INCLUDE_DIR)/demangle.h
obstack_h = $(INCLUDE_DIR)/obstack.h
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index d2204aa..4652e03 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -5731,6 +5731,34 @@ mips_gdbarch_init (struct gdbarch_info info,
if (wanted_abi != MIPS_ABI_UNKNOWN)
mips_abi = wanted_abi;
+ /* We have to set tm_print_insn_info before looking for a
+ pre-existing architecture, otherwise we may return before we get
+ a chance to set it up. */
+ if (mips_abi == MIPS_ABI_N32 || mips_abi == MIPS_ABI_N64)
+ {
+ /* Set up the disassembler info, so that we get the right
+ register names from libopcodes. */
+ if (mips_abi == MIPS_ABI_N32)
+ tm_print_insn_info.disassembler_options = "gpr-names=n32";
+ else
+ tm_print_insn_info.disassembler_options = "gpr-names=64";
+ tm_print_insn_info.flavour = bfd_target_elf_flavour;
+ tm_print_insn_info.arch = bfd_arch_mips;
+ if (info.bfd_arch_info != NULL
+ && info.bfd_arch_info->arch == bfd_arch_mips
+ && info.bfd_arch_info->mach)
+ tm_print_insn_info.mach = info.bfd_arch_info->mach;
+ else
+ tm_print_insn_info.mach = bfd_mach_mips8000;
+ }
+ else
+ /* This string is not recognized explicitly by the disassembler,
+ but it tells the disassembler to not try to guess the ABI from
+ the bfd elf headers, such that, if the user overrides the ABI
+ of a program linked as NewABI, the disassembly will follow the
+ register naming conventions specified by the user. */
+ tm_print_insn_info.disassembler_options = "gpr-names=32";
+
if (gdbarch_debug)
{
fprintf_unfiltered (gdb_stdlog,
@@ -5875,18 +5903,6 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_long_bit (gdbarch, 32);
set_gdbarch_ptr_bit (gdbarch, 32);
set_gdbarch_long_long_bit (gdbarch, 64);
-
- /* Set up the disassembler info, so that we get the right
- register names from libopcodes. */
- tm_print_insn_info.flavour = bfd_target_elf_flavour;
- tm_print_insn_info.arch = bfd_arch_mips;
- if (info.bfd_arch_info != NULL
- && info.bfd_arch_info->arch == bfd_arch_mips
- && info.bfd_arch_info->mach)
- tm_print_insn_info.mach = info.bfd_arch_info->mach;
- else
- tm_print_insn_info.mach = bfd_mach_mips8000;
-
set_gdbarch_use_struct_convention (gdbarch,
mips_n32n64_use_struct_convention);
set_gdbarch_reg_struct_has_addr (gdbarch,
@@ -5906,18 +5922,6 @@ mips_gdbarch_init (struct gdbarch_info info,
set_gdbarch_long_bit (gdbarch, 64);
set_gdbarch_ptr_bit (gdbarch, 64);
set_gdbarch_long_long_bit (gdbarch, 64);
-
- /* Set up the disassembler info, so that we get the right
- register names from libopcodes. */
- tm_print_insn_info.flavour = bfd_target_elf_flavour;
- tm_print_insn_info.arch = bfd_arch_mips;
- if (info.bfd_arch_info != NULL
- && info.bfd_arch_info->arch == bfd_arch_mips
- && info.bfd_arch_info->mach)
- tm_print_insn_info.mach = info.bfd_arch_info->mach;
- else
- tm_print_insn_info.mach = bfd_mach_mips8000;
-
set_gdbarch_use_struct_convention (gdbarch,
mips_n32n64_use_struct_convention);
set_gdbarch_reg_struct_has_addr (gdbarch,