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.