This is the mail archive of the gdb-patches@sources.redhat.com 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/testsuite] lib/gdb.exp: native tcl gdb_get_line_number


   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"
     }
 


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