Regression: Re: RFC: update for GCC PR 47510
Jan Kratochvil
jan.kratochvil@redhat.com
Thu Mar 31 19:12:00 GMT 2011
On Wed, 30 Mar 2011 08:25:01 +0200, Jan Kratochvil wrote:
> This commit 96bfe92de6c67763182b1492c24c8edea9e00e1b has a regression on
> Fedora 15 (x86_64 and i686 native, not x86_64-m32) using
> gcc-4.6.0-0.15.fc15.x86_64:
It is reproducible only with gcc-debuginfo-4.6.0-0.15.fc15.x86_64 installed.
Which also explains why only x86_64-m32 was not affected (as Fedora does not
support biarch debuginfo rpms).
It fixes exactly the regressions described with otherwise no regressions on
{x86_64,x86_64-m32,i686}-fedora15-linux-gnu.
A debug dump has shown:
<ldiv_t> from <6ldiv_t> DIE offset=0x1caa objfile=/usr/lib/debug/usr/lib64/libstdc++.so.6.0.15.debug CU offset=0x0
<long> from <ldiv_t> DIE offset=0x1caa objfile=/usr/lib/debug/usr/lib64/libstdc++.so.6.0.15.debug CU offset=0x0
Although I was unable to reproduce that ldiv_t->long demangling on commandline
but I understand it was an incorrect operation.
$ c++filt -t -s gnu-v3 6ldiv_t
ldiv_t
$ c++filt -t -s gnu-v3 ldiv_t
ldiv_t
(not `long')
Thanks,
Jan
gdb/
2011-03-31 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf2read.c (dwarf2_name): Initialize DEMANGLED. Avoid demangling
struct linkage name twice.
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -12043,7 +12043,7 @@ dwarf2_name (struct die_info *die, struct dwarf2_cu *cu)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47510. */
if (!attr || DW_STRING (attr) == NULL)
{
- char *demangled;
+ char *demangled = NULL;
attr = dwarf2_attr (die, DW_AT_linkage_name, cu);
if (attr == NULL)
@@ -12052,7 +12052,10 @@ dwarf2_name (struct die_info *die, struct dwarf2_cu *cu)
if (attr == NULL || DW_STRING (attr) == NULL)
return NULL;
- demangled = cplus_demangle (DW_STRING (attr), DMGL_TYPES);
+ /* Avoid demangling DW_STRING (attr) the second time on a second
+ call for the same DIE. */
+ if (!DW_STRING_IS_CANONICAL (attr))
+ demangled = cplus_demangle (DW_STRING (attr), DMGL_TYPES);
if (demangled)
{
More information about the Gdb-patches
mailing list