Re: testsuite: prefix handling

Pedro Alves
2012-02-21T20:46:07Z

On 02/21/2012 06:37 PM, Pedro Alves wrote:
>> > Pedro> - altivec_abi_tests "additional_flags=-maltivec" "auto"
>> > Pedro> + altivec_abi_tests " default ABI, auto:" "additional_flags=-maltivec" "auto"
>> >
>> > It would be both prettier and better encapsulation if with_test_prefix
>> > supplied the space.
> Thing is I stumbled on tests that don't currently output a space. So I'm not
> sure we should always require spaces. Changing those would make this patch
> not an identity patch -- it'd produce different gdb.sum output compared to
> the current mainline. I can try making with_test_prefix always add the space
> instead as follow up, and see which tests are those, and if we'd get something
> non-sensical. Probably not.

Eh, I did this, and the only test that changed output in either
a native or gdbserver run was catch-load.exp. :-)

I'm also wondering if with_test_prefix should supply the `:'. gdb.trace/strace.exp
seems to be the only test that doesn't append `:', but looking at it, it
probably should. We could add a with_raw_test_prefix or something like
that that doesn't add neither the space nor the `:' if necessary.

--
Pedro Alves
gdb/testsuite/gdb.arch/altivec-abi.exp | 30 ++++++++++++--------
gdb/testsuite/gdb.base/attach-pie-misread.exp | 2 +
gdb/testsuite/gdb.base/break-interp.exp | 6 ++--
gdb/testsuite/gdb.base/disp-step-syscall.exp | 2 +
gdb/testsuite/gdb.base/jit-so.exp | 2 +
gdb/testsuite/gdb.base/jit.exp | 2 +
gdb/testsuite/gdb.base/sepdebug.exp | 2 +
gdb/testsuite/gdb.base/solib-display.exp | 2 +
gdb/testsuite/gdb.base/solib-overlap.exp | 2 +
gdb/testsuite/gdb.base/watch-cond-infcall.exp | 4 +--
gdb/testsuite/gdb.base/watchpoint.exp | 2 +
gdb/testsuite/gdb.dwarf2/dw2-noloc.exp | 2 +
gdb/testsuite/gdb.mi/mi-watch.exp | 2 +
gdb/testsuite/gdb.mi/mi2-watch.exp | 2 +
gdb/testsuite/gdb.threads/non-ldr-exc-1.exp | 2 +
gdb/testsuite/gdb.threads/non-ldr-exc-2.exp | 2 +
gdb/testsuite/gdb.threads/non-ldr-exc-3.exp | 2 +
gdb/testsuite/gdb.threads/non-ldr-exc-4.exp | 2 +
gdb/testsuite/gdb.threads/watchpoint-fork.exp | 2 +
gdb/testsuite/gdb.threads/watchthreads-reorder.exp | 2 +
gdb/testsuite/gdb.trace/change-loc.exp | 4 +--
gdb/testsuite/gdb.trace/pending.exp | 14 +++++----
gdb/testsuite/gdb.trace/status-stop.exp | 6 ++--
gdb/testsuite/gdb.trace/strace.exp | 8 +++--
gdb/testsuite/gdb.trace/trace-break.exp | 12 ++++----
gdb/testsuite/gdb.trace/unavailable.exp | 8 +++--
gdb/testsuite/lib/gdb.exp | 13 +++++----
27 files changed, 73 insertions(+), 66 deletions(-)

diff --git a/gdb/testsuite/gdb.arch/altivec-abi.exp b/gdb/testsuite/gdb.arch/altivec-abi.exp
index fd069b2..fa102fb 100644
--- a/gdb/testsuite/gdb.arch/altivec-abi.exp
+++ b/gdb/testsuite/gdb.arch/altivec-abi.exp
@@ -36,7 +36,7 @@ if [get_compiler_info $binfile] {
return -1
}

