gdb/testsuite: Remove duplicates from gdb.base/interp.exp
authorLancelot SIX <lsix@lancelotsix.com>
Fri, 19 Nov 2021 19:55:05 +0000 (19:55 +0000)
committerLancelot SIX <lsix@lancelotsix.com>
Fri, 7 Jan 2022 22:43:32 +0000 (22:43 +0000)
commit27e9a99fa02b635f5a89358c196fbf8f1670c6d7
tree914fc931e3a94cb47c5015608fad8441885089e1
parentaaff91fdf209a03c91a59681ca187c92d94826b8
gdb/testsuite: Remove duplicates from gdb.base/interp.exp

When running the testsuite I have:

    Running .../gdb/testsuite/gdb.base/interp.exp ...
    DUPLICATE: gdb.base/interp.exp: interpreter-exec mi "-var-update *"

This is due to the fact that multiple successive instances of
gdb_test_multiple use 'pass $cmd', but one of them forgets to reset $cmd
to a new test name.

Fix by using 'pass $gdb_test_name', given that the gdb_test_name is set
by gdb_test_multiple.

While fixing this, this patch refactors all occurrences of the following
pattern:

    set cmd foo
    gdb_test_multiple $cmd $cmd {
        -re ... {
            pass $cmd
        }
    }

into

    gdb_test_multiple foo "" {
        -re ... {
            pass $gdb_test_name
         }
    }

This makes this test file coherent in its use of $gdb_test_name.

Tested on x86_64-linux.
gdb/testsuite/gdb.base/interp.exp