From 18ef391a79907c2146c9f0d92f312b0fe42ccd05 Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Fri, 12 Jan 2007 21:31:35 +0000 Subject: [PATCH] * gdb.mi/mi-basics.exp, gdb.mi/mi2-basics.exp (test_dir_specification) (test_path_specification): Use objdir instead of srcdir to always get an absolute filename. --- gdb/testsuite/gdb.mi/mi-basics.exp | 18 +++++++++--------- gdb/testsuite/gdb.mi/mi2-basics.exp | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/gdb/testsuite/gdb.mi/mi-basics.exp b/gdb/testsuite/gdb.mi/mi-basics.exp index 9cdc0c98280..d8d4b172453 100644 --- a/gdb/testsuite/gdb.mi/mi-basics.exp +++ b/gdb/testsuite/gdb.mi/mi-basics.exp @@ -42,7 +42,7 @@ set testfile "basics" set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} set escapedobjdir [string_to_regexp ${objdir}] -set escapedsrcdir [string_to_regexp ${srcdir}] +set envirodir [string_to_regexp ${objdir}/${subdir}] if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } { untested mi-basics.exp @@ -150,8 +150,9 @@ proc test_breakpoints_deletion {} { proc test_dir_specification {} { global mi_gdb_prompt - global srcdir + global objdir global subdir + global envirodir # Add to the search directories, display, then reset back to default # Tests: @@ -159,9 +160,7 @@ proc test_dir_specification {} { # -environment-directory # -environment-directory -r - set envirodir [string_to_regexp ${srcdir}/${subdir}] - - mi_gdb_test "202-environment-directory ${srcdir}/${subdir}" \ + mi_gdb_test "202-environment-directory ${objdir}/${subdir}" \ "202\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \ "environment-directory arg operation" @@ -198,9 +197,9 @@ proc test_path_specification {} { global mi_gdb_prompt global orig_path global objdir - global srcdir + global subdir global escapedobjdir - global escapedsrcdir + global envirodir # Add to the path, display, then reset # Tests: @@ -221,13 +220,14 @@ proc test_path_specification {} { } set orig_path [string_to_regexp ${orig_path}] + set pathdir [string_to_regexp ${objdir}/${subdir}] mi_gdb_test "207-environment-path" \ "207\\\^done,path=\"$orig_path\"" \ "environment-path no-args operation" - mi_gdb_test "208-environment-path $srcdir $objdir" \ - "208\\\^done,path=\"$escapedsrcdir.$escapedobjdir.$orig_path\"" \ + mi_gdb_test "208-environment-path $objdir ${objdir}/${subdir}" \ + "208\\\^done,path=\"$escapedobjdir.${envirodir}.$orig_path\"" \ "environment-path dir1 dir2 operation" mi_gdb_test "209-environment-path -r $objdir" \ diff --git a/gdb/testsuite/gdb.mi/mi2-basics.exp b/gdb/testsuite/gdb.mi/mi2-basics.exp index 824ee428ca9..9075029cf53 100644 --- a/gdb/testsuite/gdb.mi/mi2-basics.exp +++ b/gdb/testsuite/gdb.mi/mi2-basics.exp @@ -42,7 +42,7 @@ set testfile "basics" set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} set escapedobjdir [string_to_regexp ${objdir}] -set escapedsrcdir [string_to_regexp ${srcdir}] +set envirodir [string_to_regexp ${objdir}/${subdir}] if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } { untested mi2-basics.exp @@ -150,8 +150,9 @@ proc test_breakpoints_deletion {} { proc test_dir_specification {} { global mi_gdb_prompt - global srcdir + global objdir global subdir + global envirodir # Add to the search directories, display, then reset back to default # Tests: @@ -159,9 +160,7 @@ proc test_dir_specification {} { # -environment-directory # -environment-directory -r - set envirodir [string_to_regexp ${srcdir}/${subdir}] - - mi_gdb_test "202-environment-directory ${srcdir}/${subdir}" \ + mi_gdb_test "202-environment-directory ${objdir}/${subdir}" \ "202\\\^done,source-path=\"${envirodir}.\\\$cdir.\\\$cwd\"" \ "environment-directory arg operation" @@ -200,9 +199,9 @@ proc test_path_specification {} { global mi_gdb_prompt global orig_path global objdir - global srcdir + global subdir global escapedobjdir - global escapedsrcdir + global envirodir # Add to the path, display, then reset # Tests: @@ -223,13 +222,14 @@ proc test_path_specification {} { } set orig_path [string_to_regexp ${orig_path}] + set pathdir [string_to_regexp ${objdir}/${subdir}] mi_gdb_test "207-environment-path" \ "207\\\^done,path=\"$orig_path\"" \ "environment-path no-args operation" - mi_gdb_test "208-environment-path $srcdir $objdir" \ - "208\\\^done,path=\"$escapedsrcdir.$escapedobjdir.$orig_path\"" \ + mi_gdb_test "208-environment-path $objdir ${objdir}/${subdir}" \ + "208\\\^done,path=\"$escapedobjdir.${envirodir}.$orig_path\"" \ "environment-path dir1 dir2 operation" mi_gdb_test "209-environment-path -r $objdir" \ -- 2.30.2