gdb/
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.
This commit is contained in:
parent
367d69d1bc
commit
85ddcc7021
10 changed files with 28 additions and 56 deletions
|
@ -1,3 +1,19 @@
|
|||
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.
|
||||
|
|
|
@ -460,14 +460,6 @@ arm_addr_bits_remove (struct gdbarch *gdbarch, CORE_ADDR val)
|
|||
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
|
||||
|
@ -10283,7 +10275,6 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
|||
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. */
|
||||
|
|
|
@ -941,7 +941,7 @@ 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 = 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)
|
||||
|
|
|
@ -2827,7 +2827,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 = gdbarch_smash_text_address (gdbarch, valu);
|
||||
valu = gdbarch_addr_bits_remove (gdbarch, valu);
|
||||
last_function_start = valu;
|
||||
|
||||
goto define_a_symbol;
|
||||
|
|
|
@ -205,7 +205,7 @@ record_minimal_symbol (const char *name, int name_len, int copy_name,
|
|||
|
||||
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,
|
||||
|
|
|
@ -220,7 +220,6 @@ struct gdbarch
|
|||
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;
|
||||
|
@ -389,7 +388,6 @@ struct gdbarch startup_gdbarch =
|
|||
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 */
|
||||
|
@ -526,7 +524,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
|
|||
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;
|
||||
|
@ -689,7 +686,6 @@ verify_gdbarch (struct gdbarch *gdbarch)
|
|||
/* 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)
|
||||
|
@ -1285,9 +1281,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
|
|||
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));
|
||||
|
@ -2981,23 +2974,6 @@ set_gdbarch_addr_bits_remove (struct gdbarch *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)
|
||||
{
|
||||
|
|
|
@ -600,13 +600,6 @@ typedef CORE_ADDR (gdbarch_addr_bits_remove_ftype) (struct gdbarch *gdbarch, COR
|
|||
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.
|
||||
|
|
|
@ -574,9 +574,6 @@ m:CORE_ADDR:convert_from_func_ptr_addr:CORE_ADDR addr, struct target_ops *targ:a
|
|||
# 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
|
||||
|
|
|
@ -2640,7 +2640,7 @@ hppa64_cannot_fetch_register (struct gdbarch *gdbarch, int regnum)
|
|||
}
|
||||
|
||||
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
|
||||
|
@ -3058,8 +3058,7 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
|||
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);
|
||||
|
|
|
@ -121,7 +121,7 @@ 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 = gdbarch_smash_text_address
|
||||
bufp->symbol_value = gdbarch_addr_bits_remove
|
||||
(gdbarch, bufp->symbol_value);
|
||||
break;
|
||||
|
||||
|
@ -135,7 +135,7 @@ som_symtab_read (bfd *abfd, struct objfile *objfile,
|
|||
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;
|
||||
|
||||
|
@ -143,7 +143,7 @@ som_symtab_read (bfd *abfd, struct objfile *objfile,
|
|||
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;
|
||||
|
||||
|
@ -172,7 +172,7 @@ 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 = gdbarch_smash_text_address
|
||||
bufp->symbol_value = gdbarch_addr_bits_remove
|
||||
(gdbarch, bufp->symbol_value);
|
||||
|
||||
check_strange_names:
|
||||
|
@ -204,7 +204,7 @@ 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 = gdbarch_smash_text_address
|
||||
bufp->symbol_value = gdbarch_addr_bits_remove
|
||||
(gdbarch, bufp->symbol_value);
|
||||
break;
|
||||
|
||||
|
@ -216,7 +216,7 @@ 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 = gdbarch_smash_text_address
|
||||
bufp->symbol_value = gdbarch_addr_bits_remove
|
||||
(gdbarch, bufp->symbol_value);
|
||||
break;
|
||||
|
||||
|
@ -224,7 +224,7 @@ som_symtab_read (bfd *abfd, struct objfile *objfile,
|
|||
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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue