[00/10] Fix two name-related bugs in DWARF reader

Message ID 20200325200715.12947-1-tom@tromey.com
Headers show
Series
  • Fix two name-related bugs in DWARF reader
Related show

Message

Tom Tromey March 25, 2020, 8:07 p.m.
I started this series by trying to fix PR rust/25025.  This showed
that the Rust compiler sometimes emits two mangled forms that demangle
to the same thing.

In the end I could maybe have fixed this in a direct way (see patch #9
for the details), but while debugging I went on a detour into the
physname code and came up with this series.

This changes the DWARF reader to avoid demangling when constructing
partial symbols.  This obsoletes my previous patch to do the same
thing; I think this approach is cleaner.

It also attempts to fix the longstanding physname bug, PR 12707.
After this series, the demangled form is now stored on the symbol
again.

Regression tested by the buildbot.

Tom

Comments

Jose E. Marchesi via Gdb-patches March 25, 2020, 10:48 p.m. | #1
On Wed, Mar 25, 2020 at 3:07 PM Tom Tromey <tom@tromey.com> wrote:
>

> I started this series by trying to fix PR rust/25025.  This showed

> that the Rust compiler sometimes emits two mangled forms that demangle

> to the same thing.

>

> In the end I could maybe have fixed this in a direct way (see patch #9

> for the details), but while debugging I went on a detour into the

> physname code and came up with this series.

>

> This changes the DWARF reader to avoid demangling when constructing

> partial symbols.  This obsoletes my previous patch to do the same

> thing; I think this approach is cleaner.

>

> It also attempts to fix the longstanding physname bug, PR 12707.

> After this series, the demangled form is now stored on the symbol

> again.


I haven't read the patches yet but just to clarify, does this mean
that a psymbol will now do the expected thing of storing the mangled
name as the linkage_name and the demangled name as the demangled_name?

Christian
Tom Tromey March 25, 2020, 11:50 p.m. | #2
Christian> I haven't read the patches yet but just to clarify, does this mean
Christian> that a psymbol will now do the expected thing of storing the mangled
Christian> name as the linkage_name and the demangled name as the demangled_name?

Yeah, both psymbols and full symbols.

They actually store different variants, surprisingly enough.
The full symbol stores the argument types and the psymbol does not.

Tom
Tom de Vries April 24, 2020, 2:18 p.m. | #3
On 25-03-2020 21:07, Tom Tromey wrote:
> I started this series by trying to fix PR rust/25025.  This showed

> that the Rust compiler sometimes emits two mangled forms that demangle

> to the same thing.

> 

> In the end I could maybe have fixed this in a direct way (see patch #9

> for the details), but while debugging I went on a detour into the

> physname code and came up with this series.

> 

> This changes the DWARF reader to avoid demangling when constructing

> partial symbols.  This obsoletes my previous patch to do the same

> thing; I think this approach is cleaner.

> 

> It also attempts to fix the longstanding physname bug, PR 12707.

> After this series, the demangled form is now stored on the symbol

> again.

> 

> Regression tested by the buildbot.


As extra data point, I've build and tested this series, and got
unexpected failures reduced from 8 to 1:
...
                === gdb Summary ===

# of expected passes            78972
# of unexpected failures        1
# of expected failures          135
# of known failures             72
# of untested testcases         24
# of unsupported tests          77
...

Thanks,
- Tom
Tom Tromey April 24, 2020, 2:45 p.m. | #4
>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:


Tom> As extra data point, I've build and tested this series, and got
Tom> unexpected failures reduced from 8 to 1:

Thanks for doing that.
I was set to check it in, but I ran the tests with the .debug_names
board and now there is a regression there :(

Tom