This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [patch/testsuite] lib/gdb.exp: native tcl gdb_get_line_number
- From: Mark Kettenis <kettenis at chello dot nl>
- To: mec dot gnu at mindspring dot com
- Cc: gdb-patches at sources dot redhat dot com
- Date: Mon, 9 Aug 2004 19:55:36 +0200 (CEST)
- Subject: Re: [patch/testsuite] lib/gdb.exp: native tcl gdb_get_line_number
- References: <4116516C.nailLPL1BAKH4@mindspring.com>
Date: Sun, 08 Aug 2004 12:14:36 -0400
From: Michael Chastain <mec.gnu@mindspring.com>
2004-08-08 Michael Chastain <mec.gnu@mindspring.com>
* lib/gdb.exp (gdb_get_line_number): Rewrite with native tcl
rather than asking gdb to search.
This causes problems if you configure using a relative pathname, i.e.
../src/configure --enable-gdb-build-warnings=,-Werror
Because relative pathnames don't start with /, gdb_get_line_number
will prepend the source directory yet another time. That won't work.
The attached patch fixes things for me, but can somebody please check
whether i've escaped the dot correctly?
Index: testsuite/ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* lib/gdb.exp: Recognize relative path names as well as absolute
ones.
Index: testsuite/lib/gdb.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.54
diff -u -p -r1.54 gdb.exp
--- testsuite/lib/gdb.exp 9 Aug 2004 13:16:15 -0000 1.54
+++ testsuite/lib/gdb.exp 9 Aug 2004 17:54:47 -0000
@@ -1874,7 +1874,7 @@ proc gdb_get_line_number { text { file "
if { "$file" == "" } then {
set file "$srcfile"
}
- if { ! [regexp "^/" "$file"] } then {
+ if { ! [regexp "^(/|\\.)" "$file"] } then {
set file "$srcdir/$subdir/$file"
}