+2012-11-21 Yao Qi <yao@codesourcery.com>
+
+ PR tdep/7438
+ * gdbarch.sh (smash_text_address): Remove.
+ * gdbarch.c, gdbarch.h: Regenerate.
+ * arm-tdep.c (arm_smash_text_address): Remove.
+ (arm_gdbarch_init): Don't call set_gdbarch_smash_text_address.
+ * hppa-tdep.c (hppa_smash_text_address): Remove.
+ (hppa_addr_bits_remove): Rename from hppa_smash_text_address.
+ (hppa_gdbarch_init): Don't call set_gdbarch_smash_text_address.
+ Caller update.
+ * coffread.c (coff_symtab_read): Caller update.
+ * dbxread.c (process_one_symbol): Likewise.
+ * elfread.c (record_minimal_symbol): Likewise.
+ * somread.c (som_symtab_read): Likewise.
+
2012-11-20 Pierre Muller <muller@sourceware.org>
ARI fixes: sprintf rule.
return (val & 0x03fffffc);
}
-/* When reading symbols, we need to zap the low bit of the address,
- which may be set to 1 for Thumb functions. */
-static CORE_ADDR
-arm_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR val)
-{
- return val & ~1;
-}
-
/* Return 1 if PC is the start of a compiler helper function which
can be safely ignored during prologue skipping. IS_THUMB is true
if the function is known to be a Thumb function due to the way it
frame_base_set_default (gdbarch, &arm_normal_base);
/* Address manipulation. */
- set_gdbarch_smash_text_address (gdbarch, arm_smash_text_address);
set_gdbarch_addr_bits_remove (gdbarch, arm_addr_bits_remove);
/* Advance PC across function entry code. */
cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXTFUNC
|| cs->c_sclass == C_THUMBEXT ?
mst_text : mst_file_text;
- tmpaddr = gdbarch_smash_text_address (gdbarch, tmpaddr);
+ tmpaddr = gdbarch_addr_bits_remove (gdbarch, tmpaddr);
}
else if (bfd_section->flags & SEC_ALLOC
&& bfd_section->flags & SEC_LOAD)
/* Relocate for dynamic loading. */
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
- valu = gdbarch_smash_text_address (gdbarch, valu);
+ valu = gdbarch_addr_bits_remove (gdbarch, valu);
last_function_start = valu;
goto define_a_symbol;
if (ms_type == mst_text || ms_type == mst_file_text
|| ms_type == mst_text_gnu_ifunc)
- address = gdbarch_smash_text_address (gdbarch, address);
+ address = gdbarch_addr_bits_remove (gdbarch, address);
return prim_record_minimal_symbol_full (name, name_len, copy_name, address,
ms_type, bfd_section->index,
int frame_red_zone_size;
gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
gdbarch_addr_bits_remove_ftype *addr_bits_remove;
- gdbarch_smash_text_address_ftype *smash_text_address;
gdbarch_software_single_step_ftype *software_single_step;
gdbarch_single_step_through_delay_ftype *single_step_through_delay;
gdbarch_print_insn_ftype *print_insn;
0, /* frame_red_zone_size */
convert_from_func_ptr_addr_identity, /* convert_from_func_ptr_addr */
core_addr_identity, /* addr_bits_remove */
- core_addr_identity, /* smash_text_address */
0, /* software_single_step */
0, /* single_step_through_delay */
0, /* print_insn */
gdbarch->stabs_argument_has_addr = default_stabs_argument_has_addr;
gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr_identity;
gdbarch->addr_bits_remove = core_addr_identity;
- gdbarch->smash_text_address = core_addr_identity;
gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
gdbarch->skip_solib_resolver = generic_skip_solib_resolver;
gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
/* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
/* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
/* Skip verify of addr_bits_remove, invalid_p == 0 */
- /* Skip verify of smash_text_address, invalid_p == 0 */
/* Skip verify of software_single_step, has predicate. */
/* Skip verify of single_step_through_delay, has predicate. */
if (gdbarch->print_insn == 0)
fprintf_unfiltered (file,
"gdbarch_dump: skip_trampoline_code = <%s>\n",
host_address_to_string (gdbarch->skip_trampoline_code));
- fprintf_unfiltered (file,
- "gdbarch_dump: smash_text_address = <%s>\n",
- host_address_to_string (gdbarch->smash_text_address));
fprintf_unfiltered (file,
"gdbarch_dump: gdbarch_software_single_step_p() = %d\n",
gdbarch_software_single_step_p (gdbarch));
gdbarch->addr_bits_remove = addr_bits_remove;
}
-CORE_ADDR
-gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
-{
- gdb_assert (gdbarch != NULL);
- gdb_assert (gdbarch->smash_text_address != NULL);
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
- return gdbarch->smash_text_address (gdbarch, addr);
-}
-
-void
-set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
- gdbarch_smash_text_address_ftype smash_text_address)
-{
- gdbarch->smash_text_address = smash_text_address;
-}
-
int
gdbarch_software_single_step_p (struct gdbarch *gdbarch)
{
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 gdbarch_smash_text_address is not folded into
- gdbarch_addr_bits_remove. */
-
-typedef CORE_ADDR (gdbarch_smash_text_address_ftype) (struct gdbarch *gdbarch, 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);
-
/* 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
implement it.
# sort of generic thing to handle alignment or segmentation (it's
# possible it should be in TARGET_READ_PC instead).
m:CORE_ADDR:addr_bits_remove:CORE_ADDR addr:addr::core_addr_identity::0
-# It is not at all clear why gdbarch_smash_text_address is not folded into
-# gdbarch_addr_bits_remove.
-m: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
}
static CORE_ADDR
-hppa_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
+hppa_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR addr)
{
/* The low two bits of the PC on the PA contain the privilege level.
Some genius implementing a (non-GCC) compiler apparently decided
set_gdbarch_inner_than (gdbarch, core_addr_greaterthan);
set_gdbarch_sp_regnum (gdbarch, HPPA_SP_REGNUM);
set_gdbarch_fp0_regnum (gdbarch, HPPA_FP0_REGNUM);
- set_gdbarch_addr_bits_remove (gdbarch, hppa_smash_text_address);
- set_gdbarch_smash_text_address (gdbarch, hppa_smash_text_address);
+ set_gdbarch_addr_bits_remove (gdbarch, hppa_addr_bits_remove);
set_gdbarch_believe_pcc_promotion (gdbarch, 1);
set_gdbarch_read_pc (gdbarch, hppa_read_pc);
set_gdbarch_write_pc (gdbarch, hppa_write_pc);
symname = bufp->name.n_strx + stringtab;
ms_type = mst_text;
bufp->symbol_value += text_offset;
- bufp->symbol_value = gdbarch_smash_text_address
+ bufp->symbol_value = gdbarch_addr_bits_remove
(gdbarch, bufp->symbol_value);
break;
else
ms_type = mst_text;
bufp->symbol_value += text_offset;
- bufp->symbol_value = gdbarch_smash_text_address
+ bufp->symbol_value = gdbarch_addr_bits_remove
(gdbarch, bufp->symbol_value);
break;
symname = bufp->name.n_strx + stringtab;
ms_type = mst_solib_trampoline;
bufp->symbol_value += text_offset;
- bufp->symbol_value = gdbarch_smash_text_address
+ bufp->symbol_value = gdbarch_addr_bits_remove
(gdbarch, bufp->symbol_value);
break;
symname = bufp->name.n_strx + stringtab;
ms_type = mst_file_text;
bufp->symbol_value += text_offset;
- bufp->symbol_value = gdbarch_smash_text_address
+ bufp->symbol_value = gdbarch_addr_bits_remove
(gdbarch, bufp->symbol_value);
check_strange_names:
symname = bufp->name.n_strx + stringtab;
ms_type = mst_file_text;
bufp->symbol_value += text_offset;
- bufp->symbol_value = gdbarch_smash_text_address
+ bufp->symbol_value = gdbarch_addr_bits_remove
(gdbarch, bufp->symbol_value);
break;
we do for SS_UNIVERSAL and SS_EXTERNAL symbols above. */
ms_type = mst_file_text;
bufp->symbol_value += text_offset;
- bufp->symbol_value = gdbarch_smash_text_address
+ bufp->symbol_value = gdbarch_addr_bits_remove
(gdbarch, bufp->symbol_value);
break;
symname = bufp->name.n_strx + stringtab;
ms_type = mst_solib_trampoline;
bufp->symbol_value += text_offset;
- bufp->symbol_value = gdbarch_smash_text_address
+ bufp->symbol_value = gdbarch_addr_bits_remove
(gdbarch, bufp->symbol_value);
break;