[gdb] Fix regression in dwarf2_name
authorTom de Vries <tdevries@suse.de>
Wed, 30 Sep 2020 19:49:01 +0000 (21:49 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 30 Sep 2020 19:49:01 +0000 (21:49 +0200)
commit95eb9e54a51fdb819c8525a0a33138d861f31bc8
treef03c5a11fc45dc496568d0c1b8fc08310e82b9b8
parentcae21f8ebf01e379150bcf602a9ffb1f7c95b59e
[gdb] Fix regression in dwarf2_name

Since commit 2c830f5475 "Change some uses of DW_STRING to string method" we
have these regressions:
...
FAIL: gdb.base/info-types-c++.exp: info types
FAIL: gdb.cp/anon-struct.exp: print type of t::t
FAIL: gdb.cp/anon-struct.exp: print type of X::t2
FAIL: gdb.cp/anon-struct.exp: print type of X::t2::t2
FAIL: gdb.cp/anon-struct.exp: print type of t3::~t3
...

Fix these in dwarf2_name by updating attr_name each time attr is updated.

Tested on x86_64-linux.

gdb/ChangeLog:

2020-09-30  Tom de Vries  <tdevries@suse.de>

PR symtab/26683
* dwarf2/read.c (dwarf2_name): Update attr_name after attr is updated.
gdb/ChangeLog
gdb/dwarf2/read.c