Handle either order of name and linkage name
We discovered that the Ada support in gdb depends on the order of the
DW_AT_name and DW_AT_linkage_name attributes in the DWARF. In
particular, if they are emitted in the "wrong" order for some system
symbols, "catch exception" will not work.
This patch fixes this problem by arranging to always prefer the
linkage name if both exist. This seems to be what the full symbol
reader already does -- that is, this is another bug arising from
having two different DWARF readers.
Another possible issue here is that gdb still doesn't really preserve
mangled names properly. There's a PR open about this. However, this
seems to be somewhat involved to fix, which is why this patch
continues to work around the bigger issue.
gdb/ChangeLog
2019-06-28 Tom Tromey <tromey@adacore.com>
* dwarf2read.c (partial_die_info::read): Prefer the linkage name
for Ada.
gdb/testsuite/ChangeLog
2019-06-28 Tom Tromey <tromey@adacore.com>
* gdb.dwarf2/ada-linkage-name.c: New file.
* gdb.dwarf2/ada-linkage-name.exp: New file.