From 260edbc2caedd55298a64621088983551dfd208c Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Tue, 12 Jun 2007 16:55:32 +0000 Subject: [PATCH] 2007-06-12 Markus Deuling * gdbarch.sh (SMASH_TEXT_ADDRESS): Replace by gdbarch_smash_text_address. * somread.c (som_symtab_read): Likewise. * elfread.c (record_minimal_symbol): Likewise. * dbxread.c (process_one_symbol): Likewise. * coffread.c (coff_symtab_read): Likewise. * gdbarch.c, gdbarch.h: Regenerate. --- gdb/ChangeLog | 10 ++++++++++ gdb/coffread.c | 3 ++- gdb/dbxread.c | 2 +- gdb/elfread.c | 2 +- gdb/gdbarch.c | 6 ------ gdb/gdbarch.h | 8 +------- gdb/gdbarch.sh | 4 ++-- gdb/somread.c | 21 ++++++++++++++------- 8 files changed, 31 insertions(+), 25 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 20960f3eee..63cf287a22 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2007-06-12 Markus Deuling + + * gdbarch.sh (SMASH_TEXT_ADDRESS): Replace by + gdbarch_smash_text_address. + * somread.c (som_symtab_read): Likewise. + * elfread.c (record_minimal_symbol): Likewise. + * dbxread.c (process_one_symbol): Likewise. + * coffread.c (coff_symtab_read): Likewise. + * gdbarch.c, gdbarch.h: Regenerate. + 2007-06-12 Markus Deuling * gdbarch.sh (REGISTER_TO_VALUE): Replace by gdbarch_register_to_value. diff --git a/gdb/coffread.c b/gdb/coffread.c index 5b4e52a31b..b6f1feabbe 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -910,7 +910,8 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms, cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXTFUNC || cs->c_sclass == C_THUMBEXT ? mst_text : mst_file_text; - tmpaddr = SMASH_TEXT_ADDRESS (tmpaddr); + tmpaddr = gdbarch_smash_text_address + (current_gdbarch, tmpaddr); } else if (bfd_section->flags & SEC_ALLOC && bfd_section->flags & SEC_LOAD) diff --git a/gdb/dbxread.c b/gdb/dbxread.c index b26d00c6f2..702e315fd7 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -2738,7 +2738,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, /* Relocate for dynamic loading. */ valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile)); - valu = SMASH_TEXT_ADDRESS (valu); + valu = gdbarch_smash_text_address (current_gdbarch, valu); last_function_start = valu; goto define_a_symbol; diff --git a/gdb/elfread.c b/gdb/elfread.c index ed21750911..ea28d7c258 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -96,7 +96,7 @@ record_minimal_symbol (char *name, CORE_ADDR address, asection *bfd_section, struct objfile *objfile) { if (ms_type == mst_text || ms_type == mst_file_text) - address = SMASH_TEXT_ADDRESS (address); + address = gdbarch_smash_text_address (current_gdbarch, address); return prim_record_minimal_symbol_and_info (name, address, ms_type, NULL, bfd_section->index, bfd_section, objfile); diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index fa61d9a1a9..bfd1d00d54 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -1155,12 +1155,6 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file) fprintf_unfiltered (file, "gdbarch_dump: skip_trampoline_code = <0x%lx>\n", (long) current_gdbarch->skip_trampoline_code); -#ifdef SMASH_TEXT_ADDRESS - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "SMASH_TEXT_ADDRESS(addr)", - XSTRING (SMASH_TEXT_ADDRESS (addr))); -#endif fprintf_unfiltered (file, "gdbarch_dump: smash_text_address = <0x%lx>\n", (long) current_gdbarch->smash_text_address); diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index c20696ed11..b0a6bdebf7 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -756,18 +756,12 @@ typedef CORE_ADDR (gdbarch_addr_bits_remove_ftype) (CORE_ADDR addr); extern CORE_ADDR gdbarch_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr); extern void set_gdbarch_addr_bits_remove (struct gdbarch *gdbarch, gdbarch_addr_bits_remove_ftype *addr_bits_remove); -/* It is not at all clear why SMASH_TEXT_ADDRESS is not folded into +/* It is not at all clear why gdbarch_smash_text_address is not folded into gdbarch_addr_bits_remove. */ typedef CORE_ADDR (gdbarch_smash_text_address_ftype) (CORE_ADDR addr); extern CORE_ADDR gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr); extern void set_gdbarch_smash_text_address (struct gdbarch *gdbarch, gdbarch_smash_text_address_ftype *smash_text_address); -#if !defined (GDB_TM_FILE) && defined (SMASH_TEXT_ADDRESS) -#error "Non multi-arch definition of SMASH_TEXT_ADDRESS" -#endif -#if !defined (SMASH_TEXT_ADDRESS) -#define SMASH_TEXT_ADDRESS(addr) (gdbarch_smash_text_address (current_gdbarch, addr)) -#endif /* FIXME/cagney/2001-01-18: This should be split in two. A target method that indicates if the target needs software single step. An ISA method to diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 7440cd3489..425c32c4ec 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -596,9 +596,9 @@ m::CORE_ADDR:convert_from_func_ptr_addr:CORE_ADDR addr, struct target_ops *targ: # sort of generic thing to handle alignment or segmentation (it's # possible it should be in TARGET_READ_PC instead). f::CORE_ADDR:addr_bits_remove:CORE_ADDR addr:addr::core_addr_identity::0 -# It is not at all clear why SMASH_TEXT_ADDRESS is not folded into +# It is not at all clear why gdbarch_smash_text_address is not folded into # gdbarch_addr_bits_remove. -f:=:CORE_ADDR:smash_text_address:CORE_ADDR addr:addr::core_addr_identity::0 +f::CORE_ADDR:smash_text_address:CORE_ADDR addr:addr::core_addr_identity::0 # FIXME/cagney/2001-01-18: This should be split in two. A target method that # indicates if the target needs software single step. An ISA method to diff --git a/gdb/somread.c b/gdb/somread.c index 7f3130303a..c4f0744716 100644 --- a/gdb/somread.c +++ b/gdb/somread.c @@ -133,7 +133,8 @@ som_symtab_read (bfd *abfd, struct objfile *objfile, symname = bufp->name.n_strx + stringtab; ms_type = mst_text; bufp->symbol_value += text_offset; - bufp->symbol_value = SMASH_TEXT_ADDRESS (bufp->symbol_value); + bufp->symbol_value = gdbarch_smash_text_address + (current_gdbarch, bufp->symbol_value); break; case ST_ENTRY: @@ -146,14 +147,16 @@ som_symtab_read (bfd *abfd, struct objfile *objfile, else ms_type = mst_text; bufp->symbol_value += text_offset; - bufp->symbol_value = SMASH_TEXT_ADDRESS (bufp->symbol_value); + bufp->symbol_value = gdbarch_smash_text_address + (current_gdbarch, bufp->symbol_value); break; case ST_STUB: symname = bufp->name.n_strx + stringtab; ms_type = mst_solib_trampoline; bufp->symbol_value += text_offset; - bufp->symbol_value = SMASH_TEXT_ADDRESS (bufp->symbol_value); + bufp->symbol_value = gdbarch_smash_text_address + (current_gdbarch, bufp->symbol_value); break; case ST_DATA: @@ -181,7 +184,8 @@ som_symtab_read (bfd *abfd, struct objfile *objfile, symname = bufp->name.n_strx + stringtab; ms_type = mst_file_text; bufp->symbol_value += text_offset; - bufp->symbol_value = SMASH_TEXT_ADDRESS (bufp->symbol_value); + bufp->symbol_value = gdbarch_smash_text_address + (current_gdbarch, bufp->symbol_value); check_strange_names: /* Utah GCC 2.5, FSF GCC 2.6 and later generate correct local @@ -212,7 +216,8 @@ som_symtab_read (bfd *abfd, struct objfile *objfile, symname = bufp->name.n_strx + stringtab; ms_type = mst_file_text; bufp->symbol_value += text_offset; - bufp->symbol_value = SMASH_TEXT_ADDRESS (bufp->symbol_value); + bufp->symbol_value = gdbarch_smash_text_address + (current_gdbarch, bufp->symbol_value); break; case ST_ENTRY: @@ -223,14 +228,16 @@ som_symtab_read (bfd *abfd, struct objfile *objfile, we do for SS_UNIVERSAL and SS_EXTERNAL symbols above. */ ms_type = mst_file_text; bufp->symbol_value += text_offset; - bufp->symbol_value = SMASH_TEXT_ADDRESS (bufp->symbol_value); + bufp->symbol_value = gdbarch_smash_text_address + (current_gdbarch, bufp->symbol_value); break; case ST_STUB: symname = bufp->name.n_strx + stringtab; ms_type = mst_solib_trampoline; bufp->symbol_value += text_offset; - bufp->symbol_value = SMASH_TEXT_ADDRESS (bufp->symbol_value); + bufp->symbol_value = gdbarch_smash_text_address + (current_gdbarch, bufp->symbol_value); break;