]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/testsuite: remove spurious $ in save_vars
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 15 Jan 2024 16:23:42 +0000 (16:23 +0000)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 15 Jan 2024 19:08:06 +0000 (14:08 -0500)
I noticed that running the whole testsuite in serial mode (which means
all the .exp files are ran in the same TCL environment, one after the
other) with the native-extended-gdbserver board caused some weird
failures, for instance a lot of internal errors in the reverse tests,
like:

    continue^M
    Continuing.^M
    /home/jenkins/workspace/binutils-gdb_master_linuxbuild/platform/deb12-amd64/target_board/native-extended-gdbserver/src/binutils-gdb/gdb/remot        e.c:6922: internal-error: resume: Assertion `scope_ptid == inferior_ptid' failed.^M
    A problem internal to GDB has been detected,^M
    further debugging may prove unreliable.^M
    ----- Backtrace -----^M
    FAIL: gdb.reverse/break-precsave.exp: run to end of main (GDB internal error)

This only happens after running gdb.multi/attach-while-running.exp.
That test does not restore GDBFLAGS properly when it's done, it leaves
`-ex \"maint set target-non-stop on\""` in there, which breaks some
subsequent tests.  The problem is that this line:

    save_vars { $::GDBFLAGS } {

should not use a `$` before the variable name.  Passes the content of
`::GDBFLAGS` to save_vars, which is not what we want.  We want to pass
the `::GDBFLAGS` string.  Fix that.

Change-Id: I5ad32c527795fd10d0d94020e4fd15cebaca3a77

gdb/testsuite/gdb.multi/attach-while-running.exp

index c0201418de652fb095686d379d2f8174d0256a90..eade8b42a18ee418e851db1aeb47a985e5b34fba 100644 (file)
@@ -43,7 +43,7 @@ if { [build_executable "failed to prepare" ${testfile} ${srcfile}] } {
 }
 
 proc do_test {} {
-    save_vars { $::GDBFLAGS } {
+    save_vars { ::GDBFLAGS } {
        append ::GDBFLAGS " -ex \"maint set target-non-stop on\""
        clean_restart $::binfile
     }