diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2022-04-22 09:16:59 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2022-04-26 20:16:03 -0400 |
commit | 019a5c62974523a3331911130c66350ef0a6f3c4 (patch) | |
tree | cf2f44ec018c1957bff0c335820a0b87c0479715 /gdb/testsuite/gdb.base/fullname.exp | |
parent | 2538fcd3f4b6807f48de20982a2d9c584d98912b (diff) | |
download | gdb-019a5c62974523a3331911130c66350ef0a6f3c4.zip gdb-019a5c62974523a3331911130c66350ef0a6f3c4.tar.gz gdb-019a5c62974523a3331911130c66350ef0a6f3c4.tar.bz2 |
gdb/testsuite: use with_cwd where possible
I learned about with_cwd today. I spotted a few spots that could use
it, to make the code more robust.
Change-Id: Ia23664cb827f25e79d31948e0c006a8dc61c33e1
Diffstat (limited to 'gdb/testsuite/gdb.base/fullname.exp')
-rw-r--r-- | gdb/testsuite/gdb.base/fullname.exp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/gdb/testsuite/gdb.base/fullname.exp b/gdb/testsuite/gdb.base/fullname.exp index a264dc7..f9faca8 100644 --- a/gdb/testsuite/gdb.base/fullname.exp +++ b/gdb/testsuite/gdb.base/fullname.exp @@ -99,14 +99,12 @@ if { [gdb_breakpoint [standard_output_file tmp-${srcfile}]:${line} {no-message}] # Build the test executable using relative paths not relative to the directory # we'll run GDB from. -set save_pwd [pwd] -cd [standard_output_file {}] -if { [gdb_compile [standard_output_file tmp-${srcfile}] "${testfile}" \ - executable {debug}] != "" } { - cd $save_pwd - return -1 +with_cwd [standard_output_file {}] { + if { [gdb_compile [standard_output_file tmp-${srcfile}] "${testfile}" \ + executable {debug}] != "" } { + return -1 + } } -cd $save_pwd gdb_exit gdb_start |