2004-01-12 Elena Zannoni <ezannoni@redhat.com>
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>
Tue, 13 Jan 2004 00:25:28 +0000 (00:25 +0000)
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>
Tue, 13 Jan 2004 00:25:28 +0000 (00:25 +0000)
* gdb.mi/mi2-basics.exp: Make sure that full pathnames are
        escaped correctly.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.mi/mi2-basics.exp

index fec3158f252056c5f0e13a7231188e3dbc442a04..40b573908cd3be06c05a5ff40d46e0ab0cc3c0f4 100644 (file)
@@ -1,3 +1,8 @@
+2004-01-12  Elena Zannoni  <ezannoni@redhat.com>
+
+       * gdb.mi/mi2-basics.exp: Make sure that full pathnames are
+        escaped correctly.
+
 2004-01-12  Elena Zannoni  <ezannoni@redhat.com>
 
        * gdb.base/sepdebug.exp: New file.
index 44d2e4b9dfae9aee840065bf94f827ee5ae93675..a86ba3765b5ff6a6a98ebfaaa9f66dc1346be561 100644 (file)
@@ -1,4 +1,4 @@
-#   Copyright 1999, 2000 Free Software Foundation, Inc.
+# Copyright 1999, 2000, 2004 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -40,6 +40,9 @@ if [mi_gdb_start] {
 set testfile "basics"
 set srcfile ${testfile}.c
 set binfile ${objdir}/${subdir}/${testfile}
+set escapedobjdir [string_to_regexp ${objdir}]
+set escapedsrcdir [string_to_regexp ${srcdir}]
+
 if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
      gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
 }
@@ -154,13 +157,14 @@ proc test_dir_specification {} {
     # -environment-directory 
     # -environment-directory -r
 
-#exp_internal 1
+    set envirodir [string_to_regexp ${srcdir}/${subdir}]
+
     mi_gdb_test "202-environment-directory ${srcdir}/${subdir}" \
-             "\\\^done,source-path=\"${srcdir}/${subdir}.\\\$cdir.\\\$cwd\"" \
+             "\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \
              "environment-directory arg operation"
 
     mi_gdb_test "203-environment-directory" \
-             "\\\^done,source-path=\"${srcdir}/${subdir}.\\\$cdir.\\\$cwd\"" \
+             "\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \
              "environment-directory empty-string operation"
 
     mi_gdb_test "204-environment-directory -r" \
@@ -174,6 +178,7 @@ proc test_cwd_specification {} {
     global mi_gdb_prompt
     global objdir
     global subdir
+    global escapedobjdir
 
     # Change the working directory, then print the current working directory
     # Tests:
@@ -185,7 +190,7 @@ proc test_cwd_specification {} {
              "environment-cd arg operation"
 
     mi_gdb_test "206-environment-pwd" \
-             "\\\^done,cwd=\"${objdir}\"" \
+             "\\\^done,cwd=\"${escapedobjdir}\"" \
              "environment-pwd operation"
 }
 
@@ -194,6 +199,8 @@ proc test_path_specification {} {
     global orig_path
     global objdir
     global srcdir
+    global escapedobjdir
+    global escapedsrcdir
 
     # Add to the path, display, then reset 
     # Tests:
@@ -202,8 +209,6 @@ proc test_path_specification {} {
     # -environment-path -r dir
     # -environment-path -r
 
-#exp_internal 1
-
     send_gdb "-environment-path\n"
     gdb_expect 20 {
        -re "\\\^done,path=\"\(.*\)\"\r\n$mi_gdb_prompt" { 
@@ -220,18 +225,17 @@ proc test_path_specification {} {
              "environment-path no-args operation"
 
     mi_gdb_test "208-environment-path $srcdir $objdir" \
-             "\\\^done,path=\"$srcdir.$objdir.$orig_path\"" \
+             "\\\^done,path=\"$escapedsrcdir.$escapedobjdir.$orig_path\"" \
              "environment-path dir1 dir2 operation"
 
     mi_gdb_test "209-environment-path -r $objdir" \
-             "\\\^done,path=\"$objdir.$orig_path\"" \
+             "\\\^done,path=\"$escapedobjdir.$orig_path\"" \
              "environment-path -r dir operation"
 
     mi_gdb_test "210-environment-path -r" \
              "\\\^done,path=\"$orig_path\"" \
              "environment-path -r operation"
 
-#exp_internal 0
 } 
 
 if [test_mi_interpreter_selection] {