GNU Binutils with patches for OS216
Revision | bb6e55f3ee440c5d03fd47ec32255c20b9f895fe (tree) |
---|---|
Time | 2020-06-26 00:56:12 |
Author | Rainer Orth <ro@CeBi...> |
Commiter | Rainer Orth |
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.
@@ -1,5 +1,22 @@ | ||
1 | 1 | 2020-06-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> |
2 | 2 | |
3 | + * sol2-tdep.c (sol2_static_transform_name): Remove. | |
4 | + (sol2_init_abi): Don't register it. | |
5 | + * gdbarch.sh (static_transform_name): Remove. | |
6 | + * gdbarch.c, gdbarch.h: Regenerate. | |
7 | + | |
8 | + * dbxread.c (read_dbx_symtab) <'S'>: Remove call to | |
9 | + gdbarch_static_transform_name. | |
10 | + * mdebugread.c (parse_partial_symbols) <'S'>: Likewise. | |
11 | + * stabsread.c (define_symbol) <'X'>: Remove. | |
12 | + (define_symbol) <'S'>: Remove gdbarch_static_transform_name | |
13 | + handling. | |
14 | + <'V'>: Likewise. | |
15 | + * xcoffread.c (scan_xcoff_symtab): Remove gdbarch. | |
16 | + <'S'>: Remove call to gdbarch_static_transform_name. | |
17 | + | |
18 | +2020-06-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | |
19 | + | |
3 | 20 | * procfs.c (procfs_pre_trace): New function. |
4 | 21 | (procfs_target::create_inferior): Pass it to fork_inferior. |
5 | 22 |
@@ -1460,9 +1460,6 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile) | ||
1460 | 1460 | switch (p[1]) |
1461 | 1461 | { |
1462 | 1462 | case 'S': |
1463 | - if (gdbarch_static_transform_name_p (gdbarch)) | |
1464 | - gdbarch_static_transform_name (gdbarch, namestring); | |
1465 | - | |
1466 | 1463 | add_psymbol_to_list (gdb::string_view (sym_name, sym_len), true, |
1467 | 1464 | VAR_DOMAIN, LOC_STATIC, |
1468 | 1465 | data_sect_index, |
@@ -292,7 +292,6 @@ struct gdbarch | ||
292 | 292 | gdbarch_relocate_instruction_ftype *relocate_instruction; |
293 | 293 | gdbarch_overlay_update_ftype *overlay_update; |
294 | 294 | gdbarch_core_read_description_ftype *core_read_description; |
295 | - gdbarch_static_transform_name_ftype *static_transform_name; | |
296 | 295 | int sofun_address_maybe_missing; |
297 | 296 | gdbarch_process_record_ftype *process_record; |
298 | 297 | gdbarch_process_record_signal_ftype *process_record_signal; |
@@ -658,7 +657,6 @@ verify_gdbarch (struct gdbarch *gdbarch) | ||
658 | 657 | /* Skip verify of relocate_instruction, has predicate. */ |
659 | 658 | /* Skip verify of overlay_update, has predicate. */ |
660 | 659 | /* Skip verify of core_read_description, has predicate. */ |
661 | - /* Skip verify of static_transform_name, has predicate. */ | |
662 | 660 | /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */ |
663 | 661 | /* Skip verify of process_record, has predicate. */ |
664 | 662 | /* Skip verify of process_record_signal, has predicate. */ |
@@ -1437,12 +1435,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) | ||
1437 | 1435 | "gdbarch_dump: stap_register_suffixes = %s\n", |
1438 | 1436 | pstring_list (gdbarch->stap_register_suffixes)); |
1439 | 1437 | fprintf_unfiltered (file, |
1440 | - "gdbarch_dump: gdbarch_static_transform_name_p() = %d\n", | |
1441 | - gdbarch_static_transform_name_p (gdbarch)); | |
1442 | - fprintf_unfiltered (file, | |
1443 | - "gdbarch_dump: static_transform_name = <%s>\n", | |
1444 | - host_address_to_string (gdbarch->static_transform_name)); | |
1445 | - fprintf_unfiltered (file, | |
1446 | 1438 | "gdbarch_dump: sw_breakpoint_from_kind = <%s>\n", |
1447 | 1439 | host_address_to_string (gdbarch->sw_breakpoint_from_kind)); |
1448 | 1440 | fprintf_unfiltered (file, |
@@ -4076,30 +4068,6 @@ set_gdbarch_core_read_description (struct gdbarch *gdbarch, | ||
4076 | 4068 | } |
4077 | 4069 | |
4078 | 4070 | int |
4079 | -gdbarch_static_transform_name_p (struct gdbarch *gdbarch) | |
4080 | -{ | |
4081 | - gdb_assert (gdbarch != NULL); | |
4082 | - return gdbarch->static_transform_name != NULL; | |
4083 | -} | |
4084 | - | |
4085 | -const char * | |
4086 | -gdbarch_static_transform_name (struct gdbarch *gdbarch, const char *name) | |
4087 | -{ | |
4088 | - gdb_assert (gdbarch != NULL); | |
4089 | - gdb_assert (gdbarch->static_transform_name != NULL); | |
4090 | - if (gdbarch_debug >= 2) | |
4091 | - fprintf_unfiltered (gdb_stdlog, "gdbarch_static_transform_name called\n"); | |
4092 | - return gdbarch->static_transform_name (name); | |
4093 | -} | |
4094 | - | |
4095 | -void | |
4096 | -set_gdbarch_static_transform_name (struct gdbarch *gdbarch, | |
4097 | - gdbarch_static_transform_name_ftype static_transform_name) | |
4098 | -{ | |
4099 | - gdbarch->static_transform_name = static_transform_name; | |
4100 | -} | |
4101 | - | |
4102 | -int | |
4103 | 4071 | gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch) |
4104 | 4072 | { |
4105 | 4073 | gdb_assert (gdbarch != NULL); |
@@ -1112,14 +1112,6 @@ typedef const struct target_desc * (gdbarch_core_read_description_ftype) (struct | ||
1112 | 1112 | extern const struct target_desc * gdbarch_core_read_description (struct gdbarch *gdbarch, struct target_ops *target, bfd *abfd); |
1113 | 1113 | extern void set_gdbarch_core_read_description (struct gdbarch *gdbarch, gdbarch_core_read_description_ftype *core_read_description); |
1114 | 1114 | |
1115 | -/* Handle special encoding of static variables in stabs debug info. */ | |
1116 | - | |
1117 | -extern int gdbarch_static_transform_name_p (struct gdbarch *gdbarch); | |
1118 | - | |
1119 | -typedef const char * (gdbarch_static_transform_name_ftype) (const char *name); | |
1120 | -extern const char * gdbarch_static_transform_name (struct gdbarch *gdbarch, const char *name); | |
1121 | -extern void set_gdbarch_static_transform_name (struct gdbarch *gdbarch, gdbarch_static_transform_name_ftype *static_transform_name); | |
1122 | - | |
1123 | 1115 | /* Set if the address in N_SO or N_FUN stabs may be zero. */ |
1124 | 1116 | |
1125 | 1117 | extern int gdbarch_sofun_address_maybe_missing (struct gdbarch *gdbarch); |
@@ -842,8 +842,6 @@ F;void;overlay_update;struct obj_section *osect;osect | ||
842 | 842 | |
843 | 843 | M;const struct target_desc *;core_read_description;struct target_ops *target, bfd *abfd;target, abfd |
844 | 844 | |
845 | -# Handle special encoding of static variables in stabs debug info. | |
846 | -F;const char *;static_transform_name;const char *name;name | |
847 | 845 | # Set if the address in N_SO or N_FUN stabs may be zero. |
848 | 846 | v;int;sofun_address_maybe_missing;;;0;0;;0 |
849 | 847 |
@@ -3029,10 +3029,6 @@ parse_partial_symbols (minimal_symbol_reader &reader, | ||
3029 | 3029 | switch (p[1]) |
3030 | 3030 | { |
3031 | 3031 | case 'S': |
3032 | - if (gdbarch_static_transform_name_p (gdbarch)) | |
3033 | - namestring = gdbarch_static_transform_name | |
3034 | - (gdbarch, namestring); | |
3035 | - | |
3036 | 3032 | add_psymbol_to_list (gdb::string_view (namestring, |
3037 | 3033 | p - namestring), |
3038 | 3034 | true, VAR_DOMAIN, LOC_STATIC, |
@@ -61,52 +61,6 @@ sol2_sigtramp_p (struct frame_info *this_frame) | ||
61 | 61 | return sol2_pc_in_sigtramp (pc, name); |
62 | 62 | } |
63 | 63 | |
64 | -/* Unglobalize NAME. */ | |
65 | - | |
66 | -static const char * | |
67 | -sol2_static_transform_name (const char *name) | |
68 | -{ | |
69 | - /* The Sun compilers (Sun ONE Studio, Forte Developer, Sun WorkShop, | |
70 | - SunPRO) convert file static variables into global values, a | |
71 | - process known as globalization. In order to do this, the | |
72 | - compiler will create a unique prefix and prepend it to each file | |
73 | - static variable. For static variables within a function, this | |
74 | - globalization prefix is followed by the function name (nested | |
75 | - static variables within a function are supposed to generate a | |
76 | - warning message, and are left alone). The procedure is | |
77 | - documented in the Stabs Interface Manual, which is distributed | |
78 | - with the compilers, although version 4.0 of the manual seems to | |
79 | - be incorrect in some places, at least for SPARC. The | |
80 | - globalization prefix is encoded into an N_OPT stab, with the form | |
81 | - "G=<prefix>". The globalization prefix always seems to start | |
82 | - with a dollar sign '$' (sparc) resp. a dot '.' (x86); a dot '.' | |
83 | - is used as a separator. So we simply strip everything up until | |
84 | - the last dot. */ | |
85 | - int prefix; | |
86 | - | |
87 | - switch (gdbarch_bfd_arch_info (target_gdbarch ())->arch) | |
88 | - { | |
89 | - case bfd_arch_i386: | |
90 | - prefix = '.'; | |
91 | - break; | |
92 | - case bfd_arch_sparc: | |
93 | - prefix = '$'; | |
94 | - break; | |
95 | - default: | |
96 | - internal_error (__FILE__, __LINE__, "Unexpected arch"); | |
97 | - break; | |
98 | - } | |
99 | - | |
100 | - if (name[0] == prefix) | |
101 | - { | |
102 | - const char *p = strrchr (name, '.'); | |
103 | - if (p) | |
104 | - return p + 1; | |
105 | - } | |
106 | - | |
107 | - return name; | |
108 | -} | |
109 | - | |
110 | 64 | static CORE_ADDR |
111 | 65 | sol2_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) |
112 | 66 | { |
@@ -155,10 +109,6 @@ sol2_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) | ||
155 | 109 | SunPRO 3.0, the compiler does this for N_FUN stabs too. */ |
156 | 110 | set_gdbarch_sofun_address_maybe_missing (gdbarch, 1); |
157 | 111 | |
158 | - /* The Sun compilers also do "globalization"; see the comment in | |
159 | - sol2_static_transform_name for more information. */ | |
160 | - set_gdbarch_static_transform_name (gdbarch, sol2_static_transform_name); | |
161 | - | |
162 | 112 | /* Solaris uses SVR4-style shared libraries. */ |
163 | 113 | set_gdbarch_skip_solib_resolver (gdbarch, sol2_skip_solib_resolver); |
164 | 114 |
@@ -723,12 +723,6 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, | ||
723 | 723 | /* This was an anonymous type that was never fixed up. */ |
724 | 724 | goto normal; |
725 | 725 | |
726 | - case 'X': | |
727 | - /* SunPRO (3.0 at least) static variable encoding. */ | |
728 | - if (gdbarch_static_transform_name_p (gdbarch)) | |
729 | - goto normal; | |
730 | - /* fall through */ | |
731 | - | |
732 | 726 | default: |
733 | 727 | complaint (_("Unknown C++ symbol name `%s'"), |
734 | 728 | string); |
@@ -1186,23 +1180,6 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, | ||
1186 | 1180 | SYMBOL_TYPE (sym) = read_type (&p, objfile); |
1187 | 1181 | SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC; |
1188 | 1182 | SET_SYMBOL_VALUE_ADDRESS (sym, valu); |
1189 | - if (gdbarch_static_transform_name_p (gdbarch) | |
1190 | - && gdbarch_static_transform_name (gdbarch, sym->linkage_name ()) | |
1191 | - != sym->linkage_name ()) | |
1192 | - { | |
1193 | - struct bound_minimal_symbol msym; | |
1194 | - | |
1195 | - msym = lookup_minimal_symbol (sym->linkage_name (), NULL, objfile); | |
1196 | - if (msym.minsym != NULL) | |
1197 | - { | |
1198 | - const char *new_name = gdbarch_static_transform_name | |
1199 | - (gdbarch, sym->linkage_name ()); | |
1200 | - | |
1201 | - sym->set_linkage_name (new_name); | |
1202 | - SET_SYMBOL_VALUE_ADDRESS (sym, | |
1203 | - BMSYMBOL_VALUE_ADDRESS (msym)); | |
1204 | - } | |
1205 | - } | |
1206 | 1183 | SYMBOL_DOMAIN (sym) = VAR_DOMAIN; |
1207 | 1184 | add_symbol_to_list (sym, get_file_symbols ()); |
1208 | 1185 | break; |
@@ -1367,24 +1344,8 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, | ||
1367 | 1344 | SYMBOL_TYPE (sym) = read_type (&p, objfile); |
1368 | 1345 | SYMBOL_ACLASS_INDEX (sym) = LOC_STATIC; |
1369 | 1346 | SET_SYMBOL_VALUE_ADDRESS (sym, valu); |
1370 | - if (gdbarch_static_transform_name_p (gdbarch) | |
1371 | - && gdbarch_static_transform_name (gdbarch, sym->linkage_name ()) | |
1372 | - != sym->linkage_name ()) | |
1373 | - { | |
1374 | - struct bound_minimal_symbol msym; | |
1375 | - | |
1376 | - msym = lookup_minimal_symbol (sym->linkage_name (), NULL, objfile); | |
1377 | - if (msym.minsym != NULL) | |
1378 | - { | |
1379 | - const char *new_name = gdbarch_static_transform_name | |
1380 | - (gdbarch, sym->linkage_name ()); | |
1381 | - | |
1382 | - sym->set_linkage_name (new_name); | |
1383 | - SET_SYMBOL_VALUE_ADDRESS (sym, BMSYMBOL_VALUE_ADDRESS (msym)); | |
1384 | - } | |
1385 | - } | |
1386 | 1347 | SYMBOL_DOMAIN (sym) = VAR_DOMAIN; |
1387 | - add_symbol_to_list (sym, get_local_symbols ()); | |
1348 | + add_symbol_to_list (sym, get_local_symbols ()); | |
1388 | 1349 | break; |
1389 | 1350 | |
1390 | 1351 | case 'v': |
@@ -2114,7 +2114,6 @@ static void | ||
2114 | 2114 | scan_xcoff_symtab (minimal_symbol_reader &reader, |
2115 | 2115 | struct objfile *objfile) |
2116 | 2116 | { |
2117 | - struct gdbarch *gdbarch = objfile->arch (); | |
2118 | 2117 | CORE_ADDR toc_offset = 0; /* toc offset value in data section. */ |
2119 | 2118 | const char *filestring = NULL; |
2120 | 2119 |
@@ -2577,10 +2576,6 @@ scan_xcoff_symtab (minimal_symbol_reader &reader, | ||
2577 | 2576 | switch (p[1]) |
2578 | 2577 | { |
2579 | 2578 | case 'S': |
2580 | - if (gdbarch_static_transform_name_p (gdbarch)) | |
2581 | - namestring = gdbarch_static_transform_name | |
2582 | - (gdbarch, namestring); | |
2583 | - | |
2584 | 2579 | add_psymbol_to_list (gdb::string_view (namestring, |
2585 | 2580 | p - namestring), |
2586 | 2581 | true, VAR_DOMAIN, LOC_STATIC, |