]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Error out on clean_restart <absolute filename>
authorTom de Vries <tdevries@suse.de>
Sun, 7 Sep 2025 09:53:30 +0000 (11:53 +0200)
committerTom de Vries <tdevries@suse.de>
Sun, 7 Sep 2025 09:53:30 +0000 (11:53 +0200)
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
gdb/testsuite/lib/mi-support.exp

index 7a3ea8d964456c0316dea8ce0226faae9bbf7bb8..a8524bc703da66b7ac099716e1d412eb6ff9aa20 100644 (file)
@@ -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}]
     }
index aba13a272b4368fe523b12fccfd906b783b16b3f..a3ae648c63ba3a09f5f7bfd684d2d2094d93b672 100644 (file)
@@ -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}]
     }