aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorBob Rossi <bob@brasko.net>2005-05-08 13:42:04 +0000
committerBob Rossi <bob@brasko.net>2005-05-08 13:42:04 +0000
commit6006a3a1ec3bfe06d562da123c2c8a3d71291184 (patch)
tree08bb2d5bc55a053594a459823247dcb15607332b /gdb
parentc41aea10b5fb1fe333cd61c84eea09c31a4dfc0a (diff)
downloadgdb-6006a3a1ec3bfe06d562da123c2c8a3d71291184.zip
gdb-6006a3a1ec3bfe06d562da123c2c8a3d71291184.tar.gz
gdb-6006a3a1ec3bfe06d562da123c2c8a3d71291184.tar.bz2
Add the fullname_syntax testsuite variable. This allows GDB to make sure
that the MI fullname field is an absolute path, instead of just checking for .* or /.*
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog12
-rw-r--r--gdb/testsuite/gdb.mi/mi-file.exp6
-rw-r--r--gdb/testsuite/gdb.mi/mi2-file.exp3
-rw-r--r--gdb/testsuite/lib/gdb.exp20
4 files changed, 38 insertions, 3 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index abbc023..3970593 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,15 @@
+2005-05-05 Bob Rossi <bob_rossi@cox.net>
+
+ * lib/gdb.exp (fullname_syntax): Added global regex.
+ (fullname_syntax_POSIX): Ditto.
+ (fullname_syntax_UNC): Ditto.
+ (fullname_syntax_DOS_CASE): Ditto.
+ (fullname_syntax_DOS): Ditto.
+ * 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.
+
2005-05-04 Daniel Jacobowitz <dan@codesourcery.com>
* gdb.threads/linux-dp.exp: Check for *-*-linux-gnu*.
diff --git a/gdb/testsuite/gdb.mi/mi-file.exp b/gdb/testsuite/gdb.mi/mi-file.exp
index 0ce4fd6..6104466 100644
--- a/gdb/testsuite/gdb.mi/mi-file.exp
+++ b/gdb/testsuite/gdb.mi/mi-file.exp
@@ -48,6 +48,7 @@ proc test_file_list_exec_source_file {} {
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 @@ proc test_file_list_exec_source_file {} {
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."
}
diff --git a/gdb/testsuite/gdb.mi/mi2-file.exp b/gdb/testsuite/gdb.mi/mi2-file.exp
index 1e81df6..50581ca 100644
--- a/gdb/testsuite/gdb.mi/mi2-file.exp
+++ b/gdb/testsuite/gdb.mi/mi2-file.exp
@@ -48,6 +48,7 @@ proc test_file_list_exec_source_file {} {
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 @@ proc test_file_list_exec_source_file {} {
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})"
}
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index c587c87..c2c0b15 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -51,6 +51,26 @@ if ![info exists gdb_prompt] then {
set gdb_prompt "\[(\]gdb\[)\]"
}
+# The variable fullname_syntax_POSIX is a regexp which matches a POSIX
+# absolute path ie. /foo/
+set fullname_syntax_POSIX "/.*/"
+# The variable fullname_syntax_UNC is a regexp which matches a Windows
+# UNC path ie. \\D\foo\
+set fullname_syntax_UNC {\\\\[^\\]+\\.+\\}
+# The variable fullname_syntax_DOS_CASE is a regexp which matches a
+# particular DOS case that GDB most likely will output
+# ie. \foo\, but don't match \\.*\
+set fullname_syntax_DOS_CASE {\\[^\\].*\\}
+# The variable fullname_syntax_DOS is a regexp which matches a DOS path
+# ie. a:\foo\ && a:foo\
+set fullname_syntax_DOS {[a-zA-Z]:.*\\}
+# 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.
+# Also, the purpse of this regexp is not to recognize a well formed
+# absolute path, but to say with certainty that a path is absolute.
+set fullname_syntax "($fullname_syntax_POSIX|$fullname_syntax_UNC|$fullname_syntax_DOS_CASE|$fullname_syntax_DOS)"
+
# Needed for some tests under Cygwin.
global EXEEXT
global env