From: Tom de Vries Date: Sun, 7 Sep 2025 09:53:30 +0000 (+0200) Subject: [gdb/testsuite] Error out on clean_restart X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cba778b944af90c362a618af0630877736a54baa;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite] Error out on clean_restart Error out in proc clean_restart if the argument is an absolute filename. Likewise in proc mi_clean_restart. Tested on x86_64-linux. --- diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 7a3ea8d9644..a8524bc703d 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -9355,6 +9355,10 @@ proc clean_restart {{executable ""}} { gdb_reinitialize_dir $srcdir/$subdir if {$executable != ""} { + if { [file pathtype $executable] == "absolute" } { + error "absolute path used" + } + set binfile [standard_output_file ${executable}] return [gdb_load ${binfile}] } diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index aba13a272b4..a3ae648c63b 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -1044,6 +1044,9 @@ proc mi_clean_restart {{executable ""} {flags {}}} { mi_gdb_reinitialize_dir $srcdir/$subdir if {$executable != ""} { + if { [file pathtype $executable] == "absolute" } { + error "absolute path used" + } set binfile [standard_output_file ${executable}] return [mi_gdb_load ${binfile}] }