This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Don't munge yacc's #line directives

On Thu, Jan 8, 2015 at 7:02 AM, Pedro Alves <> 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:
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

> 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  <>
>>       * (.y.c): Don't munge yacc's #line
>>       directives.
>> ---
>>  gdb/ | 1 -
>>  1 file changed, 1 deletion(-)
>> diff --git a/gdb/ b/gdb/
>> index 31c8a4c..97d0045 100644
>> --- a/gdb/
>> +++ b/gdb/
>> @@ -1856,7 +1856,6 @@ po/$(PACKAGE).pot: force
>>            -e 's/\([ \t;,(]\)free\([ \t]*[&(),]\)/\1xfree\2/g' \
>>            -e 's/\([ \t;,(]\)free$$/\1xfree/g' \
>>            -e '/^#line.*' \
>> -          -e "s/^\(#line.*\)`basename $<`/\1`echo $<|sed 's/\//\\\\\//g'`/" \
>>         < $@.tmp > $@
>>       rm -f $@.tmp
>>  .l.c:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]