Message ID | 1420678878-14065-1-git-send-email-patrick@parcs.ath.cx |
---|---|
State | New, archived |
Headers |
Received: (qmail 22952 invoked by alias); 8 Jan 2015 01:01:31 -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 22752 invoked by uid 89); 8 Jan 2015 01:01:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-HELO: mail-qa0-f54.google.com Received: from mail-qa0-f54.google.com (HELO mail-qa0-f54.google.com) (209.85.216.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 08 Jan 2015 01:01:28 +0000 Received: by mail-qa0-f54.google.com with SMTP id i13so5311791qae.13 for <gdb-patches@sourceware.org>; Wed, 07 Jan 2015 17:01:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=llbNC9scytStEmk5VnbEQGvWwOA/En30Ei3awhYfxRg=; b=Z3i9iszv2nkbdoHf0xH2gaiFL9lRhbe6N0a+qU/ZF0A4cktpW+G8EO8B8QG5ks6DHK XplUhA3hne8lOvh6ctPB5mwKD1/KDicMblqt1XHTgz6YXUyDWSYjaLlIRB3cmMJdjc0f +M1szhgiWInzMSNzglAV6sZ1AS/gbpaBL97vtrMIXDJFLgSUkGVxBsTwttqlFLYy23Lt lo6yUKx66h6Cff3NTmiOHrmtTgSgmoQei4mpsxKLENCs1ccsEUxhAJVtmq8fRgqrC3o5 D8iVb8Btj9/olgUuURfJIg7W2sjZDVsAX9EQUWWmgM3XL9QJ26TLbLObu6KtH88+Q7BO zWiQ== X-Gm-Message-State: ALoCoQkoq1ftbRJDnxzgy2LZ2wLOqRF8DRmCJeFhoR3V9FM4nw4rlZ8FZ4XAr4MzRfh2u2+WfPf9 X-Received: by 10.224.92.205 with SMTP id s13mr10163908qam.52.1420678885764; Wed, 07 Jan 2015 17:01:25 -0800 (PST) Received: from localhost.localdomain (ool-4353ac94.dyn.optonline.net. [67.83.172.148]) by mx.google.com with ESMTPSA id s9sm2669011qge.19.2015.01.07.17.01.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Jan 2015 17:01:24 -0800 (PST) From: Patrick Palka <patrick@parcs.ath.cx> To: gdb-patches@sourceware.org Cc: Patrick Palka <patrick@parcs.ath.cx> Subject: [PATCH] Don't munge yacc's #line directives Date: Wed, 7 Jan 2015 20:01:18 -0500 Message-Id: <1420678878-14065-1-git-send-email-patrick@parcs.ath.cx> |
Commit Message
Patrick Palka
Jan. 8, 2015, 1:01 a.m. UTC
The #line directives within GDB's autogenerated yacc files (e.g. c-exp.c) are being munged by a dubious sed expression that is causing these directives to refer to nonexistent source files. As a result it is currently not possible to debug these source files at source level. The culprit sed expression was added by commit 954d8cae for non-obvious reasons. My guess is that the expression was added to work around a bug in ylwrap which has since been fixed upstream: if I revert the November 2014 update to ylwrap, commit be3046511, then the culprit sed line no longer causes the above mentioned issue. So this patch removes the culprit sed script since it does not seem needed anymore; the emitted #line directives look and work fine without it. gdb/ChangeLog: 2015-01-07 Patrick Palka <patrick@parcs.ath.cx> * Makefile.in (.y.c): Don't munge yacc's #line directives. --- gdb/Makefile.in | 1 - 1 file changed, 1 deletion(-)
Comments
On 01/08/2015 01:01 AM, Patrick Palka wrote: > The #line directives within GDB's autogenerated yacc files (e.g. > c-exp.c) are being munged by a dubious sed expression that is causing > these directives to refer to nonexistent source files. As a result it > is currently not possible to debug these source files at source level. > > The culprit sed expression was added by commit 954d8cae for non-obvious > reasons. That predates when we started putting more complete descriptions in the commit log. Did you look for the mailing list patch submission? That should have included a description. If not, then maybe Jan recalls. The expression refers to basename and slashes, it makes me wonder whether this was build-in-srcdir vs build-out-of-srcdir related. > My guess is that the expression was added to work around a bug > in ylwrap which has since been fixed upstream: if I revert the November > 2014 update to ylwrap, commit be3046511, then the culprit sed line no OOC, got url for that git repo? Thanks, Pedro Alves > longer causes the above mentioned issue. > > So this patch removes the culprit sed script since it does not seem > needed anymore; the emitted #line directives look and work fine without > it. > > gdb/ChangeLog: > > 2015-01-07 Patrick Palka <patrick@parcs.ath.cx> > > * Makefile.in (.y.c): Don't munge yacc's #line > directives. > --- > gdb/Makefile.in | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/gdb/Makefile.in b/gdb/Makefile.in > index 31c8a4c..97d0045 100644 > --- a/gdb/Makefile.in > +++ b/gdb/Makefile.in > @@ -1856,7 +1856,6 @@ po/$(PACKAGE).pot: force > -e 's/\([ \t;,(]\)free\([ \t]*[&(),]\)/\1xfree\2/g' \ > -e 's/\([ \t;,(]\)free$$/\1xfree/g' \ > -e '/^#line.*y.tab.c/d' \ > - -e "s/^\(#line.*\)`basename $<`/\1`echo $<|sed 's/\//\\\\\//g'`/" \ > < $@.tmp > $@ > rm -f $@.tmp > .l.c: >
On Thu, Jan 8, 2015 at 7:02 AM, Pedro Alves <palves@redhat.com> wrote: > On 01/08/2015 01:01 AM, Patrick Palka wrote: >> The #line directives within GDB's autogenerated yacc files (e.g. >> c-exp.c) are being munged by a dubious sed expression that is causing >> these directives to refer to nonexistent source files. As a result it >> is currently not possible to debug these source files at source level. >> >> The culprit sed expression was added by commit 954d8cae for non-obvious >> reasons. > > That predates when we started putting more complete descriptions > in the commit log. Did you look for the mailing list patch submission? > That should have included a description. If not, then maybe Jan > recalls. The expression refers to basename and slashes, it makes > me wonder whether this was build-in-srcdir vs build-out-of-srcdir > related. Here is the corresponding ML listing: https://sourceware.org/ml/gdb-patches/2010-11/msg00265.html So it seems that ylwrap once used relative paths when referring to the source yacc file instead of absolute paths, and the sed expression was there to fix that. But our copy of ylwrap doesn't seem to have this problem anymore. > > >> My guess is that the expression was added to work around a bug >> in ylwrap which has since been fixed upstream: if I revert the November >> 2014 update to ylwrap, commit be3046511, then the culprit sed line no > > OOC, got url for that git repo? Oops, I truncated the commit hash too much. The commit in question is e30465112 from within the binutils-gdb repo. The commit synced some files with upstream automake whose git repo is http://git.savannah.gnu.org/cgit/automake.git. > > Thanks, > Pedro Alves > >> longer causes the above mentioned issue. >> >> So this patch removes the culprit sed script since it does not seem >> needed anymore; the emitted #line directives look and work fine without >> it. >> >> gdb/ChangeLog: >> >> 2015-01-07 Patrick Palka <patrick@parcs.ath.cx> >> >> * Makefile.in (.y.c): Don't munge yacc's #line >> directives. >> --- >> gdb/Makefile.in | 1 - >> 1 file changed, 1 deletion(-) >> >> diff --git a/gdb/Makefile.in b/gdb/Makefile.in >> index 31c8a4c..97d0045 100644 >> --- a/gdb/Makefile.in >> +++ b/gdb/Makefile.in >> @@ -1856,7 +1856,6 @@ po/$(PACKAGE).pot: force >> -e 's/\([ \t;,(]\)free\([ \t]*[&(),]\)/\1xfree\2/g' \ >> -e 's/\([ \t;,(]\)free$$/\1xfree/g' \ >> -e '/^#line.*y.tab.c/d' \ >> - -e "s/^\(#line.*\)`basename $<`/\1`echo $<|sed 's/\//\\\\\//g'`/" \ >> < $@.tmp > $@ >> rm -f $@.tmp >> .l.c: >> > >
On Thu, Jan 8, 2015 at 7:24 AM, Patrick Palka <patrick@parcs.ath.cx> wrote: > On Thu, Jan 8, 2015 at 7:02 AM, Pedro Alves <palves@redhat.com> wrote: >> On 01/08/2015 01:01 AM, Patrick Palka wrote: >>> The #line directives within GDB's autogenerated yacc files (e.g. >>> c-exp.c) are being munged by a dubious sed expression that is causing >>> these directives to refer to nonexistent source files. As a result it >>> is currently not possible to debug these source files at source level. >>> >>> The culprit sed expression was added by commit 954d8cae for non-obvious >>> reasons. >> >> That predates when we started putting more complete descriptions >> in the commit log. Did you look for the mailing list patch submission? >> That should have included a description. If not, then maybe Jan >> recalls. The expression refers to basename and slashes, it makes >> me wonder whether this was build-in-srcdir vs build-out-of-srcdir >> related. > > Here is the corresponding ML listing: > https://sourceware.org/ml/gdb-patches/2010-11/msg00265.html > So it seems that ylwrap once used relative paths when referring to the > source yacc file instead of absolute paths, and the sed expression was > there to fix that. But our copy of ylwrap doesn't seem to have this > problem anymore. > >> >> >>> My guess is that the expression was added to work around a bug >>> in ylwrap which has since been fixed upstream: if I revert the November >>> 2014 update to ylwrap, commit be3046511, then the culprit sed line no >> >> OOC, got url for that git repo? > > Oops, I truncated the commit hash too much. The commit in question is > e30465112 from within the binutils-gdb repo. The commit synced some > files with upstream automake whose git repo is > http://git.savannah.gnu.org/cgit/automake.git. Here is the upstream automake patch that is probably responsible for making the sed expression in question obsolete: http://git.savannah.gnu.org/cgit/automake.git/commit/lib/ylwrap?id=b6359a5f310160c8a4a2e8e8c0105408412ce400 > >> >> Thanks, >> Pedro Alves >> >>> longer causes the above mentioned issue. >>> >>> So this patch removes the culprit sed script since it does not seem >>> needed anymore; the emitted #line directives look and work fine without >>> it. >>> >>> gdb/ChangeLog: >>> >>> 2015-01-07 Patrick Palka <patrick@parcs.ath.cx> >>> >>> * Makefile.in (.y.c): Don't munge yacc's #line >>> directives. >>> --- >>> gdb/Makefile.in | 1 - >>> 1 file changed, 1 deletion(-) >>> >>> diff --git a/gdb/Makefile.in b/gdb/Makefile.in >>> index 31c8a4c..97d0045 100644 >>> --- a/gdb/Makefile.in >>> +++ b/gdb/Makefile.in >>> @@ -1856,7 +1856,6 @@ po/$(PACKAGE).pot: force >>> -e 's/\([ \t;,(]\)free\([ \t]*[&(),]\)/\1xfree\2/g' \ >>> -e 's/\([ \t;,(]\)free$$/\1xfree/g' \ >>> -e '/^#line.*y.tab.c/d' \ >>> - -e "s/^\(#line.*\)`basename $<`/\1`echo $<|sed 's/\//\\\\\//g'`/" \ >>> < $@.tmp > $@ >>> rm -f $@.tmp >>> .l.c: >>> >> >>
On 01/08/2015 12:48 PM, Patrick Palka wrote: > Here is the upstream automake patch that is probably responsible for > making the sed expression in question obsolete: > http://git.savannah.gnu.org/cgit/automake.git/commit/lib/ylwrap?id=b6359a5f310160c8a4a2e8e8c0105408412ce400 I find that a bit confusing, since the comment says: # We don't want the resulting debug information to point at # an absolute srcdir. (the upstream master version still has the comment, though reformatted). In any case, I think we've done due diligence already. Could you update the commit log with the new findings and references, and please also include an before/after example of a #line line? With that, the patch is OK. E.g., here's what I see, before/after your patch: -#line 36 "/home/pedro/gdb/mygit/src/gdb//home/pedro/gdb/mygit/src/gdb/ada-exp.y" +#line 36 "/home/pedro/gdb/mygit/src/gdb/ada-exp.y" Thanks, Pedro Alves
On Thu, Jan 8, 2015 at 9:06 AM, Pedro Alves <palves@redhat.com> wrote: > On 01/08/2015 12:48 PM, Patrick Palka wrote: > >> Here is the upstream automake patch that is probably responsible for >> making the sed expression in question obsolete: >> http://git.savannah.gnu.org/cgit/automake.git/commit/lib/ylwrap?id=b6359a5f310160c8a4a2e8e8c0105408412ce400 > > I find that a bit confusing, since the comment says: > > # We don't want the resulting debug information to point at > # an absolute srcdir. > > (the upstream master version still has the comment, though > reformatted). > > In any case, I think we've done due diligence already. > > Could you update the commit log with the new findings and > references, and please also include an before/after example > of a #line line? With that, the patch is OK. > > E.g., here's what I see, before/after your patch: > > -#line 36 "/home/pedro/gdb/mygit/src/gdb//home/pedro/gdb/mygit/src/gdb/ada-exp.y" > +#line 36 "/home/pedro/gdb/mygit/src/gdb/ada-exp.y" Attached is what I committed. > > Thanks, > Pedro Alves >
diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 31c8a4c..97d0045 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -1856,7 +1856,6 @@ po/$(PACKAGE).pot: force -e 's/\([ \t;,(]\)free\([ \t]*[&(),]\)/\1xfree\2/g' \ -e 's/\([ \t;,(]\)free$$/\1xfree/g' \ -e '/^#line.*y.tab.c/d' \ - -e "s/^\(#line.*\)`basename $<`/\1`echo $<|sed 's/\//\\\\\//g'`/" \ < $@.tmp > $@ rm -f $@.tmp .l.c: