From 41f14dc86235e2685ee863e0b979309cdcaa6f72 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 15 Apr 2021 14:45:47 -0400 Subject: gdb/testsuite: use foreach_with_prefix in gdb.threads/fork-plus-threads.exp I noticed that using foreach_with_prefix could make things a bit less verbose. No changes in behavior expected. gdb/testsuite/ChangeLog: * gdb.threads/fork-plus-threads.exp: Use foreach_with_prefix. Change-Id: I06aa6e3d10a9cfb6ada11547aefe8c70b636ac81 --- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.threads/fork-plus-threads.exp | 10 ++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index d1b6f5c..9de1a44 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2021-04-15 Simon Marchi + + * gdb.threads/fork-plus-threads.exp: Use foreach_with_prefix. + 2021-04-15 Tom Tromey * gdb.dwarf2/arr-stride.exp: Add test. diff --git a/gdb/testsuite/gdb.threads/fork-plus-threads.exp b/gdb/testsuite/gdb.threads/fork-plus-threads.exp index 1750261..f5cfb27 100644 --- a/gdb/testsuite/gdb.threads/fork-plus-threads.exp +++ b/gdb/testsuite/gdb.threads/fork-plus-threads.exp @@ -29,7 +29,7 @@ if { [target_info exists gdb_protocol] standard_testfile -proc do_test { detach_on_fork } { +proc do_test { detach-on-fork } { global GDBFLAGS global srcfile testfile global gdb_prompt @@ -50,7 +50,7 @@ proc do_test { detach_on_fork } { return 0 } - gdb_test_no_output "set detach-on-fork $detach_on_fork" + gdb_test_no_output "set detach-on-fork ${detach-on-fork}" set test "continue &" gdb_test_multiple $test $test { -re "$gdb_prompt " { @@ -113,8 +113,6 @@ proc do_test { detach_on_fork } { "only inferior 1 left" } -foreach detach_on_fork {"on" "off"} { - with_test_prefix "detach-on-fork=$detach_on_fork" { - do_test $detach_on_fork - } +foreach_with_prefix detach-on-fork {"on" "off"} { + do_test ${detach-on-fork} } -- cgit v1.1