Don't call compute_and_set_names for partial symbols
authorTom Tromey <tom@tromey.com>
Fri, 24 Apr 2020 21:35:01 +0000 (15:35 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 24 Apr 2020 21:35:03 +0000 (15:35 -0600)
commitf049a313fcad4d51a55b6e635612c98e1a72b8a8
tree557fb5f1a27dd76c83796fb92da4b2b78fefe186
parent76e288d1d2f1a6b1a19fb9856dc3256a3a5443fa
Don't call compute_and_set_names for partial symbols

As mentioned in another thread, there's currently no need to call
compute_and_set_names for partial symbols.  Because the DWARF partial
symbol reader constructs demangled names, this call can only demangle
a name by mistake.

So, this patch changes the DWARF reader to simply set the linkage name
on the new symbol.  This is equivalent to what was done before.  There
should be no user-visible change from this patch, aside from gdb
speeding up a bit.

... there *should* be, but this regressed
dw2-namespaceless-anonymous.exp.  However, upon examination, I think
that test is incorrect.  It puts a mangled name into DW_AT_name, and
it puts the variable at the top level, not in a namespace.  This isn't
what C++ compilers ought to do.  So, this patch also updates the test
case.

gdb/ChangeLog
2020-04-24  Tom Tromey  <tom@tromey.com>

* dwarf2/read.c (add_partial_symbol): Do not call
compute_and_set_names.

gdb/testsuite/ChangeLog
2020-04-24  Tom Tromey  <tom@tromey.com>

* gdb.dwarf2/dw2-namespaceless-anonymous.S: Remove.
* gdb.dwarf2/dw2-namespaceless-anonymous.c: New file.
* gdb.dwarf2/dw2-namespaceless-anonymous.exp: Use DWARF
assembler.
gdb/ChangeLog
gdb/dwarf2/read.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.S [deleted file]
gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.c [new file with mode: 0644]
gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.exp