Index: gdb/ChangeLog from Alexandre Oliva * Makefile.in (libbfd_h): New. (mips-tdep.o): Depend on it. * mips-tdep.c: Include it. (mips_gdbarch_init): Set tm_print_insn_info.symbols to at least an empty symbol. Index: gdb/Makefile.in =================================================================== RCS file: /cvs/uberbaum/gdb/Makefile.in,v retrieving revision 1.360 diff -u -p -r1.360 Makefile.in --- gdb/Makefile.in 6 Apr 2003 01:13:58 -0000 1.360 +++ gdb/Makefile.in 9 Apr 2003 03:44:40 -0000 @@ -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 @@ -1955,7 +1956,7 @@ mips-tdep.o: mips-tdep.c $(defs_h) $(gdb $(language_h) $(gdbcore_h) $(symfile_h) $(objfiles_h) \ $(gdbtypes_h) $(target_h) $(arch_utils_h) $(regcache_h) \ $(osabi_h) $(mips_tdep_h) $(block_h) $(opcode_mips_h) \ - $(elf_mips_h) $(elf_bfd_h) $(symcat_h) + $(elf_mips_h) $(elf_bfd_h) $(libbfd_h) $(symcat_h) mipsm3-nat.o: mipsm3-nat.c $(defs_h) $(inferior_h) $(regcache_h) mipsnbsd-nat.o: mipsnbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ $(mipsnbsd_tdep_h) Index: gdb/mips-tdep.c =================================================================== RCS file: /cvs/uberbaum/gdb/mips-tdep.c,v retrieving revision 1.187 diff -u -p -r1.187 mips-tdep.c --- gdb/mips-tdep.c 8 Apr 2003 19:21:15 -0000 1.187 +++ gdb/mips-tdep.c 9 Apr 2003 03:44:43 -0000 @@ -45,6 +45,7 @@ #include "opcode/mips.h" #include "elf/mips.h" +#include "libbfd.h" #include "elf-bfd.h" #include "symcat.h" @@ -5656,6 +5657,26 @@ mips_gdbarch_init (struct gdbarch_info i if (info.abfd) { + /* The disassembler uses *info.symbols to get to the bfd elf + flags, which it uses to tell the executable ABI, so we have + to give it at least one symbol. */ + if (tm_print_insn_info.symbols == NULL) + { + asymbol *symbol = NULL; + + /* It would be nice if we could bfd_release the previous + symbol, but we'd need a pointer to its bfd then. */ + symbol = bfd_make_empty_symbol (info.abfd); + if (symbol != NULL) + { + tm_print_insn_info.symbols = bfd_alloc (info.abfd, + sizeof (symbol)); + if (tm_print_insn_info.symbols != NULL) + *tm_print_insn_info.symbols = symbol; + tm_print_insn_info.num_symbols = 0; + } + } + /* First of all, extract the elf_flags, if available. */ if (bfd_get_flavour (info.abfd) == bfd_target_elf_flavour) elf_flags = elf_elfheader (info.abfd)->e_flags;