Message ID | 20170801092030.70676-1-leszeks@google.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 66191 invoked by alias); 1 Aug 2017 09:20:49 -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 65987 invoked by uid 89); 1 Aug 2017 09:20:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=H*MI:google X-HELO: mail-wm0-f74.google.com Received: from mail-wm0-f74.google.com (HELO mail-wm0-f74.google.com) (74.125.82.74) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 01 Aug 2017 09:20:46 +0000 Received: by mail-wm0-f74.google.com with SMTP id a186so52286wmh.6 for <gdb-patches@sourceware.org>; Tue, 01 Aug 2017 02:20:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc; bh=4C078Nm6DdKxgPsEQSqb+cBazTGYDPHOwsSPx/pkbsw=; b=p/3ktyD6KdSCA6dI3Mxsc6m/IfBN29KBYV57GYjtGOir5OF15Hrtu0b0tKXF/WolX7 oxVkWYJ8371xk5s6BcAHp8qHOs0y+Brxo6ckOSZRtXX+VZFftb4lRUb5BxERT04yzhtG Xh9MpoeAsjg8xgz0ftHhnSQdQjSP9Hl6Abq2nFccKgQzUWny7RVa3h+Z1fgWGaI1ALbd b/n6IegUHCczPkASsJOIWkSLaXTGSZPcH1fScsbFQybDsx33QV0IjQ8cj0f1hsAR/oHs IOo/05JasuFCFdFP1CjgtndagWB+r+aGOgUnppiHcCBOgAvLDSP2KBtjy5qO4el5aZvY fRUA== X-Gm-Message-State: AIVw113EHJNTqg7geGlslYLEWXxJeiOeeKqrrJJ3SM3VQjILp/fb+57Q RHc8VpLytONLJ0VHJCsPtwVRQHrqUa1WXsU0PNEQwC+tRhZwMQ3y6LaYo1L65zKAPUwCqzf3Ij0 F5JhiQvGd0n/76WyzptqhDt7LAQzspw6wehu7ErlDFYEtS5+UNTkDcX7orKrQ MIME-Version: 1.0 X-Received: by 10.28.92.208 with SMTP id q199mr54582wmb.2.1501579244035; Tue, 01 Aug 2017 02:20:44 -0700 (PDT) Date: Tue, 1 Aug 2017 10:20:30 +0100 Message-Id: <20170801092030.70676-1-leszeks@google.com> Subject: [PATCH] Fix dwarf2_string_attr for -gsplit-dwarf From: "Leszek Swirski via gdb-patches" <gdb-patches@sourceware.org> Reply-To: Leszek Swirski <leszeks@google.com> To: gdb-patches@sourceware.org Cc: Leszek Swirski <leszeks@google.com> Content-Type: text/plain; charset="UTF-8" |
Commit Message
Terekhov, Mikhail via Gdb-patches
Aug. 1, 2017, 9:20 a.m. UTC
The dwarf2_string_attr did not allow DW_FORM_GNU_str_index as a form for string types. This manifested as null strings in the namespace_name lookup (replaced with "(anonymous namespace)") when debugging Fission-compiled code. gdb/doc/ChangeLog: * dwarf2read.c: Fix dwarf2_string_attr to allow DW_FORM_GNU_str_index --- gdb/dwarf2read.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Comments
Hi Leszek, On 2017-08-01 11:20, Leszek Swirski via gdb-patches wrote: > The dwarf2_string_attr did not allow DW_FORM_GNU_str_index as a form > for > string types. This manifested as null strings in the namespace_name > lookup (replaced with "(anonymous namespace)") when debugging > Fission-compiled code. Thanks for the patch. I am not very knowledgeable in that area, but I looked at the problem for a while and I think the change is good. DW_STRING (attr) is set for attribute values of this form in read_attribute_value. Other functions like dwarf2_const_value_attr and dump_die_shallow read DW_STRING (attr) when dealing with an attribute of form DW_FORM_GNU_str_index as well. If you think this will be a one-time contribution, we can merge the patch for you, and there is no need for copyright assignment for a simple patch like that. However, if you'd like to contribute further to GDB, we can look into giving you write access, so you'll be able to push patches by yourself. Let me know which one you prefer. I just have some formatting comments about the patch itself. No need for a v2, especially if we push for you, but just so you are aware of the GNU/GDB coding standards. > gdb/doc/ChangeLog: The ChangeLog entry for this patch will go in the gdb/ChangeLog file. > > * dwarf2read.c: Fix dwarf2_string_attr to allow > DW_FORM_GNU_str_index The ChangeLog format has the function name in parentheses, for example: * dwarf2read.c (dwarf2_string_attr): Allow DW_FORM_GNU_strp_alt. > --- > gdb/dwarf2read.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c > index 2c2ecda7fc..f5bed09116 100644 > --- a/gdb/dwarf2read.c > +++ b/gdb/dwarf2read.c > @@ -17623,7 +17623,8 @@ dwarf2_string_attr (struct die_info *die, > unsigned int name, struct dwarf2_cu *c > if (attr != NULL) > { > if (attr->form == DW_FORM_strp || attr->form == > DW_FORM_line_strp > - || attr->form == DW_FORM_string || attr->form == > DW_FORM_GNU_strp_alt) > + || attr->form == DW_FORM_string || DW_FORM_GNU_str_index > + || attr->form == DW_FORM_GNU_strp_alt) The indentation for this line should be one tab + two spaces (like the previous line). Thanks, Simon
On Tue, Aug 1, 2017 at 9:20 PM, Simon Marchi <simon.marchi@polymtl.ca> wrote: > Thanks for the patch. I am not very knowledgeable in that area, but I > looked at the problem for a while and I think the change is good. DW_STRING > (attr) is set for attribute values of this form in read_attribute_value. > Other functions like dwarf2_const_value_attr and dump_die_shallow read > DW_STRING (attr) when dealing with an attribute of form > DW_FORM_GNU_str_index as well. Thanks, I'm not particularly knowledgeable here either, but this was pretty much the thread that I pulled on. > If you think this will be a one-time contribution, we can merge the patch > for you, and there is no need for copyright assignment for a simple patch > like that. However, if you'd like to contribute further to GDB, we can look > into giving you write access, so you'll be able to push patches by yourself. > Let me know which one you prefer. Probably a one-off for now, this was pretty much just scratching an itch. Anything that requires copyright assignment becomes more complicated for obvious reasons if sent from my work account. > The ChangeLog entry for this patch will go in the gdb/ChangeLog file. Right, this is obvious with 20/20 hindsight. Thanks. > The ChangeLog format has the function name in parentheses Thanks, acknowledged for next time. > The indentation for this line should be one tab + two spaces (like the > previous line). Yeah, I noticed that as soon as the email sent -- I had it right at one point, but I guess I got bitten by `set expandtab` before sending. My bad. I'm assuming you don't need anything more from me to push? Cheers, Leszek
On 2017-08-02 12:12, Leszek Swirski via gdb-patches wrote: >> If you think this will be a one-time contribution, we can merge the >> patch >> for you, and there is no need for copyright assignment for a simple >> patch >> like that. However, if you'd like to contribute further to GDB, we >> can look >> into giving you write access, so you'll be able to push patches by >> yourself. >> Let me know which one you prefer. > > Probably a one-off for now, this was pretty much just scratching an > itch. > Anything that requires copyright assignment becomes more complicated > for > obvious reasons if sent from my work account. Ok. >> The indentation for this line should be one tab + two spaces (like the >> previous line). > > Yeah, I noticed that as soon as the email sent -- I had it right at one > point, > but I guess I got bitten by `set expandtab` before sending. My bad. > > I'm assuming you don't need anything more from me to push? No, it should be fine. I'll just leave this patch up for review for a few days in case somebody else wants to comment, and will push after that. Thanks, Simon
On 2017-08-02 12:56, Simon Marchi wrote: > On 2017-08-02 12:12, Leszek Swirski via gdb-patches wrote: >>> If you think this will be a one-time contribution, we can merge the >>> patch >>> for you, and there is no need for copyright assignment for a simple >>> patch >>> like that. However, if you'd like to contribute further to GDB, we >>> can look >>> into giving you write access, so you'll be able to push patches by >>> yourself. >>> Let me know which one you prefer. >> >> Probably a one-off for now, this was pretty much just scratching an >> itch. >> Anything that requires copyright assignment becomes more complicated >> for >> obvious reasons if sent from my work account. > > Ok. > >>> The indentation for this line should be one tab + two spaces (like >>> the >>> previous line). >> >> Yeah, I noticed that as soon as the email sent -- I had it right at >> one point, >> but I guess I got bitten by `set expandtab` before sending. My bad. >> >> I'm assuming you don't need anything more from me to push? > > No, it should be fine. I'll just leave this patch up for review for a > few days in case somebody else wants to comment, and will push after > that. > > Thanks, > > Simon I have pushed this patch, thanks again. I ran the tests with the "fission" board file and there were many tests that went from FAIL -> PASS. So I concluded that we don't need to add a test specifically for this, but we should probably run the testsuite with the fission board on the buildbot. Simon
On 08/02/2017 11:12 AM, Leszek Swirski via gdb-patches wrote: > Probably a one-off for now, this was pretty much just scratching an itch. > Anything that requires copyright assignment becomes more complicated for > obvious reasons if sent from my work account. Google has a blanket copyright assignment in place, so you're already covered. Thanks, Pedro Alves
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 2c2ecda7fc..f5bed09116 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -17623,7 +17623,8 @@ dwarf2_string_attr (struct die_info *die, unsigned int name, struct dwarf2_cu *c if (attr != NULL) { if (attr->form == DW_FORM_strp || attr->form == DW_FORM_line_strp - || attr->form == DW_FORM_string || attr->form == DW_FORM_GNU_strp_alt) + || attr->form == DW_FORM_string || DW_FORM_GNU_str_index + || attr->form == DW_FORM_GNU_strp_alt) str = DW_STRING (attr); else complaint (&symfile_complaints,