gdb: use foreach_with_prefix in gdb.base/break-interp.exp

Use foreach_with_prefix, instead of foreach and with_test_prefix
separately.  Since allows removing some indentation levels, and formats
the test names a bit nicer, in my opinion (or at least, it's more
consistent with the rest of the testsuite):

    - PASS: gdb.base/break-interp.exp: LDprelinkNOdebugNO: BINprelinkNOdebugNOpieNO: INNER: core: set verbose on
    + PASS: gdb.base/break-interp.exp: ldprelink=NO: ldsepdebug=NO: binprelink=NO: binsepdebug=NO: binpie=NO: INNER: set verbose on

Note: this patch is better viewed with "git show -w" to ignore
whitespace changes.

gdb/testsuite/ChangeLog:

	* gdb.base/break-interp.exp: Use foreach_with_prefix.
This commit is contained in:
Simon Marchi
2020-03-12 14:34:22 -04:00
parent 40310f30a5
commit 3f512721a8
2 changed files with 142 additions and 142 deletions

View File

@ -1,3 +1,7 @@
2020-03-12 Simon Marchi <simon.marchi@efficios.com>
* gdb.base/break-interp.exp: Use foreach_with_prefix.
2020-03-12 Simon Marchi <simon.marchi@efficios.com> 2020-03-12 Simon Marchi <simon.marchi@efficios.com>
* gdb.arch/amd64-disp-step-avx.S: Add nops after _start. * gdb.arch/amd64-disp-step-avx.S: Add nops after _start.

View File

@ -538,8 +538,8 @@ proc test_ld {file ifmain trynosym displacement} {
# Create separate binaries for each testcase - to make the possible reported # Create separate binaries for each testcase - to make the possible reported
# problem reproducible after the whole test run finishes. # problem reproducible after the whole test run finishes.
foreach ldprelink {NO YES} { foreach_with_prefix ldprelink {NO YES} {
foreach ldsepdebug {NO IN SEP} { foreach_with_prefix ldsepdebug {NO IN SEP} {
# Skip running the ldsepdebug test if we do not have system separate # Skip running the ldsepdebug test if we do not have system separate
# debug info available. # debug info available.
if {$interp_system_debug == "" && $ldsepdebug == "SEP"} { if {$interp_system_debug == "" && $ldsepdebug == "SEP"} {
@ -562,7 +562,6 @@ foreach ldprelink {NO YES} {
# possibly unprelinked ld.so to test all the combinations for GDB. # possibly unprelinked ld.so to test all the combinations for GDB.
set interp_saved ${interp}-saved set interp_saved ${interp}-saved
with_test_prefix "$ldname" {
if {$ldsepdebug == "NO"} { if {$ldsepdebug == "NO"} {
file_copy $interp_system $interp file_copy $interp_system $interp
# Never call strip-debug before unprelink: # Never call strip-debug before unprelink:
@ -629,12 +628,12 @@ foreach ldprelink {NO YES} {
continue continue
} }
foreach binprelink {NO YES} { foreach_with_prefix binprelink {NO YES} {
foreach binsepdebug {NO IN SEP} { foreach_with_prefix binsepdebug {NO IN SEP} {
# "ATTACH" is like "YES" but it is modified during # "ATTACH" is like "YES" but it is modified during
# run. It cannot be used for problem # run. It cannot be used for problem
# reproducibility after the testcase ends. # reproducibility after the testcase ends.
foreach binpie {NO YES ATTACH} { foreach_with_prefix binpie {NO YES ATTACH} {
# This combination is not possible, non-PIE (fixed address) # This combination is not possible, non-PIE (fixed address)
# binary cannot be prelinked to any (other) address. # binary cannot be prelinked to any (other) address.
if {$binprelink == "YES" && $binpie == "NO"} { if {$binprelink == "YES" && $binpie == "NO"} {
@ -644,7 +643,6 @@ foreach ldprelink {NO YES} {
set binname "BINprelink${binprelink}debug${binsepdebug}pie${binpie}" set binname "BINprelink${binprelink}debug${binsepdebug}pie${binpie}"
set exec $binprefix-$binname set exec $binprefix-$binname
with_test_prefix "$binname" {
set opts "ldflags=-Wl,$binfile_lib,-rpath,[file dirname $binfile_lib]" set opts "ldflags=-Wl,$binfile_lib,-rpath,[file dirname $binfile_lib]"
if {$binsepdebug != "NO"} { if {$binsepdebug != "NO"} {
lappend opts {debug} lappend opts {debug}
@ -717,9 +715,7 @@ foreach ldprelink {NO YES} {
} }
} }
} }
}
file delete $interp_saved file delete $interp_saved
} }
} }
}