From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27340 invoked by alias); 5 May 2005 17:32:34 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 27082 invoked from network); 5 May 2005 17:32:04 -0000 Received: from unknown (HELO lakermmtao10.cox.net) (68.230.240.29) by sourceware.org with SMTP; 5 May 2005 17:32:04 -0000 Received: from white ([68.9.64.121]) by lakermmtao10.cox.net (InterMail vM.6.01.04.00 201-2131-118-20041027) with ESMTP id <20050505173204.BBHW7787.lakermmtao10.cox.net@white> for ; Thu, 5 May 2005 13:32:04 -0400 Received: from bob by white with local (Exim 3.35 #1 (Debian)) id 1DTkCg-0008Jr-00 for ; Thu, 05 May 2005 13:32:02 -0400 Date: Thu, 05 May 2005 17:32:00 -0000 From: Bob Rossi To: gdb-patches@sources.redhat.com Subject: fullname syntax variable for testsuite Message-ID: <20050505173202.GC31758@white> Mail-Followup-To: gdb-patches@sources.redhat.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-SW-Source: 2005-05/txt/msg00171.txt.bz2 Hi all, Hopefully this should make everyone happy. If the regex is slightly incorrect, after this patch, it should be simple to modify it and have the testsuite pick up on those changes. As you will notice, the initial regex that Eli posted does not match the case d:foo. If it is desired to match this case up front, I can do that. Otherwise, it's noted in the comment, and can be changed when we run into the problem. Thanks, Bob Rossi 2005-05-05 Bob Rossi * lib/gdb.exp (fullname_syntax): Added global regex. * gdb.mi/mi-file.exp (test_file_list_exec_source_file): Added fullname_syntax variable to scope and use it. (test_file_list_exec_source_files): Ditto. * gdb.mi/mi2-file.exp (test_file_list_exec_source_file): Ditto. Index: gdb.mi/mi-file.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-file.exp,v retrieving revision 1.4 diff -w -u -r1.4 mi-file.exp --- gdb.mi/mi-file.exp 15 Aug 2004 10:15:58 -0000 1.4 +++ gdb.mi/mi-file.exp 5 May 2005 17:23:42 -0000 @@ -48,6 +48,7 @@ global srcfile global srcdir global subdir + global fullname_syntax set srcfilepath [string_to_regexp ${srcdir}/${subdir}/${srcfile}] # get the path and absolute path to the current executable @@ -63,16 +64,17 @@ set line_default [expr $line_main_body - $gdb_lines_to_list + 1] mi_gdb_test "111-file-list-exec-source-file" \ - "111\\\^done,line=\"$line_default\",file=\"${srcfilepath}\",fullname=\"/.*/${srcfile}\"" \ + "111\\\^done,line=\"$line_default\",file=\"${srcfilepath}\",fullname=\"$fullname_syntax${srcfile}\"" \ "request path info of current source file (${srcfile})" } proc test_file_list_exec_source_files {} { global srcfile + global fullname_syntax # get the path and absolute path to the current executable mi_gdb_test "222-file-list-exec-source-files" \ - "222\\\^done,files=\\\[\{file=\".*/${srcfile}\",fullname=\"/.*/${srcfile}\"\},\{file=\".*\"\},\{file=\".*\"\},\{file=\".*\"\},\{file=\".*\"\}\\\]" \ + "222\\\^done,files=\\\[\{file=\".*/${srcfile}\",fullname=\"$fullname_syntax${srcfile}\"\},\{file=\".*\"\},\{file=\".*\"\},\{file=\".*\"\},\{file=\".*\"\}\\\]" \ "Getting a list of source files." } Index: gdb.mi/mi2-file.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi2-file.exp,v retrieving revision 1.5 diff -w -u -r1.5 mi2-file.exp --- gdb.mi/mi2-file.exp 15 Aug 2004 10:15:58 -0000 1.5 +++ gdb.mi/mi2-file.exp 5 May 2005 17:23:42 -0000 @@ -48,6 +48,7 @@ global srcfile global srcdir global subdir + global fullname_syntax set srcfilepath [string_to_regexp ${srcdir}/${subdir}/${srcfile}] # get the path and absolute path to the current executable @@ -63,7 +64,7 @@ set line_default [expr $line_main_body - $gdb_lines_to_list + 1] mi_gdb_test "111-file-list-exec-source-file" \ - "111\\\^done,line=\"$line_default\",file=\"${srcfilepath}\",fullname=\"/.*/${srcfile}\"" \ + "111\\\^done,line=\"$line_default\",file=\"${srcfilepath}\",fullname=\"$fullname_syntax${srcfile}\"" \ "request path info of current source file (${srcfile})" } Index: lib/gdb.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v retrieving revision 1.62 diff -w -u -r1.62 gdb.exp --- lib/gdb.exp 3 May 2005 00:41:49 -0000 1.62 +++ lib/gdb.exp 5 May 2005 17:23:43 -0000 @@ -51,6 +51,15 @@ set gdb_prompt "\[(\]gdb\[)\]" } +# The variable fullname_syntax is a regexp which matches what GDB considers +# an absolute path. It is currently debatable if the windows style paths +# d:foo and \abc should be considered valid as an absolute path. +# This regex matches \abc but not d:foo. +global fullname_syntax +if ![info exists fullname_syntax] then { + set fullname_syntax "(\[A-z\]:)?\[/\\\\\].*" +} + # Needed for some tests under Cygwin. global EXEEXT global env