-proc altivec_abi_tests { prefix extra_flags force_abi } { with_test_prefix $prefix {
+proc altivec_abi_tests { prefix extra_flags force_abi } {
global testfile binfile srcfile srcdir subdir
global gdb_prompt

@@ -144,10 +144,12 @@ proc altivec_abi_tests { prefix extra_flags force_abi } { with_test_prefix $pref
gdb_test "p matrix\[1\]" ".*= .11, 12, 13, 14, 15, 16, 17, 18." "print second vector"
gdb_test "p matrix\[2\]" ".*= .21, 22, 23, 24, 25, 26, 27, 28." "print third vector"
gdb_test "p matrix\[3\]" ".*= .31, 32, 33, 34, 35, 36, 37, 38." "print fourth vector"
-}}
+}

if [test_compiler_info gcc*] {
- altivec_abi_tests " default ABI, auto:" "additional_flags=-maltivec" "auto"
+ with_test_prefix "default ABI, auto:" {
+ altivec_abi_tests "additional_flags=-maltivec" "auto"
+ }

# On GNU/Linux, we can mix -mabi=no-altivec and -mabi=altivec.
# So test some combinations.
@@ -156,24 +158,28 @@ if [test_compiler_info gcc*] {
# was broken, so skip those tests there.
if { ![is_lp64_target] || ![test_compiler_info "gcc-4-\[12\]-*"] } {
set binfile ${objdir}/${subdir}/${testfile}-ge-ge
- altivec_abi_tests " generic ABI, forced:" \
- "additional_flags=-maltivec additional_flags=-mabi=no-altivec" "generic"
+ with_test_prefix "generic ABI, forced:" {
+ altivec_abi_tests "additional_flags=-maltivec additional_flags=-mabi=no-altivec" "generic"
+ }

set binfile ${objdir}/${subdir}/${testfile}-ge-auto
- altivec_abi_tests " generic ABI, auto:" \
- "additional_flags=-maltivec additional_flags=-mabi=no-altivec" "auto"
+ with_test_prefix "generic ABI, auto:" {
+ altivec_abi_tests "additional_flags=-maltivec additional_flags=-mabi=no-altivec" "auto"
+ }
}

set binfile ${objdir}/${subdir}/${testfile}-av-av
- altivec_abi_tests " AltiVec ABI, forced:" \
- "additional_flags=-maltivec additional_flags=-mabi=altivec" "altivec"
+ with_test_prefix "AltiVec ABI, forced:" {
+ altivec_abi_tests "additional_flags=-maltivec additional_flags=-mabi=altivec" "altivec"
+ }

set binfile ${objdir}/${subdir}/${testfile}-av-auto
- altivec_abi_tests " AltiVec ABI, auto:" \
- "additional_flags=-maltivec additional_flags=-mabi=altivec" "auto"
+ with_test_prefix "AltiVec ABI, auto:" {
+ altivec_abi_tests "additional_flags=-maltivec additional_flags=-mabi=altivec" "auto"
+ }
}
} elseif [test_compiler_info xlc*] {
- altivec_abi_tests "" "additional_flags=-qaltivec" "auto"
+ altivec_abi_tests "additional_flags=-qaltivec" "auto"
} else {
warning "unknown compiler"
return -1
diff --git a/gdb/testsuite/gdb.base/attach-pie-misread.exp b/gdb/testsuite/gdb.base/attach-pie-misread.exp
index de1055e..fbfb726 100644
--- a/gdb/testsuite/gdb.base/attach-pie-misread.exp
+++ b/gdb/testsuite/gdb.base/attach-pie-misread.exp
@@ -152,7 +152,7 @@ gdb_expect {
}

# Due to alignments it was reproducible with 1 on x86_64 but 2 on i686.
-foreach align_mult {1 2} { with_test_prefix " shift-by-$align_mult:" {
+foreach align_mult {1 2} { with_test_prefix "shift-by-$align_mult:" {

# FIXME: We believe there is enough room under FIRST_OFFSET.
set shifted_offset [format 0x%x [expr "$first_offset - $align_mult * $align_max"]]
diff --git a/gdb/testsuite/gdb.base/break-interp.exp b/gdb/testsuite/gdb.base/break-interp.exp
index d6267ac..844916a 100644
--- a/gdb/testsuite/gdb.base/break-interp.exp
+++ b/gdb/testsuite/gdb.base/break-interp.exp
@@ -185,12 +185,12 @@ proc reach_1 {func command displacement} {
# displacement of 0 bytes to be present, "NONZERO" for displacement of non-0
# bytes to be present and "PRESENT" if both "ZERO" and "NONZERO" are valid.
proc reach {func command displacement} {
- with_test_prefix " reach-$func:" {
+ with_test_prefix "reach-$func:" {
reach_1 $func $command $displacement
}
}

-proc test_core {file displacement} { with_test_prefix " core:" {
+proc test_core {file displacement} { with_test_prefix "core:" {
global srcdir subdir gdb_prompt expect_out

set corefile [core_find $file {} "segv"]
@@ -239,7 +239,7 @@ proc test_core {file displacement} { with_test_prefix " core:" {
gdb_test "bt" "#\[0-9\]+ +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#\[0-9\]+ +\[^\r\n\]*\\mmain\\M.*" "core main bt"
}}

-proc test_attach_gdb {file pid displacement prefix} { with_test_prefix " $prefix:" {
+proc test_attach_gdb {file pid displacement prefix} { with_test_prefix "$prefix:" {
global gdb_prompt expect_out

gdb_exit
diff --git a/gdb/testsuite/gdb.base/disp-step-syscall.exp b/gdb/testsuite/gdb.base/disp-step-syscall.exp
index 61de211..06df05d 100644
--- a/gdb/testsuite/gdb.base/disp-step-syscall.exp
+++ b/gdb/testsuite/gdb.base/disp-step-syscall.exp
@@ -30,7 +30,7 @@ if { [istarget "i\[34567\]86-*-linux*"] || [istarget "x86_64-*-linux*"] } {
return -1
}

-proc disp_step_cross_syscall { syscall } { with_test_prefix " $syscall:" {
+proc disp_step_cross_syscall { syscall } { with_test_prefix "$syscall:" {
global syscall_insn
global gdb_prompt

diff --git a/gdb/testsuite/gdb.base/jit-so.exp b/gdb/testsuite/gdb.base/jit-so.exp
index b595774..77006ee 100644
--- a/gdb/testsuite/gdb.base/jit-so.exp
+++ b/gdb/testsuite/gdb.base/jit-so.exp
@@ -63,7 +63,7 @@ if { [gdb_compile_shlib ${solib_srcfile} ${solib_binfile} {}] != "" } {

set solib_binfile_target [gdb_download ${solib_binfile}]

-proc one_jit_test {count match_str} { with_test_prefix " one_jit_test-$count:" {
+proc one_jit_test {count match_str} { with_test_prefix "one_jit_test-$count:" {
global verbose testfile srcfile2 binfile2 binfile2_dlopen solib_binfile_target solib_binfile_test_msg

clean_restart $testfile
diff --git a/gdb/testsuite/gdb.base/jit.exp b/gdb/testsuite/gdb.base/jit.exp
index 4b8059f..fa100ca 100644
--- a/gdb/testsuite/gdb.base/jit.exp
+++ b/gdb/testsuite/gdb.base/jit.exp
@@ -51,7 +51,7 @@ if { [gdb_compile_shlib ${solib_srcfile} ${solib_binfile} {-fPIC}] != "" } {

set solib_binfile_target [gdb_download ${solib_binfile}]

-proc one_jit_test {count match_str} { with_test_prefix " one_jit_test-$count:" {
+proc one_jit_test {count match_str} { with_test_prefix "one_jit_test-$count:" {
global verbose testfile solib_binfile_target solib_binfile_test_msg

clean_restart $testfile
diff --git a/gdb/testsuite/gdb.base/sepdebug.exp b/gdb/testsuite/gdb.base/sepdebug.exp
index cb1bd00..937edc1 100644
--- a/gdb/testsuite/gdb.base/sepdebug.exp
+++ b/gdb/testsuite/gdb.base/sepdebug.exp
@@ -650,7 +650,7 @@ test_next_with_recursion

#********

-proc test_different_dir {type test_different_dir xfail} { with_test_prefix " $type:" {
+proc test_different_dir {type test_different_dir xfail} { with_test_prefix "$type:" {
global srcdir subdir objdir binfile srcfile timeout gdb_prompt
global bp_location6 decimal hex

diff --git a/gdb/testsuite/gdb.base/solib-display.exp b/gdb/testsuite/gdb.base/solib-display.exp
index 6886e04..d6cbc23 100644
--- a/gdb/testsuite/gdb.base/solib-display.exp
+++ b/gdb/testsuite/gdb.base/solib-display.exp
@@ -49,7 +49,7 @@ if [get_compiler_info ${binfile}] {
}

# SEP must be last for the possible `unsupported' error path.
-foreach libsepdebug {NO IN SEP} { with_test_prefix " $libsepdebug:" {
+foreach libsepdebug {NO IN SEP} { with_test_prefix "$libsepdebug:" {

set sep_lib_flags $lib_flags
if {$libsepdebug != "NO"} {
diff --git a/gdb/testsuite/gdb.base/solib-overlap.exp b/gdb/testsuite/gdb.base/solib-overlap.exp
index 048e6cf..cce9d77 100644
--- a/gdb/testsuite/gdb.base/solib-overlap.exp
+++ b/gdb/testsuite/gdb.base/solib-overlap.exp
@@ -52,7 +52,7 @@ set srcfile ${srcdir}/${subdir}/${testfile}.c
# false PASS.
# Prelink first lib1 at 0x40000000 and lib2 at 0x41000000.
# During second pass try lib1 at 0x50000000 and lib2 at 0x51000000.
-foreach prelink_lib1 {0x40000000 0x50000000} { with_test_prefix " $prelink_lib1:" {
+foreach prelink_lib1 {0x40000000 0x50000000} { with_test_prefix "$prelink_lib1:" {
set prelink_lib2 [format "0x%x" [expr $prelink_lib1 + 0x01000000]]

# Library file.
diff --git a/gdb/testsuite/gdb.base/watch-cond-infcall.exp b/gdb/testsuite/gdb.base/watch-cond-infcall.exp
index 383ce89..30f93bf 100644
--- a/gdb/testsuite/gdb.base/watch-cond-infcall.exp
+++ b/gdb/testsuite/gdb.base/watch-cond-infcall.exp
@@ -49,7 +49,7 @@ proc test_watchpoint { hw } {
}

if { ![target_info exists gdb,no_hardware_watchpoints] } {
- with_test_prefix " hw:" { test_watchpoint 1 }
+ with_test_prefix "hw:" { test_watchpoint 1 }
}

-with_test_prefix " sw:" { test_watchpoint 0 }
+with_test_prefix "sw:" { test_watchpoint 0 }
diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp
index 7a252bb..66ccdf6 100644
--- a/gdb/testsuite/gdb.base/watchpoint.exp
+++ b/gdb/testsuite/gdb.base/watchpoint.exp
@@ -894,7 +894,7 @@ proc do_tests {} {

do_tests
if ![target_info exists gdb,no_hardware_watchpoints] {
- with_test_prefix " no-hw:" {
+ with_test_prefix "no-hw:" {
set no_hw 1
do_tests
}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-noloc.exp b/gdb/testsuite/gdb.dwarf2/dw2-noloc.exp
index ecb99ef..dd14948 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-noloc.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-noloc.exp
@@ -33,7 +33,7 @@ if { [prepare_for_testing dw2-noloc.exp "dw2-noloc" {dw2-noloc-main.c dw2-noloc.
# unresolvable: .symtab entry does not exist for this symbol name.
# DW_AT_declaration is not present in any of these DIEs.

-proc file_symbols {type} { with_test_prefix " $type:" {
+proc file_symbols {type} { with_test_prefix "$type:" {

global gdb_prompt

diff --git a/gdb/testsuite/gdb.mi/mi-watch.exp b/gdb/testsuite/gdb.mi/mi-watch.exp
index 972fdb2..87113a3 100644
--- a/gdb/testsuite/gdb.mi/mi-watch.exp
+++ b/gdb/testsuite/gdb.mi/mi-watch.exp
@@ -147,7 +147,7 @@ proc test_watchpoint_triggering {type} {
clear_xfail *-*-*
}

-proc test_watchpoint_all {type} { with_test_prefix " $type:" {
+proc test_watchpoint_all {type} { with_test_prefix "$type:" {
upvar srcdir srcdir
upvar subdir subdir
upvar binfile binfile
diff --git a/gdb/testsuite/gdb.mi/mi2-watch.exp b/gdb/testsuite/gdb.mi/mi2-watch.exp
index 37a919f..64228dc 100644
--- a/gdb/testsuite/gdb.mi/mi2-watch.exp
+++ b/gdb/testsuite/gdb.mi/mi2-watch.exp
@@ -146,7 +146,7 @@ proc test_watchpoint_triggering {type} {
clear_xfail *-*-*
}

-proc test_watchpoint_all {type} { with_test_prefix " $type:" {
+proc test_watchpoint_all {type} { with_test_prefix "$type:" {
upvar srcdir srcdir
upvar subdir subdir
upvar binfile binfile
diff --git a/gdb/testsuite/gdb.threads/non-ldr-exc-1.exp b/gdb/testsuite/gdb.threads/non-ldr-exc-1.exp
index c6ced8e..c913ab2 100644
--- a/gdb/testsuite/gdb.threads/non-ldr-exc-1.exp
+++ b/gdb/testsuite/gdb.threads/non-ldr-exc-1.exp
@@ -30,7 +30,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
return -1
}

-proc do_test { lock_sched } { with_test_prefix " lock-sched$lock_sched:" {
+proc do_test { lock_sched } { with_test_prefix "lock-sched$lock_sched:" {
global executable

clean_restart ${executable}
diff --git a/gdb/testsuite/gdb.threads/non-ldr-exc-2.exp b/gdb/testsuite/gdb.threads/non-ldr-exc-2.exp
index 66f090a..e524072 100644
--- a/gdb/testsuite/gdb.threads/non-ldr-exc-2.exp
+++ b/gdb/testsuite/gdb.threads/non-ldr-exc-2.exp
@@ -31,7 +31,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
return -1
}

-proc do_test { lock_sched } { with_test_prefix " lock-sched$lock_sched:" {
+proc do_test { lock_sched } { with_test_prefix "lock-sched$lock_sched:" {
global executable

clean_restart ${executable}
diff --git a/gdb/testsuite/gdb.threads/non-ldr-exc-3.exp b/gdb/testsuite/gdb.threads/non-ldr-exc-3.exp
index 83d243f..c0e79bd 100644
--- a/gdb/testsuite/gdb.threads/non-ldr-exc-3.exp
+++ b/gdb/testsuite/gdb.threads/non-ldr-exc-3.exp
@@ -33,7 +33,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
return -1
}

-proc do_test { lock_sched } { with_test_prefix " lock-sched$lock_sched:" {
+proc do_test { lock_sched } { with_test_prefix "lock-sched$lock_sched:" {
global executable

clean_restart ${executable}
diff --git a/gdb/testsuite/gdb.threads/non-ldr-exc-4.exp b/gdb/testsuite/gdb.threads/non-ldr-exc-4.exp
index 7fce0ef..0aa47f9 100644
--- a/gdb/testsuite/gdb.threads/non-ldr-exc-4.exp
+++ b/gdb/testsuite/gdb.threads/non-ldr-exc-4.exp
@@ -32,7 +32,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executab
return -1
}

-proc do_test { lock_sched } { with_test_prefix " lock-sched$lock_sched:" {
+proc do_test { lock_sched } { with_test_prefix "lock-sched$lock_sched:" {
global executable

clean_restart ${executable}
diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork.exp b/gdb/testsuite/gdb.threads/watchpoint-fork.exp
index db05e1f..f0dbfcc 100644
--- a/gdb/testsuite/gdb.threads/watchpoint-fork.exp
+++ b/gdb/testsuite/gdb.threads/watchpoint-fork.exp
@@ -22,7 +22,7 @@ if [is_remote target] {
return
}

-proc test {type symbol} { with_test_prefix " $type:" {
+proc test {type symbol} { with_test_prefix "$type:" {
global testfile objdir subdir srcdir gdb_prompt pf_prefix

set srcfile_type ${srcdir}/${subdir}/${testfile}-${type}.c
diff --git a/gdb/testsuite/gdb.threads/watchthreads-reorder.exp b/gdb/testsuite/gdb.threads/watchthreads-reorder.exp
index ab4cd5f..e00383f 100644
--- a/gdb/testsuite/gdb.threads/watchthreads-reorder.exp
+++ b/gdb/testsuite/gdb.threads/watchthreads-reorder.exp
@@ -38,7 +38,7 @@ if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" ${binfile} executable
return -1
}

-foreach reorder {0 1} { with_test_prefix " reorder$reorder:" {
+foreach reorder {0 1} { with_test_prefix "reorder$reorder:" {

clean_restart $testfile

diff --git a/gdb/testsuite/gdb.trace/change-loc.exp b/gdb/testsuite/gdb.trace/change-loc.exp
index 91cdb11..a97402a 100644
--- a/gdb/testsuite/gdb.trace/change-loc.exp
+++ b/gdb/testsuite/gdb.trace/change-loc.exp
@@ -71,7 +71,7 @@ if [is_amd64_regs_target] {

# Set tracepoint during tracing experiment.

-proc tracepoint_change_loc_1 { trace_type } { with_test_prefix " 1 $trace_type:" {
+proc tracepoint_change_loc_1 { trace_type } { with_test_prefix "1 $trace_type:" {
global testfile
global srcfile
global pcreg
@@ -141,7 +141,7 @@ proc tracepoint_change_loc_1 { trace_type } { with_test_prefix " 1 $trace_type:"

# Set pending tracepoint.

-proc tracepoint_change_loc_2 { trace_type } { with_test_prefix " 2 $trace_type:" {
+proc tracepoint_change_loc_2 { trace_type } { with_test_prefix "2 $trace_type:" {
global srcdir
global srcfile
global subdir
diff --git a/gdb/testsuite/gdb.trace/pending.exp b/gdb/testsuite/gdb.trace/pending.exp
index 7a9d01d..7bfc9e1 100644
--- a/gdb/testsuite/gdb.trace/pending.exp
+++ b/gdb/testsuite/gdb.trace/pending.exp
@@ -60,7 +60,7 @@ if ![gdb_target_supports_trace] {

# Verify pending tracepoint is resolved to running to main.

-proc pending_tracepoint_resolved { trace_type } { with_test_prefix " $trace_type resolved:" {
+proc pending_tracepoint_resolved { trace_type } { with_test_prefix "$trace_type resolved:" {
global srcdir
global subdir
global binfile
@@ -101,7 +101,7 @@ proc pending_tracepoint_resolved { trace_type } { with_test_prefix " $trace_type

# Verify pending tracepoint is resolved and works as expected.

-proc pending_tracepoint_works { trace_type } { with_test_prefix " $trace_type works:" {
+proc pending_tracepoint_works { trace_type } { with_test_prefix "$trace_type works:" {
global executable
global srcfile
global lib_sl1
@@ -155,7 +155,7 @@ proc pending_tracepoint_works { trace_type } { with_test_prefix " $trace_type wo
# Verify pending tracepoint is resolved during trace.

proc pending_tracepoint_resolved_during_trace { trace_type } \
-{ with_test_prefix " $trace_type resolved_in_trace:" \
+{ with_test_prefix "$trace_type resolved_in_trace:" \
{
global executable
global srcfile
@@ -214,7 +214,7 @@ proc pending_tracepoint_resolved_during_trace { trace_type } \
# Verify pending tracepoint is resolved and installed during trace.

proc pending_tracepoint_installed_during_trace { trace_type } \
-{ with_test_prefix " $trace_type installed_in_trace:" \
+{ with_test_prefix "$trace_type installed_in_trace:" \
{
global executable
global srcfile
@@ -279,7 +279,7 @@ proc pending_tracepoint_installed_during_trace { trace_type } \
# Verify pending tracepoint will no longer work if we disconnect during tracing.

proc pending_tracepoint_disconnect_during_trace { trace_type } \
-{ with_test_prefix " $trace_type disconn:" \
+{ with_test_prefix "$trace_type disconn:" \
{
global executable
global srcfile
@@ -327,7 +327,7 @@ proc pending_tracepoint_disconnect_during_trace { trace_type } \
# Verify disconnect after pending tracepoint has been resolved.

proc pending_tracepoint_disconnect_after_resolved { trace_type } \
-{ with_test_prefix " $trace_type disconn_resolved:" \
+{ with_test_prefix "$trace_type disconn_resolved:" \
{
global executable
global srcfile
@@ -379,7 +379,7 @@ proc pending_tracepoint_disconnect_after_resolved { trace_type } \
# Verify action works properly in resolved tracepoint.

proc pending_tracepoint_with_action_resolved { trace_type } \
-{ with_test_prefix " $trace_type action_resolved:" \
+{ with_test_prefix "$trace_type action_resolved:" \
{
global executable
global srcfile
diff --git a/gdb/testsuite/gdb.trace/status-stop.exp b/gdb/testsuite/gdb.trace/status-stop.exp
index 859e9cc..7d1c219 100644
--- a/gdb/testsuite/gdb.trace/status-stop.exp
+++ b/gdb/testsuite/gdb.trace/status-stop.exp
@@ -39,7 +39,7 @@ if ![gdb_target_supports_trace] {

# Verify that the sequence of commands "tstart tstop tstart" works well.

-proc test_tstart_tstop_tstart { } { with_test_prefix " tstart_tstop_tstart:" {
+proc test_tstart_tstop_tstart { } { with_test_prefix "tstart_tstop_tstart:" {
global executable
global hex

@@ -63,7 +63,7 @@ proc test_tstart_tstop_tstart { } { with_test_prefix " tstart_tstop_tstart:" {

# Verify the sequence of commands "tstart tstart" works well.

-proc test_tstart_tstart { } { with_test_prefix " tstart_tstart:" {
+proc test_tstart_tstart { } { with_test_prefix "tstart_tstart:" {
global executable
global hex

@@ -82,7 +82,7 @@ proc test_tstart_tstart { } { with_test_prefix " tstart_tstart:" {

# Verify that trace stops clearly when trace buffer is full.

-proc test_buffer_full_tstart { } { with_test_prefix " buffer_full_tstart:" {
+proc test_buffer_full_tstart { } { with_test_prefix "buffer_full_tstart:" {
global executable
global hex

diff --git a/gdb/testsuite/gdb.trace/strace.exp b/gdb/testsuite/gdb.trace/strace.exp
index 1d955b9..9ceabfb 100644
--- a/gdb/testsuite/gdb.trace/strace.exp
+++ b/gdb/testsuite/gdb.trace/strace.exp
@@ -52,7 +52,7 @@ if { ![gdb_target_supports_trace] } then {

gdb_load_shlibs $libipa

-proc strace_info_marker { } { with_test_prefix " info_marker" {
+proc strace_info_marker { } { with_test_prefix "info_marker" {
global executable

# Restart with a fresh gdb.
@@ -67,7 +67,7 @@ proc strace_info_marker { } { with_test_prefix " info_marker" {
".*ust/bar\[\t \]+n\[\t \]+.*ust/bar2\[\t \]+n\[\t \]+.*"
}}

-proc strace_probe_marker { } { with_test_prefix " probe_marker" {
+proc strace_probe_marker { } { with_test_prefix "probe_marker" {
global executable
global expect_out
global gdb_prompt
@@ -96,7 +96,7 @@ proc strace_probe_marker { } { with_test_prefix " probe_marker" {
gdb_test "tfind" "Target failed to find requested trace frame\\..*"
}}

-proc strace_trace_on_same_addr { type } { with_test_prefix " trace_same_addr $type" {
+proc strace_trace_on_same_addr { type } { with_test_prefix "trace_same_addr $type" {
global executable
global expect_out
global gdb_prompt
@@ -186,7 +186,7 @@ proc strace_trace_on_same_addr { type } { with_test_prefix " trace_same_addr $ty
}
}}

-proc strace_trace_on_diff_addr { } { with_test_prefix " trace_diff_addr" {
+proc strace_trace_on_diff_addr { } { with_test_prefix "trace_diff_addr" {

global executable
global expect_out
diff --git a/gdb/testsuite/gdb.trace/trace-break.exp b/gdb/testsuite/gdb.trace/trace-break.exp
index 5fcc1ac..986d113 100644
--- a/gdb/testsuite/gdb.trace/trace-break.exp
+++ b/gdb/testsuite/gdb.trace/trace-break.exp
@@ -56,7 +56,7 @@ if [is_amd64_regs_target] {
# Set breakpoint and tracepoint at the same address.

proc break_trace_same_addr_1 { trace_type option } \
-{ with_test_prefix " 1 $trace_type $option:" \
+{ with_test_prefix "1 $trace_type $option:" \
{
global executable
global hex
@@ -89,7 +89,7 @@ proc break_trace_same_addr_1 { trace_type option } \
# Set multiple tracepoints at the same address.

proc break_trace_same_addr_2 { trace_type1 trace_type2 option } \
-{ with_test_prefix " 2 $trace_type1 $trace_type2 $option:" \
+{ with_test_prefix "2 $trace_type1 $trace_type2 $option:" \
{
global executable
global hex
@@ -127,7 +127,7 @@ proc break_trace_same_addr_2 { trace_type1 trace_type2 option } \
# that tracepoint still works.

proc break_trace_same_addr_3 { trace_type option } \
-{ with_test_prefix " 3 $trace_type $option:" \
+{ with_test_prefix "3 $trace_type $option:" \
{
global executable
global hex
@@ -162,7 +162,7 @@ proc break_trace_same_addr_3 { trace_type option } \
# that breakpoint still works.

proc break_trace_same_addr_4 { trace_type option } \
-{ with_test_prefix " 4 $trace_type $option:" \
+{ with_test_prefix "4 $trace_type $option:" \
{
global executable
global hex
@@ -201,7 +201,7 @@ proc break_trace_same_addr_4 { trace_type option } \
# of two locations. Verify these tracepoints work as expected.

proc break_trace_same_addr_5 { trace1 trace2 trace3 trace3_at_first_loc } \
-{ with_test_prefix " 5 $trace1 $trace2 ${trace3}@${trace3_at_first_loc}:" \
+{ with_test_prefix "5 $trace1 $trace2 ${trace3}@${trace3_at_first_loc}:" \
{
global executable
global hex
@@ -273,7 +273,7 @@ proc break_trace_same_addr_5 { trace1 trace2 trace3 trace3_at_first_loc } \
# tracepoints work as expect.

proc break_trace_same_addr_6 { trace1 enable1 trace2 enable2 } \
-{ with_test_prefix " 6 $trace1 $enable1 $trace2 $enable2:" \
+{ with_test_prefix "6 $trace1 $enable1 $trace2 $enable2:" \
{
global executable
global hex
diff --git a/gdb/testsuite/gdb.trace/unavailable.exp b/gdb/testsuite/gdb.trace/unavailable.exp
index 199e219..9309437 100644
--- a/gdb/testsuite/gdb.trace/unavailable.exp
+++ b/gdb/testsuite/gdb.trace/unavailable.exp
@@ -136,7 +136,7 @@ proc test_maybe_regvar_display { var } {
# Test procs
#

-proc gdb_collect_args_test {} { with_test_prefix " unavailable arguments:" {
+proc gdb_collect_args_test {} { with_test_prefix "unavailable arguments:" {
global cr
global gdb_prompt

@@ -203,7 +203,7 @@ proc gdb_collect_args_test {} { with_test_prefix " unavailable arguments:" {
"cease trace debugging"
}}

-proc gdb_collect_locals_test { func msg } { with_test_prefix " unavailable locals: $msg:" {
+proc gdb_collect_locals_test { func msg } { with_test_prefix "unavailable locals: $msg:" {
global cr
global gdb_prompt

@@ -254,7 +254,7 @@ proc gdb_collect_locals_test { func msg } { with_test_prefix " unavailable local
"cease trace debugging"
}}

-proc gdb_unavailable_registers_test { } { with_test_prefix " unavailable registers:" {
+proc gdb_unavailable_registers_test { } { with_test_prefix "unavailable registers:" {
global gdb_prompt
global spreg
global pcreg
@@ -305,7 +305,7 @@ proc gdb_unavailable_registers_test { } { with_test_prefix " unavailable registe
gdb_test "tfind none" "#0 end .*" "cease trace debugging"
}}

-proc gdb_collect_globals_test { } { with_test_prefix " collect globals:" {
+proc gdb_collect_globals_test { } { with_test_prefix "collect globals:" {
global ws
global cr
global gdb_prompt
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 3a43f95..ce04b5f 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -1507,21 +1507,21 @@ proc skip_shlib_tests {} {
# gdb_test ... ... "test foo"
# gdb_test ... ... "test bar"
#
-# with_test_prefix " subvariation a:" {
+# with_test_prefix "subvariation a:" {
# gdb_test ... ... "test x"
# }
#
-# with_test_prefix " subvariation b:" {
+# with_test_prefix "subvariation b:" {
# gdb_test ... ... "test x"
# }
# }
#
-# with_test_prefix " variation1:" {
+# with_test_prefix "variation1:" {
# ...do setup for variation 1...
# do_tests
# }
#
-# with_test_prefix " variation2:" {
+# with_test_prefix "variation2:" {
# ...do setup for variation 2...
# do_tests
# }
@@ -1549,13 +1549,14 @@ proc skip_shlib_tests {} {
#

# Run BODY in the context of the caller, with the current test prefix
-# (pf_prefix) appended with PREFIX. Returns the result of BODY.
+# (pf_prefix) appended with one space and then PREFIX. Returns the
+# result of BODY.
#
proc with_test_prefix { prefix body } {
global pf_prefix

set saved $pf_prefix
- append pf_prefix $prefix
+ append pf_prefix " " $prefix
set code [catch {uplevel 1 $body} result]
set pf_prefix $saved