This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb/users/hjl/linux/master] Don't munge yacc's #line directives
- From: H.J.Lu <hjl at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 11 Jan 2015 21:43:47 -0000
- Subject: [binutils-gdb/users/hjl/linux/master] Don't munge yacc's #line directives
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6bf045cd32d07ae55d7eec8ff94bd937c6bb2bce
commit 6bf045cd32d07ae55d7eec8ff94bd937c6bb2bce
Author: Patrick Palka <patrick@parcs.ath.cx>
Date: Sun Nov 30 11:47:16 2014 -0500
Don't munge yacc's #line directives
The #line directives within GDB's autogenerated yacc files (e.g.
c-exp.c) are being incorrectly munged, causing these directives to refer
to nonexistent source files, e.g.
#line 36 "/home/patrick/binutils-gdb/gdb//home/patrick/binutils-gdb/gdb/c-exp.y"
as opposed to
#line 36 "/home/patrick/binutils-gdb/gdb/c-exp.y"
The munging happens due to a sed expression added by commit 954d8cae
whose intended purpose[1] was to work around the fact that ylwrap emitted #line
directives without any directory information, e.g.
#line 36 "c-exp.y"
So the sed expression was meant to munge such directives to refer to
absolute paths instead. But the behavior of ylwrap was changed some
years ago[2] to emit absolute paths within #line directives. And when
our local copy of ylwrap was synced by commit e30465112, the sed
expression in question became unnecessary, and indeed harmful.
This patch removes the now-obsolete sed expression. The emitted #line
directives are now correct without it.
gdb/ChangeLog:
* Makefile.in (.y.c): Don't munge yacc's #line
directives.
[1]: https://sourceware.org/ml/gdb-patches/2010-11/msg00265.html
[2]: http://git.savannah.gnu.org/cgit/automake.git/commit/lib/ylwrap?id=b6359a5f3
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/Makefile.in | 1 -
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2e9816a..c830053 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2015-01-09 Patrick Palka <patrick@parcs.ath.cx>
+ * Makefile.in (.y.c): Don't munge yacc's #line
+ directives.
+
+2015-01-09 Patrick Palka <patrick@parcs.ath.cx>
+
* utils.c (defaulted_query): Rewrite to use gdb_readline_wrapper
to prompt for input.
* tui/tui-hooks.c (tui_query_hook): Remove.
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 5dae3e6..86ab1be 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1858,7 +1858,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: