From cba778b944af90c362a618af0630877736a54baa Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Sun, 7 Sep 2025 11:53:30 +0200 Subject: [PATCH] [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. --- gdb/testsuite/lib/gdb.exp | 4 ++++ gdb/testsuite/lib/mi-support.exp | 3 +++ 2 files changed, 7 insertions(+) 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}] } -- 2.47.3