[PING] Fix PR gdb/17720 (Function names appear without namespace/class prefixes in backtrace for optimized code)
Message ID | 1429802693-4582-1-git-send-email-martin.galvan@tallertechnologies.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 7554 invoked by alias); 23 Apr 2015 15:25:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 7544 invoked by uid 89); 23 Apr 2015 15:25:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL, BAYES_00, KAM_STOCKGEN, RCVD_IN_DNSWL_LOW, SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mail-qk0-f179.google.com Received: from mail-qk0-f179.google.com (HELO mail-qk0-f179.google.com) (209.85.220.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 23 Apr 2015 15:25:02 +0000 Received: by qku63 with SMTP id 63so12568087qku.3 for <gdb-patches@sourceware.org>; Thu, 23 Apr 2015 08:25:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=6w14ZD809NTUmvfGhCskT8xj1VFCb25TkGTMZh0fJyk=; b=Y4BsbjMoWFrH6oFYsdegVwqiVUwO+MuFT/3640x8buB2nOVRzJpQYs09GFUvIm+5qN RM/WIHCIsEx8MLDolVNfM3xEvGVV/usjzoZ2zwNjpH+MRbrC7Na2YwBR0Frc0pl+B4Le 0inA/Iz14MDtToYuxrDtE6wppe5gxOpg0sBm+uhc7wLRScGht5HQg43AUz8Q5l8Y2Cxd EBEp4Ks4MX3b8O8y8m5mnk5986M/42PVxa9aZTVVwL0a4VgCoN3PNwhtRgpHnzIyijdT RUTfTKgDZfguZbQjvmFjWfKTuQzrvsZa1cy7AH74KMeDQE3F7hTR6BzWoDYx/D/9NJcT uvNg== X-Gm-Message-State: ALoCoQkwLXsT7NwuiV213acMzeaiRE9H/cgwA9HndCPhcmcnc4BTiPsIN6w34dnIu6TB6fafx5x+ X-Received: by 10.140.165.150 with SMTP id l144mr3838571qhl.99.1429802700112; Thu, 23 Apr 2015 08:25:00 -0700 (PDT) Received: from martin-galvan.dominio.tallertechnologies.com ([200.69.202.173]) by mx.google.com with ESMTPSA id p81sm6160724qkp.6.2015.04.23.08.24.58 for <gdb-patches@sourceware.org> (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 23 Apr 2015 08:24:59 -0700 (PDT) From: Martin Galvan <martin.galvan@tallertechnologies.com> To: gdb-patches@sourceware.org Subject: [PING][PATCH] Fix PR gdb/17720 (Function names appear without namespace/class prefixes in backtrace for optimized code) Date: Thu, 23 Apr 2015 12:24:53 -0300 Message-Id: <1429802693-4582-1-git-send-email-martin.galvan@tallertechnologies.com> |
Commit Message
Martin Galvan
April 23, 2015, 3:24 p.m. UTC
This bug was being caused by die_needs_namespace returning 0 for a DIE whose tag was DW_TAG_inlined_subroutine. This meant that dwarf2_physname would simply return the DIE's name attribute (which in our case would be "method"). Therefore, when new_symbol_full called SYMBOL_SET_NAMES, the linkagename argument wasn't the demangled name as it should have. This patch adds a case which would return 1 for DW_TAG_inlined_subroutine in die_needs_namespace. It's tested both for classes and namespaces. I have a company-wide copyright assignment. I don't have commit access, though, so it would be great if anyone could commit this for me. gdb/ 2015-04-23 Martin Galvan <martin.galvan@tallertechnologies.com> * dwarf2read.c (die_needs_namespace): Return 1 for DW_TAG_inlined_subroutine. --- gdb/dwarf2read.c | 1 + 1 file changed, 1 insertion(+) -- 2.3.5
Comments
On Thu, Apr 23, 2015 at 8:24 AM, Martin Galvan <martin.galvan@tallertechnologies.com> wrote: > This bug was being caused by die_needs_namespace returning 0 for a DIE whose tag was DW_TAG_inlined_subroutine. This meant that dwarf2_physname would simply return the DIE's name attribute (which in our case would be "method"). Therefore, when new_symbol_full called SYMBOL_SET_NAMES, the linkagename argument wasn't the demangled name as it should have. > > This patch adds a case which would return 1 for DW_TAG_inlined_subroutine in die_needs_namespace. It's tested both for classes and namespaces. > > I have a company-wide copyright assignment. I don't have commit access, though, so it would be great if anyone could commit this for me. > > gdb/ > 2015-04-23 Martin Galvan <martin.galvan@tallertechnologies.com> > > * dwarf2read.c (die_needs_namespace): Return 1 for > DW_TAG_inlined_subroutine. > > --- > gdb/dwarf2read.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c > index f6b0c01..2bf3513 100644 > --- a/gdb/dwarf2read.c > +++ b/gdb/dwarf2read.c > @@ -8357,6 +8357,7 @@ die_needs_namespace (struct die_info *die, struct dwarf2_cu *cu) > case DW_TAG_enumeration_type: > case DW_TAG_enumerator: > case DW_TAG_subprogram: > + case DW_TAG_inlined_subroutine: > case DW_TAG_member: > case DW_TAG_imported_declaration: > return 1; LGTM. I'll check it in.
On Thu, Apr 23, 2015 at 12:52 PM, Doug Evans <dje@google.com> wrote: > LGTM. > I'll check it in. Thanks a lot!
Sorry to bother but I didn't see this committed in the gdb repository. I don't have write access, so could you please commit this for me? Thanks a lot! On Thu, Apr 23, 2015 at 12:52 PM, Doug Evans <dje@google.com> wrote: > On Thu, Apr 23, 2015 at 8:24 AM, Martin Galvan > <martin.galvan@tallertechnologies.com> wrote: >> This bug was being caused by die_needs_namespace returning 0 for a DIE whose tag was DW_TAG_inlined_subroutine. This meant that dwarf2_physname would simply return the DIE's name attribute (which in our case would be "method"). Therefore, when new_symbol_full called SYMBOL_SET_NAMES, the linkagename argument wasn't the demangled name as it should have. >> >> This patch adds a case which would return 1 for DW_TAG_inlined_subroutine in die_needs_namespace. It's tested both for classes and namespaces. >> >> I have a company-wide copyright assignment. I don't have commit access, though, so it would be great if anyone could commit this for me. >> >> gdb/ >> 2015-04-23 Martin Galvan <martin.galvan@tallertechnologies.com> >> >> * dwarf2read.c (die_needs_namespace): Return 1 for >> DW_TAG_inlined_subroutine. >> >> --- >> gdb/dwarf2read.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c >> index f6b0c01..2bf3513 100644 >> --- a/gdb/dwarf2read.c >> +++ b/gdb/dwarf2read.c >> @@ -8357,6 +8357,7 @@ die_needs_namespace (struct die_info *die, struct dwarf2_cu *cu) >> case DW_TAG_enumeration_type: >> case DW_TAG_enumerator: >> case DW_TAG_subprogram: >> + case DW_TAG_inlined_subroutine: >> case DW_TAG_member: >> case DW_TAG_imported_declaration: >> return 1; > > LGTM. > I'll check it in.
On Thu, Apr 23, 2015 at 8:52 AM, Doug Evans <dje@google.com> wrote: > On Thu, Apr 23, 2015 at 8:24 AM, Martin Galvan > <martin.galvan@tallertechnologies.com> wrote: >> This bug was being caused by die_needs_namespace returning 0 for a DIE whose tag was DW_TAG_inlined_subroutine. This meant that dwarf2_physname would simply return the DIE's name attribute (which in our case would be "method"). Therefore, when new_symbol_full called SYMBOL_SET_NAMES, the linkagename argument wasn't the demangled name as it should have. >> >> This patch adds a case which would return 1 for DW_TAG_inlined_subroutine in die_needs_namespace. It's tested both for classes and namespaces. >> >> I have a company-wide copyright assignment. I don't have commit access, though, so it would be great if anyone could commit this for me. >> >> gdb/ >> 2015-04-23 Martin Galvan <martin.galvan@tallertechnologies.com> >> >> * dwarf2read.c (die_needs_namespace): Return 1 for >> DW_TAG_inlined_subroutine. >> >> --- >> gdb/dwarf2read.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c >> index f6b0c01..2bf3513 100644 >> --- a/gdb/dwarf2read.c >> +++ b/gdb/dwarf2read.c >> @@ -8357,6 +8357,7 @@ die_needs_namespace (struct die_info *die, struct dwarf2_cu *cu) >> case DW_TAG_enumeration_type: >> case DW_TAG_enumerator: >> case DW_TAG_subprogram: >> + case DW_TAG_inlined_subroutine: >> case DW_TAG_member: >> case DW_TAG_imported_declaration: >> return 1; > > LGTM. > I'll check it in. Committed. I forgot the extra step of setting the author correctly, but it's just one line so I'm leaving it.
On Wed, May 13, 2015 at 5:58 PM, Doug Evans <dje@google.com> wrote: > On Thu, Apr 23, 2015 at 8:52 AM, Doug Evans <dje@google.com> wrote: >> On Thu, Apr 23, 2015 at 8:24 AM, Martin Galvan >> <martin.galvan@tallertechnologies.com> wrote: >>> This bug was being caused by die_needs_namespace returning 0 for a DIE whose tag was DW_TAG_inlined_subroutine. This meant that dwarf2_physname would simply return the DIE's name attribute (which in our case would be "method"). Therefore, when new_symbol_full called SYMBOL_SET_NAMES, the linkagename argument wasn't the demangled name as it should have. >>> >>> This patch adds a case which would return 1 for DW_TAG_inlined_subroutine in die_needs_namespace. It's tested both for classes and namespaces. >>> >>> I have a company-wide copyright assignment. I don't have commit access, though, so it would be great if anyone could commit this for me. >>> >>> gdb/ >>> 2015-04-23 Martin Galvan <martin.galvan@tallertechnologies.com> >>> >>> * dwarf2read.c (die_needs_namespace): Return 1 for >>> DW_TAG_inlined_subroutine. >>> >>> --- >>> gdb/dwarf2read.c | 1 + >>> 1 file changed, 1 insertion(+) >>> >>> diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c >>> index f6b0c01..2bf3513 100644 >>> --- a/gdb/dwarf2read.c >>> +++ b/gdb/dwarf2read.c >>> @@ -8357,6 +8357,7 @@ die_needs_namespace (struct die_info *die, struct dwarf2_cu *cu) >>> case DW_TAG_enumeration_type: >>> case DW_TAG_enumerator: >>> case DW_TAG_subprogram: >>> + case DW_TAG_inlined_subroutine: >>> case DW_TAG_member: >>> case DW_TAG_imported_declaration: >>> return 1; >> >> LGTM. >> I'll check it in. > > Committed. > > I forgot the extra step of setting the author correctly, but it's just > one line so I'm leaving it. Well, considering that it solves a quite important issue and it took me a really long time to find it, fix it, and then get it commited, it'd be nice of you if you could fix the author :)
On Wed, May 13, 2015 at 2:04 PM, Martin Galvan <martin.galvan@tallertechnologies.com> wrote: > On Wed, May 13, 2015 at 5:58 PM, Doug Evans <dje@google.com> wrote: >> On Thu, Apr 23, 2015 at 8:52 AM, Doug Evans <dje@google.com> wrote: >>> On Thu, Apr 23, 2015 at 8:24 AM, Martin Galvan >>> <martin.galvan@tallertechnologies.com> wrote: >>>> This bug was being caused by die_needs_namespace returning 0 for a DIE whose tag was DW_TAG_inlined_subroutine. This meant that dwarf2_physname would simply return the DIE's name attribute (which in our case would be "method"). Therefore, when new_symbol_full called SYMBOL_SET_NAMES, the linkagename argument wasn't the demangled name as it should have. >>>> >>>> This patch adds a case which would return 1 for DW_TAG_inlined_subroutine in die_needs_namespace. It's tested both for classes and namespaces. >>>> >>>> I have a company-wide copyright assignment. I don't have commit access, though, so it would be great if anyone could commit this for me. >>>> >>>> gdb/ >>>> 2015-04-23 Martin Galvan <martin.galvan@tallertechnologies.com> >>>> >>>> * dwarf2read.c (die_needs_namespace): Return 1 for >>>> DW_TAG_inlined_subroutine. >>>> >>>> --- >>>> gdb/dwarf2read.c | 1 + >>>> 1 file changed, 1 insertion(+) >>>> >>>> diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c >>>> index f6b0c01..2bf3513 100644 >>>> --- a/gdb/dwarf2read.c >>>> +++ b/gdb/dwarf2read.c >>>> @@ -8357,6 +8357,7 @@ die_needs_namespace (struct die_info *die, struct dwarf2_cu *cu) >>>> case DW_TAG_enumeration_type: >>>> case DW_TAG_enumerator: >>>> case DW_TAG_subprogram: >>>> + case DW_TAG_inlined_subroutine: >>>> case DW_TAG_member: >>>> case DW_TAG_imported_declaration: >>>> return 1; >>> >>> LGTM. >>> I'll check it in. >> >> Committed. >> >> I forgot the extra step of setting the author correctly, but it's just >> one line so I'm leaving it. > > Well, considering that it solves a quite important issue and it took > me a really long time to find it, fix it, and then get it commited, > it'd be nice of you if you could fix the author :) Done. Time to get yourself commit access.
On Wed, May 13, 2015 at 6:10 PM, Doug Evans <dje@google.com> wrote: > On Wed, May 13, 2015 at 2:04 PM, Martin Galvan > <martin.galvan@tallertechnologies.com> wrote: >> On Wed, May 13, 2015 at 5:58 PM, Doug Evans <dje@google.com> wrote: >>> >>> Committed. >>> >>> I forgot the extra step of setting the author correctly, but it's just >>> one line so I'm leaving it. >> >> Well, considering that it solves a quite important issue and it took >> me a really long time to find it, fix it, and then get it commited, >> it'd be nice of you if you could fix the author :) > > Done. > > Time to get yourself commit access. Thanks a lot!
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index f6b0c01..2bf3513 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -8357,6 +8357,7 @@ die_needs_namespace (struct die_info *die, struct dwarf2_cu *cu) case DW_TAG_enumeration_type: case DW_TAG_enumerator: case DW_TAG_subprogram: + case DW_TAG_inlined_subroutine: case DW_TAG_member: case DW_TAG_imported_declaration: return 1;