gdb: Remove support for old mangling schemes
An upcoming sync with gcc's libiberty [1] will remove support for old mangling schemes (GNU v2, Lucid, ARM, HP and EDG). It will remove the cplus_demangle_opname function, so we need to get rid of its usages in GDB (it's a GNU v2 specific function). I think the changes are mostly relatively obvious, some hacks that were necessary to support overloaded operators with GNU v2 mangling are not needed anymore. The change in stabsread.c is perhaps less obvious. I think we could get rid of more code in that region that is specific to old mangling schemes, but I chose to do only the minimal changes required to remove the cplus_demangle_opname uses. There is also a detailed comment just above that explaining how GNU v2 and v3 mangled symbols are handled, I decided to leave it as-is, since I wasn't sure which part to remove, change or leave there. [1] The commit "Remove support for demangling GCC 2.x era mangling schemes.", specifically. gdb/ChangeLog: * gdbtypes.c (check_stub_method_group): Remove handling of old mangling schemes. * linespec.c (find_methods): Likewise. * stabsread.c (read_member_functions): Likewise. * valops.c (search_struct_method): Likewise. (value_struct_elt_for_reference): Likewise. * NEWS: Mention this change. gdb/testsuite/ChangeLog: * gdb.cp/demangle.exp (test_gnu_style_demangling): Rename to... (test_gnuv3_style_demangling): ... this. (test_lucid_style_demangling): Remove. (test_arm_style_demangling): Remove. (test_hp_style_demangling): Remove. (do_tests): Remove calls to the above. gdb/doc/ChangeLog: * gdb.texinfo (Print Settings): Remove mention of specific demangle-style values, just refer to the in-process help.
This commit is contained in:
parent
0e2a21335b
commit
041be52673
@ -1,3 +1,13 @@
|
||||
2019-01-09 Simon Marchi <simon.marchi@ericsson.com>
|
||||
|
||||
* gdbtypes.c (check_stub_method_group): Remove handling of old
|
||||
mangling schemes.
|
||||
* linespec.c (find_methods): Likewise.
|
||||
* stabsread.c (read_member_functions): Likewise.
|
||||
* valops.c (search_struct_method): Likewise.
|
||||
(value_struct_elt_for_reference): Likewise.
|
||||
* NEWS: Mention this change.
|
||||
|
||||
2019-01-09 Andrew Burgess <andrew.burgess@embecosm.com>
|
||||
|
||||
* cli/cli-cmds.c (list_command): Pass a source_lines_range to
|
||||
|
3
gdb/NEWS
3
gdb/NEWS
@ -58,6 +58,9 @@
|
||||
source code snippets. See the "set style" commands, below, for more
|
||||
information.
|
||||
|
||||
* Removed support for old demangling styles arm, edg, gnu, hp and
|
||||
lucid.
|
||||
|
||||
* New targets
|
||||
|
||||
NXP S12Z s12z-*-elf
|
||||
|
@ -1,3 +1,8 @@
|
||||
2019-01-09 Simon Marchi <simon.marchi@ericsson.com>
|
||||
|
||||
* gdb.texinfo (Print Settings): Remove mention of specific
|
||||
demangle-style values, just refer to the in-process help.
|
||||
|
||||
2018-12-28 Tom Tromey <tom@tromey.com>
|
||||
|
||||
* gdb.texinfo (Output Styling): New node.
|
||||
|
@ -10703,31 +10703,10 @@ or demangled form.
|
||||
@cindex symbol decoding style, C@t{++}
|
||||
@kindex set demangle-style
|
||||
@item set demangle-style @var{style}
|
||||
Choose among several encoding schemes used by different compilers to
|
||||
represent C@t{++} names. The choices for @var{style} are currently:
|
||||
|
||||
@table @code
|
||||
@item auto
|
||||
Allow @value{GDBN} to choose a decoding style by inspecting your program.
|
||||
This is the default.
|
||||
|
||||
@item gnu
|
||||
Decode based on the @sc{gnu} C@t{++} compiler (@code{g++}) encoding algorithm.
|
||||
|
||||
@item hp
|
||||
Decode based on the HP ANSI C@t{++} (@code{aCC}) encoding algorithm.
|
||||
|
||||
@item lucid
|
||||
Decode based on the Lucid C@t{++} compiler (@code{lcc}) encoding algorithm.
|
||||
|
||||
@item arm
|
||||
Decode using the algorithm in the @cite{C@t{++} Annotated Reference Manual}.
|
||||
@strong{Warning:} this setting alone is not sufficient to allow
|
||||
debugging @code{cfront}-generated executables. @value{GDBN} would
|
||||
require further enhancement to permit that.
|
||||
|
||||
@end table
|
||||
If you omit @var{style}, you will see a list of possible formats.
|
||||
Choose among several encoding schemes used by different compilers to represent
|
||||
C@t{++} names. If you omit @var{style}, you will see a list of possible
|
||||
formats. The default value is @var{auto}, which lets @value{GDBN} choose a
|
||||
decoding style by inspecting your program.
|
||||
|
||||
@item show demangle-style
|
||||
Display the encoding style currently in use for decoding C@t{++} symbols.
|
||||
|
@ -2736,37 +2736,11 @@ check_stub_method_group (struct type *type, int method_id)
|
||||
{
|
||||
int len = TYPE_FN_FIELDLIST_LENGTH (type, method_id);
|
||||
struct fn_field *f = TYPE_FN_FIELDLIST1 (type, method_id);
|
||||
int j, found_stub = 0;
|
||||
|
||||
for (j = 0; j < len; j++)
|
||||
if (TYPE_FN_FIELD_STUB (f, j))
|
||||
{
|
||||
found_stub = 1;
|
||||
check_stub_method (type, method_id, j);
|
||||
}
|
||||
|
||||
/* GNU v3 methods with incorrect names were corrected when we read
|
||||
in type information, because it was cheaper to do it then. The
|
||||
only GNU v2 methods with incorrect method names are operators and
|
||||
destructors; destructors were also corrected when we read in type
|
||||
information.
|
||||
|
||||
Therefore the only thing we need to handle here are v2 operator
|
||||
names. */
|
||||
if (found_stub && !startswith (TYPE_FN_FIELD_PHYSNAME (f, 0), "_Z"))
|
||||
for (int j = 0; j < len; j++)
|
||||
{
|
||||
int ret;
|
||||
char dem_opname[256];
|
||||
|
||||
ret = cplus_demangle_opname (TYPE_FN_FIELDLIST_NAME (type,
|
||||
method_id),
|
||||
dem_opname, DMGL_ANSI);
|
||||
if (!ret)
|
||||
ret = cplus_demangle_opname (TYPE_FN_FIELDLIST_NAME (type,
|
||||
method_id),
|
||||
dem_opname, 0);
|
||||
if (ret)
|
||||
TYPE_FN_FIELDLIST_NAME (type, method_id) = xstrdup (dem_opname);
|
||||
if (TYPE_FN_FIELD_STUB (f, j))
|
||||
check_stub_method (type, method_id, j);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1251,17 +1251,6 @@ find_methods (struct type *t, enum language t_lang, const char *name,
|
||||
--method_counter)
|
||||
{
|
||||
const char *method_name = TYPE_FN_FIELDLIST_NAME (t, method_counter);
|
||||
char dem_opname[64];
|
||||
|
||||
if (startswith (method_name, "__") ||
|
||||
startswith (method_name, "op") ||
|
||||
startswith (method_name, "type"))
|
||||
{
|
||||
if (cplus_demangle_opname (method_name, dem_opname, DMGL_ANSI))
|
||||
method_name = dem_opname;
|
||||
else if (cplus_demangle_opname (method_name, dem_opname, 0))
|
||||
method_name = dem_opname;
|
||||
}
|
||||
|
||||
if (symbol_name_compare (method_name, lookup_name, NULL))
|
||||
{
|
||||
|
@ -2552,7 +2552,6 @@ read_member_functions (struct field_info *fip, const char **pp,
|
||||
}
|
||||
else
|
||||
{
|
||||
int has_stub = 0;
|
||||
int has_destructor = 0, has_other = 0;
|
||||
int is_v3 = 0;
|
||||
struct next_fnfield *tmp_sublist;
|
||||
@ -2616,8 +2615,6 @@ read_member_functions (struct field_info *fip, const char **pp,
|
||||
tmp_sublist = sublist;
|
||||
while (tmp_sublist != NULL)
|
||||
{
|
||||
if (tmp_sublist->fn_field.is_stub)
|
||||
has_stub = 1;
|
||||
if (tmp_sublist->fn_field.physname[0] == '_'
|
||||
&& tmp_sublist->fn_field.physname[1] == 'Z')
|
||||
is_v3 = 1;
|
||||
@ -2704,23 +2701,6 @@ read_member_functions (struct field_info *fip, const char **pp,
|
||||
"~", main_fn_name, (char *)NULL);
|
||||
xfree (main_fn_name);
|
||||
}
|
||||
else if (!has_stub)
|
||||
{
|
||||
char dem_opname[256];
|
||||
int ret;
|
||||
|
||||
ret = cplus_demangle_opname (new_fnlist->fn_fieldlist.name,
|
||||
dem_opname, DMGL_ANSI);
|
||||
if (!ret)
|
||||
ret = cplus_demangle_opname (new_fnlist->fn_fieldlist.name,
|
||||
dem_opname, 0);
|
||||
if (ret)
|
||||
new_fnlist->fn_fieldlist.name
|
||||
= ((const char *)
|
||||
obstack_copy0 (&objfile->objfile_obstack, dem_opname,
|
||||
strlen (dem_opname)));
|
||||
xfree (main_fn_name);
|
||||
}
|
||||
|
||||
new_fnlist->fn_fieldlist.fn_fields
|
||||
= OBSTACK_CALLOC (&objfile->objfile_obstack, length, fn_field);
|
||||
|
@ -1,3 +1,12 @@
|
||||
2019-01-09 Simon Marchi <simon.marchi@ericsson.com>
|
||||
|
||||
* gdb.cp/demangle.exp (test_gnu_style_demangling): Rename to...
|
||||
(test_gnuv3_style_demangling): ... this.
|
||||
(test_lucid_style_demangling): Remove.
|
||||
(test_arm_style_demangling): Remove.
|
||||
(test_hp_style_demangling): Remove.
|
||||
(do_tests): Remove calls to the above.
|
||||
|
||||
2019-01-09 Andrew Burgess <andrew.burgess@embecosm.com>
|
||||
|
||||
* lib/mi-support.exp (mi_gdb_test): Remove interactive prompt
|
||||
|
File diff suppressed because it is too large
Load Diff
23
gdb/valops.c
23
gdb/valops.c
@ -1980,23 +1980,12 @@ search_struct_method (const char *name, struct value **arg1p,
|
||||
int i;
|
||||
struct value *v;
|
||||
int name_matched = 0;
|
||||
char dem_opname[64];
|
||||
|
||||
type = check_typedef (type);
|
||||
for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; i--)
|
||||
{
|
||||
const char *t_field_name = TYPE_FN_FIELDLIST_NAME (type, i);
|
||||
|
||||
/* FIXME! May need to check for ARM demangling here. */
|
||||
if (startswith (t_field_name, "__") ||
|
||||
startswith (t_field_name, "op") ||
|
||||
startswith (t_field_name, "type"))
|
||||
{
|
||||
if (cplus_demangle_opname (t_field_name, dem_opname, DMGL_ANSI))
|
||||
t_field_name = dem_opname;
|
||||
else if (cplus_demangle_opname (t_field_name, dem_opname, 0))
|
||||
t_field_name = dem_opname;
|
||||
}
|
||||
if (t_field_name && (strcmp_iw (t_field_name, name) == 0))
|
||||
{
|
||||
int j = TYPE_FN_FIELDLIST_LENGTH (type, i) - 1;
|
||||
@ -3421,19 +3410,7 @@ value_struct_elt_for_reference (struct type *domain, int offset,
|
||||
for (i = TYPE_NFN_FIELDS (t) - 1; i >= 0; --i)
|
||||
{
|
||||
const char *t_field_name = TYPE_FN_FIELDLIST_NAME (t, i);
|
||||
char dem_opname[64];
|
||||
|
||||
if (startswith (t_field_name, "__")
|
||||
|| startswith (t_field_name, "op")
|
||||
|| startswith (t_field_name, "type"))
|
||||
{
|
||||
if (cplus_demangle_opname (t_field_name,
|
||||
dem_opname, DMGL_ANSI))
|
||||
t_field_name = dem_opname;
|
||||
else if (cplus_demangle_opname (t_field_name,
|
||||
dem_opname, 0))
|
||||
t_field_name = dem_opname;
|
||||
}
|
||||
if (t_field_name && strcmp (t_field_name, name) == 0)
|
||||
{
|
||||
int j;
|
||||
|
Loading…
x
Reference in New Issue
Block a user