aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base
diff options
context:
space:
mode:
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>2003-08-07 17:55:41 +0000
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>2003-08-07 17:55:41 +0000
commite0f353ceed204d98f0581a17e84d33dd18c65ec5 (patch)
tree9c094245f62150a65134834582d9cc96dbdfb33c /gdb/testsuite/gdb.base
parent5710a1afa99d21787b0eea1a876115767684329d (diff)
downloadgdb-e0f353ceed204d98f0581a17e84d33dd18c65ec5.zip
gdb-e0f353ceed204d98f0581a17e84d33dd18c65ec5.tar.gz
gdb-e0f353ceed204d98f0581a17e84d33dd18c65ec5.tar.bz2
2003-08-07 Elena Zannoni <ezannoni@redhat.com>
* gdb.base/attach.exp, gdb.base/detach.exp, gdb.base/gcore.exp, gdb.mi/mi-basics.exp, gdb.threads/gcore-thread.exp, gdb.trace/save-trace.exp: Make sure that full pathnames are escaped correctly.
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r--gdb/testsuite/gdb.base/attach.exp14
-rw-r--r--gdb/testsuite/gdb.base/detach.exp4
-rw-r--r--gdb/testsuite/gdb.base/gcore.exp4
3 files changed, 14 insertions, 8 deletions
diff --git a/gdb/testsuite/gdb.base/attach.exp b/gdb/testsuite/gdb.base/attach.exp
index 66e9f0e..ea11087 100644
--- a/gdb/testsuite/gdb.base/attach.exp
+++ b/gdb/testsuite/gdb.base/attach.exp
@@ -45,6 +45,7 @@ set srcfile ${testfile}.c
set srcfile2 ${testfile}2.c
set binfile ${objdir}/${subdir}/${testfile}
set binfile2 ${objdir}/${subdir}/${testfile}2
+set escapedbinfile [string_to_regexp ${objdir}/${subdir}/${testfile}]
set cleanupfile ${objdir}/${subdir}/${testfile}.awk
#execute_anywhere "rm -f ${binfile} ${binfile2}"
@@ -76,6 +77,7 @@ if [get_compiler_info ${binfile}] {
proc do_attach_tests {} {
global gdb_prompt
global binfile
+ global escapedbinfile
global srcfile
global testfile
global objdir
@@ -157,13 +159,13 @@ proc do_attach_tests {} {
-re "Load new symbol table from.*y or n.*$" {
send_gdb "y\n"
gdb_expect {
- -re "Reading symbols from $binfile\.\.\.*done.*$gdb_prompt $"\
+ -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $"\
{pass "(re)set file, before attach1"}
-re "$gdb_prompt $" {fail "(re)set file, before attach1"}
timeout {fail "(timeout) (re)set file, before attach1"}
}
}
- -re "Reading symbols from $binfile\.\.\.*done.*$gdb_prompt $"\
+ -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $"\
{pass "set file, before attach1"}
-re "$gdb_prompt $" {fail "set file, before attach1"}
timeout {fail "(timeout) set file, before attach1"}
@@ -171,7 +173,7 @@ proc do_attach_tests {} {
send_gdb "attach $testpid\n"
gdb_expect {
- -re "Attaching to program.*`?$binfile'?, process $testpid.*main.*at .*$srcfile:.*$gdb_prompt $"\
+ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*main.*at .*$srcfile:.*$gdb_prompt $"\
{pass "attach1, after setting file"}
-re "$gdb_prompt $" {fail "attach1, after setting file"}
timeout {fail "(timeout) attach1, after setting file"}
@@ -192,7 +194,7 @@ proc do_attach_tests {} {
#
send_gdb "detach\n"
gdb_expect {
- -re "Detaching from program: .*$binfile.*$gdb_prompt $"\
+ -re "Detaching from program: .*$escapedbinfile.*$gdb_prompt $"\
{pass "attach1 detach"}
-re "$gdb_prompt $" {fail "attach1 detach"}
timeout {fail "(timeout) attach1 detach"}
@@ -234,7 +236,7 @@ proc do_attach_tests {} {
#
send_gdb "attach $testpid\n"
gdb_expect {
- -re "Attaching to process $testpid.*Reading symbols from $binfile.*main.*at .*$gdb_prompt $"\
+ -re "Attaching to process $testpid.*Reading symbols from $escapedbinfile.*main.*at .*$gdb_prompt $"\
{pass "attach2"}
-re "$gdb_prompt $" {fail "attach2"}
timeout {fail "(timeout) attach2"}
@@ -335,7 +337,7 @@ proc do_attach_tests {} {
send_gdb "attach $testpid\n"
gdb_expect {
- -re "Attaching to process $testpid.*Reading symbols from $binfile.*main.*at .*$gdb_prompt $"\
+ -re "Attaching to process $testpid.*Reading symbols from $escapedbinfile.*main.*at .*$gdb_prompt $"\
{pass "attach when process' a.out not in cwd"}
-re "$gdb_prompt $" {fail "attach when process' a.out not in cwd"}
timeout {fail "(timeout) attach when process' a.out not in cwd"}
diff --git a/gdb/testsuite/gdb.base/detach.exp b/gdb/testsuite/gdb.base/detach.exp
index 1556cf9..1f86fec 100644
--- a/gdb/testsuite/gdb.base/detach.exp
+++ b/gdb/testsuite/gdb.base/detach.exp
@@ -40,6 +40,7 @@ if [is_remote target] then {
set testfile "attach"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
+set escapedbinfile [string_to_regexp ${objdir}/${subdir}/${testfile}]
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
@@ -48,12 +49,13 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
proc do_detach_tests {} {
global srcdir
global binfile
+ global escapedbinfile
global subdir
global pass
runto_main
gdb_test "set should_exit = 1" "" "set should_exit, $pass"
- gdb_test "detach" "Detaching from program: .*$binfile, .*" "detach, $pass"
+ gdb_test "detach" "Detaching from program: .*$escapedbinfile, .*" "detach, $pass"
}
# Start with a fresh gdb
diff --git a/gdb/testsuite/gdb.base/gcore.exp b/gdb/testsuite/gdb.base/gcore.exp
index f8d5baa..8c0ae8e 100644
--- a/gdb/testsuite/gdb.base/gcore.exp
+++ b/gdb/testsuite/gdb.base/gcore.exp
@@ -104,8 +104,10 @@ set pre_corefile_local_array \
set pre_corefile_extern_array \
[capture_command_output "print extern_array" "$print_prefix"]
+set escapedfilename [string_to_regexp ${objdir}/${subdir}/gcore.test]
+
gdb_test "gcore ${objdir}/${subdir}/gcore.test" \
- "Saved corefile ${objdir}/${subdir}/gcore.test" \
+ "Saved corefile ${escapedfilename}" \
"save a corefile"
# Now restart gdb and load the corefile.