[gdb/testsuite] Fix DUPLICATE in gdb.base/load-command.exp
authorTom de Vries <tdevries@suse.de>
Fri, 24 Sep 2021 10:39:14 +0000 (12:39 +0200)
committerTom de Vries <tdevries@suse.de>
Fri, 24 Sep 2021 10:39:14 +0000 (12:39 +0200)
Fix this duplicate:
...
DUPLICATE: gdb.base/load-command.exp: check initial value of the_variable
...
by using with_test_prefix.

Tested on x86_64-linux.

gdb/testsuite/gdb.base/load-command.exp

index 8847aff3b747acc2340a0e9707adcbee83141ec9..944dc39c155a28b0594c897369f22f8b517dbc7e 100644 (file)
@@ -42,8 +42,12 @@ gdb_test "print/x the_variable" " = 0x1234" "check initial value of the_variable
 gdb_test_no_output "set the_variable = 0x5555" "manually change the_variable"
 gdb_test "print/x the_variable" " = 0x5555" "check manually changed value of the_variable"
 
-# Re-load the binary using the load command.
-gdb_test "load ${binfile}" ".*Loading section .data.*Transfer rate:.*" "re-load binary"
-
-# Re-loading the binary should have reset the variable value.
-gdb_test "print/x the_variable" " = 0x1234" "check initial value of the_variable"
+with_test_prefix "reload" {
+    # Re-load the binary using the load command.
+    gdb_test "load ${binfile}" ".*Loading section .data.*Transfer rate:.*" \
+       "re-load binary"
+
+    # Re-loading the binary should have reset the variable value.
+    gdb_test "print/x the_variable" " = 0x1234" \
+       "check initial value of the_variable"
+}