aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>2002-02-06 01:20:23 +0000
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>2002-02-06 01:20:23 +0000
commita2cf933af419a80cd9bc59bd2bfa2a10d88e8a05 (patch)
treeafd2d32dc664bd6b9badb59b73e527c3dc86d37a /gdb/gdbarch.c
parent9a36a60b534b58e46366eb0574699381850b60f8 (diff)
downloadgdb-a2cf933af419a80cd9bc59bd2bfa2a10d88e8a05.zip
gdb-a2cf933af419a80cd9bc59bd2bfa2a10d88e8a05.tar.gz
gdb-a2cf933af419a80cd9bc59bd2bfa2a10d88e8a05.tar.bz2
2002-02-04 Elena Zannoni <ezannoni@redhat.com>
* gdbarch.sh: Add definitions for COFF_MAKE_MSYMBOL_SPECIAL and ELF_MAKE_MSYMBOL_SPECIAL. * gdbarch.c, gdbarch.h: Regenerate. * arch-utils.c (default_elf_make_msymbol_special, default_coff_make_msymbol_special): New functions. * arch-utils.h (default_elf_make_msymbol_special, default_coff_make_msymbol_special): Export. * elfread.c (elf_symtab_read): Compile use of ELF_MAKE_MSYMBOL_SPECIAL unconditionally because it is now multiarched. * coffread.c (coff_symtab_read): Ditto, for COFF_MAKE_MSYMBOL_SPECIAL.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c178
1 files changed, 125 insertions, 53 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 98da991..bf39831 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -258,6 +258,8 @@ struct gdbarch
gdbarch_in_function_epilogue_p_ftype *in_function_epilogue_p;
gdbarch_construct_inferior_arguments_ftype *construct_inferior_arguments;
gdbarch_dwarf2_build_frame_info_ftype *dwarf2_build_frame_info;
+ gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
+ gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
};
@@ -400,6 +402,8 @@ struct gdbarch startup_gdbarch =
generic_in_function_epilogue_p,
construct_inferior_arguments,
0,
+ 0,
+ 0,
/* startup_gdbarch() */
};
@@ -513,6 +517,8 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->in_solib_call_trampoline = generic_in_solib_call_trampoline;
current_gdbarch->in_function_epilogue_p = generic_in_function_epilogue_p;
current_gdbarch->construct_inferior_arguments = construct_inferior_arguments;
+ current_gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special;
+ current_gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special;
/* gdbarch_alloc() */
return current_gdbarch;
@@ -768,6 +774,8 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of in_function_epilogue_p, invalid_p == 0 */
/* Skip verify of construct_inferior_arguments, invalid_p == 0 */
/* Skip verify of dwarf2_build_frame_info, has predicate */
+ /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
+ /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
buf = ui_file_xstrdup (log, &dummy);
make_cleanup (xfree, buf);
if (strlen (buf) > 0)
@@ -792,18 +800,17 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
fprintf_unfiltered (file,
"gdbarch_dump: GDB_MULTI_ARCH = %d\n",
GDB_MULTI_ARCH);
+#ifdef ADDR_BITS_REMOVE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "ADDR_BITS_REMOVE(addr)",
+ XSTRING (ADDR_BITS_REMOVE (addr)));
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
- "gdbarch_dump: in_function_epilogue_p = 0x%08lx\n",
- (long) current_gdbarch->in_function_epilogue_p);
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: register_read = 0x%08lx\n",
- (long) current_gdbarch->register_read);
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: register_write = 0x%08lx\n",
- (long) current_gdbarch->register_write);
+ "gdbarch_dump: ADDR_BITS_REMOVE = 0x%08lx\n",
+ (long) current_gdbarch->addr_bits_remove
+ /*ADDR_BITS_REMOVE ()*/);
+#endif
#ifdef ADDRESS_TO_POINTER
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
@@ -818,17 +825,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->address_to_pointer
/*ADDRESS_TO_POINTER ()*/);
#endif
-#ifdef ADDR_BITS_REMOVE
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "ADDR_BITS_REMOVE(addr)",
- XSTRING (ADDR_BITS_REMOVE (addr)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: ADDR_BITS_REMOVE = 0x%08lx\n",
- (long) current_gdbarch->addr_bits_remove
- /*ADDR_BITS_REMOVE ()*/);
-#endif
#ifdef BELIEVE_PCC_PROMOTION
fprintf_unfiltered (file,
"gdbarch_dump: BELIEVE_PCC_PROMOTION # %s\n",
@@ -975,6 +971,20 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->coerce_float_to_double
/*COERCE_FLOAT_TO_DOUBLE ()*/);
#endif
+#ifdef COFF_MAKE_MSYMBOL_SPECIAL
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "COFF_MAKE_MSYMBOL_SPECIAL(val, msym)",
+ XSTRING (COFF_MAKE_MSYMBOL_SPECIAL (val, msym)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: COFF_MAKE_MSYMBOL_SPECIAL = 0x%08lx\n",
+ (long) current_gdbarch->coff_make_msymbol_special
+ /*COFF_MAKE_MSYMBOL_SPECIAL ()*/);
+#endif
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
"gdbarch_dump: construct_inferior_arguments = 0x%08lx\n",
@@ -1059,6 +1069,20 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->ecoff_reg_to_regnum
/*ECOFF_REG_TO_REGNUM ()*/);
#endif
+#ifdef ELF_MAKE_MSYMBOL_SPECIAL
+#if GDB_MULTI_ARCH
+ /* Macro might contain `[{}]' when not multi-arch */
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "ELF_MAKE_MSYMBOL_SPECIAL(sym, msym)",
+ XSTRING (ELF_MAKE_MSYMBOL_SPECIAL (sym, msym)));
+#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: ELF_MAKE_MSYMBOL_SPECIAL = 0x%08lx\n",
+ (long) current_gdbarch->elf_make_msymbol_special
+ /*ELF_MAKE_MSYMBOL_SPECIAL ()*/);
+#endif
#ifdef EXTRACT_RETURN_VALUE
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
@@ -1136,17 +1160,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: FP_REGNUM = %d\n",
FP_REGNUM);
#endif
-#ifdef FRAMELESS_FUNCTION_INVOCATION
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "FRAMELESS_FUNCTION_INVOCATION(fi)",
- XSTRING (FRAMELESS_FUNCTION_INVOCATION (fi)));
- if (GDB_MULTI_ARCH)
- fprintf_unfiltered (file,
- "gdbarch_dump: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n",
- (long) current_gdbarch->frameless_function_invocation
- /*FRAMELESS_FUNCTION_INVOCATION ()*/);
-#endif
#ifdef FRAME_ARGS_ADDRESS
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -1202,6 +1215,17 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->frame_init_saved_regs
/*FRAME_INIT_SAVED_REGS ()*/);
#endif
+#ifdef FRAMELESS_FUNCTION_INVOCATION
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "FRAMELESS_FUNCTION_INVOCATION(fi)",
+ XSTRING (FRAMELESS_FUNCTION_INVOCATION (fi)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: FRAMELESS_FUNCTION_INVOCATION = 0x%08lx\n",
+ (long) current_gdbarch->frameless_function_invocation
+ /*FRAMELESS_FUNCTION_INVOCATION ()*/);
+#endif
#ifdef FRAME_LOCALS_ADDRESS
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -1271,33 +1295,33 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->init_extra_frame_info
/*INIT_EXTRA_FRAME_INFO ()*/);
#endif
-#ifdef INIT_FRAME_PC
+#ifdef INIT_FRAME_PC_FIRST
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
- "INIT_FRAME_PC(fromleaf, prev)",
- XSTRING (INIT_FRAME_PC (fromleaf, prev)));
+ "INIT_FRAME_PC_FIRST(fromleaf, prev)",
+ XSTRING (INIT_FRAME_PC_FIRST (fromleaf, prev)));
#endif
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
- "gdbarch_dump: INIT_FRAME_PC = 0x%08lx\n",
- (long) current_gdbarch->init_frame_pc
- /*INIT_FRAME_PC ()*/);
+ "gdbarch_dump: INIT_FRAME_PC_FIRST = 0x%08lx\n",
+ (long) current_gdbarch->init_frame_pc_first
+ /*INIT_FRAME_PC_FIRST ()*/);
#endif
-#ifdef INIT_FRAME_PC_FIRST
+#ifdef INIT_FRAME_PC
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
- "INIT_FRAME_PC_FIRST(fromleaf, prev)",
- XSTRING (INIT_FRAME_PC_FIRST (fromleaf, prev)));
+ "INIT_FRAME_PC(fromleaf, prev)",
+ XSTRING (INIT_FRAME_PC (fromleaf, prev)));
#endif
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
- "gdbarch_dump: INIT_FRAME_PC_FIRST = 0x%08lx\n",
- (long) current_gdbarch->init_frame_pc_first
- /*INIT_FRAME_PC_FIRST ()*/);
+ "gdbarch_dump: INIT_FRAME_PC = 0x%08lx\n",
+ (long) current_gdbarch->init_frame_pc
+ /*INIT_FRAME_PC ()*/);
#endif
#ifdef INNER_THAN
fprintf_unfiltered (file,
@@ -1310,6 +1334,17 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->inner_than
/*INNER_THAN ()*/);
#endif
+#ifdef IN_SOLIB_CALL_TRAMPOLINE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "IN_SOLIB_CALL_TRAMPOLINE(pc, name)",
+ XSTRING (IN_SOLIB_CALL_TRAMPOLINE (pc, name)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: IN_SOLIB_CALL_TRAMPOLINE = 0x%08lx\n",
+ (long) current_gdbarch->in_solib_call_trampoline
+ /*IN_SOLIB_CALL_TRAMPOLINE ()*/);
+#endif
#ifdef INTEGER_TO_ADDRESS
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -1321,17 +1356,10 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->integer_to_address
/*INTEGER_TO_ADDRESS ()*/);
#endif
-#ifdef IN_SOLIB_CALL_TRAMPOLINE
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "IN_SOLIB_CALL_TRAMPOLINE(pc, name)",
- XSTRING (IN_SOLIB_CALL_TRAMPOLINE (pc, name)));
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
- "gdbarch_dump: IN_SOLIB_CALL_TRAMPOLINE = 0x%08lx\n",
- (long) current_gdbarch->in_solib_call_trampoline
- /*IN_SOLIB_CALL_TRAMPOLINE ()*/);
-#endif
+ "gdbarch_dump: in_function_epilogue_p = 0x%08lx\n",
+ (long) current_gdbarch->in_function_epilogue_p);
#ifdef MAX_REGISTER_RAW_SIZE
fprintf_unfiltered (file,
"gdbarch_dump: MAX_REGISTER_RAW_SIZE # %s\n",
@@ -2091,6 +2119,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->use_struct_convention
/*USE_STRUCT_CONVENTION ()*/);
#endif
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: register_read = 0x%08lx\n",
+ (long) current_gdbarch->register_read);
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: register_write = 0x%08lx\n",
+ (long) current_gdbarch->register_write);
if (current_gdbarch->dump_tdep != NULL)
current_gdbarch->dump_tdep (current_gdbarch, file);
}
@@ -4386,6 +4422,42 @@ set_gdbarch_dwarf2_build_frame_info (struct gdbarch *gdbarch,
gdbarch->dwarf2_build_frame_info = dwarf2_build_frame_info;
}
+void
+gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch, asymbol *sym, struct minimal_symbol *msym)
+{
+ if (gdbarch->elf_make_msymbol_special == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_elf_make_msymbol_special invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_elf_make_msymbol_special called\n");
+ gdbarch->elf_make_msymbol_special (sym, msym);
+}
+
+void
+set_gdbarch_elf_make_msymbol_special (struct gdbarch *gdbarch,
+ gdbarch_elf_make_msymbol_special_ftype elf_make_msymbol_special)
+{
+ gdbarch->elf_make_msymbol_special = elf_make_msymbol_special;
+}
+
+void
+gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch, int val, struct minimal_symbol *msym)
+{
+ if (gdbarch->coff_make_msymbol_special == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_coff_make_msymbol_special invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_coff_make_msymbol_special called\n");
+ gdbarch->coff_make_msymbol_special (val, msym);
+}
+
+void
+set_gdbarch_coff_make_msymbol_special (struct gdbarch *gdbarch,
+ gdbarch_coff_make_msymbol_special_ftype coff_make_msymbol_special)
+{
+ gdbarch->coff_make_msymbol_special = coff_make_msymbol_special;
+}
+
/* Keep a registry of per-architecture data-pointers required by GDB
modules. */