mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-06 07:28:44 +08:00
Remove obsolete gdbarch_static_transform_name
gdbarch_static_transform_name is completely Solaris-specific or rather specific to the Studio compilers. Studio cc has deprecated Stabs support in the 12.4 release back in 2015, GCC has defaulted to DWARF-2 on Solaris 7+ since 2004 and Stabs themselves are pretty much obsolete, so the whole code can go. Tested on sparcv9-sun-solaris2.11 and x86_64-pc-linux-gnu with --enable-targets=all. * sol2-tdep.c (sol2_static_transform_name): Remove. (sol2_init_abi): Don't register it. * gdbarch.sh (static_transform_name): Remove. * gdbarch.c, gdbarch.h: Regenerate. * dbxread.c (read_dbx_symtab) <'S'>: Remove call to gdbarch_static_transform_name. * mdebugread.c (parse_partial_symbols) <'S'>: Likewise. * stabsread.c (define_symbol) <'X'>: Remove. (define_symbol) <'S'>: Remove gdbarch_static_transform_name handling. <'V'>: Likewise. * xcoffread.c (scan_xcoff_symtab): Remove gdbarch. <'S'>: Remove call to gdbarch_static_transform_name.
This commit is contained in:
@ -1,3 +1,20 @@
|
|||||||
|
2020-06-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
|
||||||
|
|
||||||
|
* sol2-tdep.c (sol2_static_transform_name): Remove.
|
||||||
|
(sol2_init_abi): Don't register it.
|
||||||
|
* gdbarch.sh (static_transform_name): Remove.
|
||||||
|
* gdbarch.c, gdbarch.h: Regenerate.
|
||||||
|
|
||||||
|
* dbxread.c (read_dbx_symtab) <'S'>: Remove call to
|
||||||
|
gdbarch_static_transform_name.
|
||||||
|
* mdebugread.c (parse_partial_symbols) <'S'>: Likewise.
|
||||||
|
* stabsread.c (define_symbol) <'X'>: Remove.
|
||||||
|
(define_symbol) <'S'>: Remove gdbarch_static_transform_name
|
||||||
|
handling.
|
||||||
|
<'V'>: Likewise.
|
||||||
|
* xcoffread.c (scan_xcoff_symtab): Remove gdbarch.
|
||||||
|
<'S'>: Remove call to gdbarch_static_transform_name.
|
||||||
|
|
||||||
2020-06-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
|
2020-06-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
|
||||||
|
|
||||||
* procfs.c (procfs_pre_trace): New function.
|
* procfs.c (procfs_pre_trace): New function.
|
||||||
|
@ -1460,9 +1460,6 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
|
|||||||
switch (p[1])
|
switch (p[1])
|
||||||
{
|
{
|
||||||
case 'S':
|
case 'S':
|
||||||
if (gdbarch_static_transform_name_p (gdbarch))
|
|
||||||
gdbarch_static_transform_name (gdbarch, namestring);
|
|
||||||
|
|
||||||
add_psymbol_to_list (gdb::string_view (sym_name, sym_len), true,
|
add_psymbol_to_list (gdb::string_view (sym_name, sym_len), true,
|
||||||
VAR_DOMAIN, LOC_STATIC,
|
VAR_DOMAIN, LOC_STATIC,
|
||||||
data_sect_index,
|
data_sect_index,
|
||||||
|
@ -292,7 +292,6 @@ struct gdbarch
|
|||||||
gdbarch_relocate_instruction_ftype *relocate_instruction;
|
gdbarch_relocate_instruction_ftype *relocate_instruction;
|
||||||
gdbarch_overlay_update_ftype *overlay_update;
|
gdbarch_overlay_update_ftype *overlay_update;
|
||||||
gdbarch_core_read_description_ftype *core_read_description;
|
gdbarch_core_read_description_ftype *core_read_description;
|
||||||
gdbarch_static_transform_name_ftype *static_transform_name;
|
|
||||||
int sofun_address_maybe_missing;
|
int sofun_address_maybe_missing;
|
||||||
gdbarch_process_record_ftype *process_record;
|
gdbarch_process_record_ftype *process_record;
|
||||||
gdbarch_process_record_signal_ftype *process_record_signal;
|
gdbarch_process_record_signal_ftype *process_record_signal;
|
||||||
@ -658,7 +657,6 @@ verify_gdbarch (struct gdbarch *gdbarch)
|
|||||||
/* Skip verify of relocate_instruction, has predicate. */
|
/* Skip verify of relocate_instruction, has predicate. */
|
||||||
/* Skip verify of overlay_update, has predicate. */
|
/* Skip verify of overlay_update, has predicate. */
|
||||||
/* Skip verify of core_read_description, has predicate. */
|
/* Skip verify of core_read_description, has predicate. */
|
||||||
/* Skip verify of static_transform_name, has predicate. */
|
|
||||||
/* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
|
/* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
|
||||||
/* Skip verify of process_record, has predicate. */
|
/* Skip verify of process_record, has predicate. */
|
||||||
/* Skip verify of process_record_signal, has predicate. */
|
/* Skip verify of process_record_signal, has predicate. */
|
||||||
@ -1436,12 +1434,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
|
|||||||
fprintf_unfiltered (file,
|
fprintf_unfiltered (file,
|
||||||
"gdbarch_dump: stap_register_suffixes = %s\n",
|
"gdbarch_dump: stap_register_suffixes = %s\n",
|
||||||
pstring_list (gdbarch->stap_register_suffixes));
|
pstring_list (gdbarch->stap_register_suffixes));
|
||||||
fprintf_unfiltered (file,
|
|
||||||
"gdbarch_dump: gdbarch_static_transform_name_p() = %d\n",
|
|
||||||
gdbarch_static_transform_name_p (gdbarch));
|
|
||||||
fprintf_unfiltered (file,
|
|
||||||
"gdbarch_dump: static_transform_name = <%s>\n",
|
|
||||||
host_address_to_string (gdbarch->static_transform_name));
|
|
||||||
fprintf_unfiltered (file,
|
fprintf_unfiltered (file,
|
||||||
"gdbarch_dump: sw_breakpoint_from_kind = <%s>\n",
|
"gdbarch_dump: sw_breakpoint_from_kind = <%s>\n",
|
||||||
host_address_to_string (gdbarch->sw_breakpoint_from_kind));
|
host_address_to_string (gdbarch->sw_breakpoint_from_kind));
|
||||||
@ -4075,30 +4067,6 @@ set_gdbarch_core_read_description (struct gdbarch *gdbarch,
|
|||||||
gdbarch->core_read_description = core_read_description;
|
gdbarch->core_read_description = core_read_description;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
gdbarch_static_transform_name_p (struct gdbarch *gdbarch)
|
|
||||||
{
|
|
||||||
gdb_assert (gdbarch != NULL);
|
|
||||||
return gdbarch->static_transform_name != NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *
|
|
||||||
gdbarch_static_transform_name (struct gdbarch *gdbarch, const char *name)
|
|
||||||
{
|
|
||||||
gdb_assert (gdbarch != NULL);
|
|
||||||
gdb_assert (gdbarch->static_transform_name != NULL);
|
|
||||||
if (gdbarch_debug >= 2)
|
|
||||||
fprintf_unfiltered (gdb_stdlog, "gdbarch_static_transform_name called\n");
|
|
||||||
return gdbarch->static_transform_name (name);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
set_gdbarch_static_transform_name (struct gdbarch *gdbarch,
|
|
||||||
gdbarch_static_transform_name_ftype static_transform_name)
|
|
||||||
{
|
|
||||||
gdbarch->static_transform_name = static_transform_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch)
|
gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch)
|
||||||
{
|
{
|
||||||
|
@ -1112,14 +1112,6 @@ typedef const struct target_desc * (gdbarch_core_read_description_ftype) (struct
|
|||||||
extern const struct target_desc * gdbarch_core_read_description (struct gdbarch *gdbarch, struct target_ops *target, bfd *abfd);
|
extern const struct target_desc * gdbarch_core_read_description (struct gdbarch *gdbarch, struct target_ops *target, bfd *abfd);
|
||||||
extern void set_gdbarch_core_read_description (struct gdbarch *gdbarch, gdbarch_core_read_description_ftype *core_read_description);
|
extern void set_gdbarch_core_read_description (struct gdbarch *gdbarch, gdbarch_core_read_description_ftype *core_read_description);
|
||||||
|
|
||||||
/* Handle special encoding of static variables in stabs debug info. */
|
|
||||||
|
|
||||||
extern int gdbarch_static_transform_name_p (struct gdbarch *gdbarch);
|
|
||||||
|
|
||||||
typedef const char * (gdbarch_static_transform_name_ftype) (const char *name);
|
|
||||||
extern const char * gdbarch_static_transform_name (struct gdbarch *gdbarch, const char *name);
|
|
||||||
extern void set_gdbarch_static_transform_name (struct gdbarch *gdbarch, gdbarch_static_transform_name_ftype *static_transform_name);
|
|
||||||
|
|
||||||
/* Set if the address in N_SO or N_FUN stabs may be zero. */
|
/* Set if the address in N_SO or N_FUN stabs may be zero. */
|
||||||
|
|
||||||
extern int gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch);
|
extern int gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch);
|
||||||
|
@ -842,8 +842,6 @@ F;void;overlay_update;struct obj_section *osect;osect
|
|||||||
|
|
||||||
M;const struct target_desc *;core_read_description;struct target_ops *target, bfd *abfd;target, abfd
|
M;const struct target_desc *;core_read_description;struct target_ops *target, bfd *abfd;target, abfd
|
||||||
|
|
||||||
# Handle special encoding of static variables in stabs debug info.
|
|
||||||
F;const char *;static_transform_name;const char *name;name
|
|
||||||
# Set if the address in N_SO or N_FUN stabs may be zero.
|
# Set if the address in N_SO or N_FUN stabs may be zero.
|
||||||
v;int;sofun_address_maybe_missing;;;0;0;;0
|
v;int;sofun_address_maybe_missing;;;0;0;;0
|
||||||
|
|
||||||
|
@ -3029,10 +3029,6 @@ parse_partial_symbols (minimal_symbol_reader &reader,
|
|||||||
switch (p[1])
|
switch (p[1])
|
||||||
{
|
{
|
||||||
case 'S':
|
case 'S':
|
||||||
if (gdbarch_static_transform_name_p (gdbarch))
|
|
||||||
namestring = gdbarch_static_transform_name
|
|
||||||
(gdbarch, namestring);
|
|
||||||
|
|
||||||
add_psymbol_to_list (gdb::string_view (namestring,
|
add_psymbol_to_list (gdb::string_view (namestring,
|
||||||
p - namestring),
|
p - namestring),
|
||||||
true, VAR_DOMAIN, LOC_STATIC,
|
true, VAR_DOMAIN, LOC_STATIC,
|
||||||
|
@ -61,52 +61,6 @@ sol2_sigtramp_p (struct frame_info *this_frame)
|
|||||||
return sol2_pc_in_sigtramp (pc, name);
|
return sol2_pc_in_sigtramp (pc, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Unglobalize NAME. */
|
|
||||||
|
|
||||||
static const char *
|
|
||||||
sol2_static_transform_name (const char *name)
|
|
||||||
{
|
|
||||||
/* The Sun compilers (Sun ONE Studio, Forte Developer, Sun WorkShop,
|
|
||||||
SunPRO) convert file static variables into global values, a
|
|
||||||
process known as globalization. In order to do this, the
|
|
||||||
compiler will create a unique prefix and prepend it to each file
|
|
||||||
static variable. For static variables within a function, this
|
|
||||||
globalization prefix is followed by the function name (nested
|
|
||||||
static variables within a function are supposed to generate a
|
|
||||||
warning message, and are left alone). The procedure is
|
|
||||||
documented in the Stabs Interface Manual, which is distributed
|
|
||||||
with the compilers, although version 4.0 of the manual seems to
|
|
||||||
be incorrect in some places, at least for SPARC. The
|
|
||||||
globalization prefix is encoded into an N_OPT stab, with the form
|
|
||||||
"G=<prefix>". The globalization prefix always seems to start
|
|
||||||
with a dollar sign '$' (sparc) resp. a dot '.' (x86); a dot '.'
|
|
||||||
is used as a separator. So we simply strip everything up until
|
|
||||||
the last dot. */
|
|
||||||
int prefix;
|
|
||||||
|
|
||||||
switch (gdbarch_bfd_arch_info (target_gdbarch ())->arch)
|
|
||||||
{
|
|
||||||
case bfd_arch_i386:
|
|
||||||
prefix = '.';
|
|
||||||
break;
|
|
||||||
case bfd_arch_sparc:
|
|
||||||
prefix = '$';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
internal_error (__FILE__, __LINE__, "Unexpected arch");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (name[0] == prefix)
|
|
||||||
{
|
|
||||||
const char *p = strrchr (name, '.');
|
|
||||||
if (p)
|
|
||||||
return p + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
static CORE_ADDR
|
static CORE_ADDR
|
||||||
sol2_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
|
sol2_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||||
{
|
{
|
||||||
@ -155,10 +109,6 @@ sol2_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
|
|||||||
SunPRO 3.0, the compiler does this for N_FUN stabs too. */
|
SunPRO 3.0, the compiler does this for N_FUN stabs too. */
|
||||||
set_gdbarch_sofun_address_maybe_missing (gdbarch, 1);
|
set_gdbarch_sofun_address_maybe_missing (gdbarch, 1);
|
||||||
|
|
||||||
/* The Sun compilers also do "globalization"; see the comment in
|
|
||||||
sol2_static_transform_name for more information. */
|
|
||||||
set_gdbarch_static_transform_name (gdbarch, sol2_static_transform_name);
|
|
||||||
|
|
||||||
/* Solaris uses SVR4-style shared libraries. */
|
/* Solaris uses SVR4-style shared libraries. */
|
||||||
set_gdbarch_skip_solib_resolver (gdbarch, sol2_skip_solib_resolver);
|
set_gdbarch_skip_solib_resolver (gdbarch, sol2_skip_solib_resolver);
|
||||||
|
|
||||||
|
@ -723,12 +723,6 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
|
|||||||
/* This was an anonymous type that was never fixed up. */
|
/* This was an anonymous type that was never fixed up. */
|
||||||
goto normal;
|
goto normal;
|
||||||
|
|
||||||
case 'X':
|
|
||||||
/* SunPRO (3.0 at least) static variable encoding. */
|
|
||||||
if (gdbarch_static_transform_name_p (gdbarch))
|
|
||||||
goto normal;
|
|
||||||
/* fall through */
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
complaint (_("Unknown C++ symbol name `%s'"),
|
complaint (_("Unknown C++ symbol name `%s'"),
|
||||||
string);
|
string);
|
||||||
@ -1186,23 +1180,6 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
|
|||||||
SYMBOL_TYPE (sym) = read_type (&p, objfile);
|
SYMBOL_TYPE (sym) = read_type (&p, objfile);
|
||||||
SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC;
|
SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC;
|
||||||
SET_SYMBOL_VALUE_ADDRESS (sym, valu);
|
SET_SYMBOL_VALUE_ADDRESS (sym, valu);
|
||||||
if (gdbarch_static_transform_name_p (gdbarch)
|
|
||||||
&& gdbarch_static_transform_name (gdbarch, sym->linkage_name ())
|
|
||||||
!= sym->linkage_name ())
|
|
||||||
{
|
|
||||||
struct bound_minimal_symbol msym;
|
|
||||||
|
|
||||||
msym = lookup_minimal_symbol (sym->linkage_name (), NULL, objfile);
|
|
||||||
if (msym.minsym != NULL)
|
|
||||||
{
|
|
||||||
const char *new_name = gdbarch_static_transform_name
|
|
||||||
(gdbarch, sym->linkage_name ());
|
|
||||||
|
|
||||||
sym->set_linkage_name (new_name);
|
|
||||||
SET_SYMBOL_VALUE_ADDRESS (sym,
|
|
||||||
BMSYMBOL_VALUE_ADDRESS (msym));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
|
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
|
||||||
add_symbol_to_list (sym, get_file_symbols ());
|
add_symbol_to_list (sym, get_file_symbols ());
|
||||||
break;
|
break;
|
||||||
@ -1367,22 +1344,6 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
|
|||||||
SYMBOL_TYPE (sym) = read_type (&p, objfile);
|
SYMBOL_TYPE (sym) = read_type (&p, objfile);
|
||||||
SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC;
|
SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC;
|
||||||
SET_SYMBOL_VALUE_ADDRESS (sym, valu);
|
SET_SYMBOL_VALUE_ADDRESS (sym, valu);
|
||||||
if (gdbarch_static_transform_name_p (gdbarch)
|
|
||||||
&& gdbarch_static_transform_name (gdbarch, sym->linkage_name ())
|
|
||||||
!= sym->linkage_name ())
|
|
||||||
{
|
|
||||||
struct bound_minimal_symbol msym;
|
|
||||||
|
|
||||||
msym = lookup_minimal_symbol (sym->linkage_name (), NULL, objfile);
|
|
||||||
if (msym.minsym != NULL)
|
|
||||||
{
|
|
||||||
const char *new_name = gdbarch_static_transform_name
|
|
||||||
(gdbarch, sym->linkage_name ());
|
|
||||||
|
|
||||||
sym->set_linkage_name (new_name);
|
|
||||||
SET_SYMBOL_VALUE_ADDRESS (sym, BMSYMBOL_VALUE_ADDRESS (msym));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
|
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
|
||||||
add_symbol_to_list (sym, get_local_symbols ());
|
add_symbol_to_list (sym, get_local_symbols ());
|
||||||
break;
|
break;
|
||||||
|
@ -2114,7 +2114,6 @@ static void
|
|||||||
scan_xcoff_symtab (minimal_symbol_reader &reader,
|
scan_xcoff_symtab (minimal_symbol_reader &reader,
|
||||||
struct objfile *objfile)
|
struct objfile *objfile)
|
||||||
{
|
{
|
||||||
struct gdbarch *gdbarch = objfile->arch ();
|
|
||||||
CORE_ADDR toc_offset = 0; /* toc offset value in data section. */
|
CORE_ADDR toc_offset = 0; /* toc offset value in data section. */
|
||||||
const char *filestring = NULL;
|
const char *filestring = NULL;
|
||||||
|
|
||||||
@ -2577,10 +2576,6 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
|
|||||||
switch (p[1])
|
switch (p[1])
|
||||||
{
|
{
|
||||||
case 'S':
|
case 'S':
|
||||||
if (gdbarch_static_transform_name_p (gdbarch))
|
|
||||||
namestring = gdbarch_static_transform_name
|
|
||||||
(gdbarch, namestring);
|
|
||||||
|
|
||||||
add_psymbol_to_list (gdb::string_view (namestring,
|
add_psymbol_to_list (gdb::string_view (namestring,
|
||||||
p - namestring),
|
p - namestring),
|
||||||
true, VAR_DOMAIN, LOC_STATIC,
|
true, VAR_DOMAIN, LOC_STATIC,
|
||||||
|
Reference in New Issue
Block a user