This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
The future of dwarf2_physname
- From: Keith Seitz <keiths at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 18 May 2011 15:34:43 -0700
- Subject: The future of dwarf2_physname
Hi,
Several of us Red Hat folk have been discussing this internally, and
it's time to take this discussion public.
Jan's recent patch proposal in response to my typedef'd method
parameters patchset lead to some further investigation, and I believe I
(we?) are all coming to the conclusion that Jan's patch is probably the
best way to proceed for the future, i.e., post 7.3 release.
[Jan's proposal is here:
http://sourceware.org/ml/gdb-patches/2011-05/msg00358.html . NOTE:
DMGL_VERBOSE should be added to the demangler options in that patch if
you want to play with it.]
In short, if gdb uses DW_AT[_MIPS]_linkage_name when available, we can
bypass constructing the physname *and* canonicalization, so gdb would
only have to do this when DW_AT[_MIPS]_linkage_name is missing. Today
this only happens AFAIK with gcc and ctors. I don't know about other
compilers.
This could be a sizable performance win (not yet tested or quantified).
While it does introduce some regressions, many are compiler problems and
some are template problems (the linkage name contains the return type,
and 1) gdb isn't equipped to deal with that; 2) it makes for a horrible
user experience having to specify it all the time). There might be
others, I have only delved into this a bit myself today.
So the first question to be asked here is, Should we adopt Jan's patch,
or some variation of it, to use DW_AT_linkage_name when available?
The only hesitation I have is the compiler issues. Just using
DW_AT_linkage_name instead of computing it has lead to many test
regressions with differing compiler versions. [Again, I have only tested
gcc.]
It appears that computing the physname offers gdb some buffer from
compiler changes/bugs. At least with gcc. [in case I haven't stressed
that enough]
What do others think?
------
The bigger issue is what to do for 7.3, which has been in limbo for
quite some time awaiting resolution of c++/12506 (for which I have
posted patches).
I guess there are basically two options:
1) Keep physname & apply the 12266/12506 patchset (when approved)
2) Adopt Jan's patch and fix the fallout now
My take on this today is that I think the least risky/most timely
solution is #1. Gdb has been used with the dwarf2_physname patchset for
over a year now, and it is not altogether broken. We are seeing some
regressions from previous releases (none of these are in the test
suite), and I have been trying to keep on top of them.
The 12266/12506 patchset is almost orthogonal to this decision. It fixes
several additional typedef-related problems. 12506 is fixed by using
DW_AT_linkage_name, but 12266 is not.
My big fear with #2 is "fixing" linespecs (yet again). Any changes to
this area take an unimaginably large amount of time and effort.
What do others think?
Keith