Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: Regression: Re: RFC: update for GCC PR 47510
Date: Thu, 31 Mar 2011 19:12:00 -0000	[thread overview]
Message-ID: <20110331162332.GA30645@host1.jankratochvil.net> (raw)
In-Reply-To: <20110330062501.GA14148@host1.jankratochvil.net>

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)
 	    {



  reply	other threads:[~2011-03-31 16:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-18 14:59 Tom Tromey
2011-03-29 17:19 ` Tom Tromey
2011-03-30 10:45   ` Regression: " Jan Kratochvil
2011-03-31 19:12     ` Jan Kratochvil [this message]
2011-03-31 19:58       ` Jan Kratochvil
2011-03-31 21:03         ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110331162332.GA30645@host1.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox