This is the mail archive of the
mailing list for the GDB project.
[RFA 2/4] dwarf2_physname
- From: Keith Seitz <kseitz at uglyboxes dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 20 Nov 2009 13:19:35 -0800
- Subject: [RFA 2/4] dwarf2_physname
It turns out I lied: there are really four parts to this patchset. O:-)
The attached patch is the real "meat and potatoes" of the thing. It
includes much of the earlier patches that I posted on August 31, except
that this leaves out none of the details.
I refer the interested reader to the earlier thread on this idea of
constructing physnames for C++ symbols:
Some warnings are in order. First, this is probably going to really slow
down large C++ applications, because we no longer use
DW_AT_MIPS_linkage_name as generated from the compiler. We essentially
build this name during DIE reading.
I have not made any attempt yet to straighten out SYMBOL_NATURAL_NAME,
SYMBOL_PRINT_NAME, etc. I expect to do that in a follow-on patchset.
There are now two regressions in cp-namespace.exp (and two new passes).
These regressions work on archer-keiths-expr-cumulative, so I am
guessing that Sami's namespace work there (which relies on
dwarf2_physname) fixes those tests. He will follow-up on that at the
Finally, there are two new java failures. IMO given the current
atmosphere, these are not a big deal. "break
foo.main(java.lang.String)" no longer works. You must use the
alternate "break foo.main(java.lang.String)void". Previously, either
of these would work. [It could perhaps be made to work, but I didn't
bother. I am less interested in keeping gdb working on java than I am ada.]
With those caveats out of the way, I will say that I understand there
are some controversial changes in here: it is a pretty big paradigm
shift for the dwarf reader. Nonetheless, the benefits outweigh the
performance degradation (for C++ ONLY) and the minor java regression.
IMO, the elimination of single-quoting for C++ expressions alone is
2009-11-20 Keith Seitz <firstname.lastname@example.org>
Based on work from Daniel Jacobowitz <email@example.com>:
* c-typeprint.c (cp_type_print_method_args): For non-static
print out const or volatile qualifiers, too.
(c_type_print_args): Add parameters show_artificial and language.
Skip artificial parameters when requested.
Use the appropriate language printer.
(c_type_print_varspec): Tell c_type_print_args to skip artificial
parameters and pass language_c.
* dwarf2read.c (die_list): New file global.
(struct partial_die_info): Update comments for name field.
(pdi_needs_namespace): Renamed to ...
(die_needs_namespace): ... this. Rewrite.
(add_partial_symbol): Do not predicate the call to
partial_die_full_name based on pdi_needs_namespace.
Remove call to cp_check_possible_namespace_symbols and associated
(guess_structure_name): Do not inspect child subprogram DIEs.
(dwarf2_fullname): Update comments.
Use die_needs_namespace to assist in computing the name.
(read_func_scope): Use dwarf2_name to get the DIE's name.
Use dwarf2_physname to get the "linkage name" of the DIE.
(dwarf2_add_member_field): Use dwarf2_physname instead of
(read_structure_type): For structs and classes, set TYPE_NAME, too.
(read_partial_die): Ignore DW_AT_MIPS_linkage_name for all
(new_symbol): Unconditionally call dwarf2_name.
Compute the "linkage name" using dwarf2_physname.
Use dwarf2_name instead of dwarf2_full_name for enumerator DIEs.
When determining to scan for anonymous C++ namespaces, ignore
the linkage name.
(physname_prefix): New function.
(physname_prefix_1): New function.
(dwarf2_physname): New function.
(_initialize_dwarf2_read): Initialize die_list.
* gnu-v3-eabi.c (gnu_v3_find_method_in): Remove unused variable
(gnu_v3_print_method_ptr): Use the physname for virtual methods
without a demangled name.
Print out type information for non-virtual methods.
* symtab.c (symbol_find_demangled_name): Add DMGL_VERBOSE flag
* linespec.c (decode_line_1): Keep important keywords like
"const" and "volatile".
* symtab.h (SYMBOL_CPLUS_DEMANGLED_NAME): Remove.
* utils.c (strcmp_iw): Add yet another hack for dealing
with qualifiers const and volatile.
* typeprint.h (c_type_print_args): Add declaration.
* ui-file.c (do_ui_file_obsavestring): New function.
(ui_file_obsavestring): New function.
* ui-file.h (ui_file_obsavestring): Add declaration.
* valops.c (find_overload_match): Resolve the object to
a non-pointer type.
If the object is a data member, search the object for the member
and return with staticp set.
Use SYMBOL_NATURAL_NAME instead of SYMBOL_CPLUS_DEMANGLED_NAME.
Do not attempt to extract a function name from non-function types.
If the extracted function name and the original name are the same,
we don't have a C++ method.
Description: Text document