+2012-02-21 Pedro Alves <palves@redhat.com>
+
+ * gdb.arch/altivec-abi.exp (altivec_abi_tests): Don't do
+ with_test_prefix here.
+ (top level): Do it here instead. Remove `:' from the
+ with_test_prefix string.
+ * gdb.base/attach-pie-misread.exp: Remove the leading space the
+ the suffix `:' from the with_test_prefix prefix string.
+ * gdb.base/break-interp.exp: Ditto.
+ * gdb.base/catch-load.exp: Ditto.
+ * gdb.base/disp-step-syscall.exp: Ditto.
+ * gdb.base/jit-so.exp: Ditto.
+ * gdb.base/jit.exp: Ditto.
+ * gdb.base/sepdebug.exp: Ditto.
+ * gdb.base/solib-display.exp: Ditto.
+ * gdb.base/solib-overlap.exp: Ditto.
+ * gdb.base/watch-cond-infcall.exp: Ditto.
+ * gdb.base/watchpoint.exp: Ditto.
+ * gdb.dwarf2/dw2-noloc.exp: Ditto.
+ * gdb.mi/mi-watch.exp: Ditto.
+ * gdb.mi/mi2-watch.exp: Ditto.
+ * gdb.threads/non-ldr-exc-1.exp: Ditto.
+ * gdb.threads/non-ldr-exc-2.exp: Ditto.
+ * gdb.threads/non-ldr-exc-3.exp: Ditto.
+ * gdb.threads/non-ldr-exc-4.exp: Ditto.
+ * gdb.threads/watchpoint-fork.exp: Ditto.
+ * gdb.threads/watchthreads-reorder.exp: Ditto.
+ * gdb.trace/change-loc.exp: Ditto.
+ * gdb.trace/pending.exp: Ditto.
+ * gdb.trace/status-stop.exp: Ditto.
+ * gdb.trace/strace.exp: Ditto.
+ * gdb.trace/trace-break.exp: Ditto.
+ * gdb.trace/unavailable.exp: Ditto.
+ * lib/gdb.exp (with_test_prefix): Always prefix with space and
+ suffix with colon. Adjust leading comments.
+
2012-02-21 Pedro Alves <palves@redhat.com>
Tom Tromey <tromey@redhat.com>
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
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.
# 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
}
# 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"]]
# 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"]
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
# names.
# KIND is passed to the "catch" command.
# MATCH is a boolean saying whether we expect the catchpoint to be hit.
-proc one_catch_load_test {scenario kind match sostop} { with_test_prefix "${scenario}:" {
+proc one_catch_load_test {scenario kind match sostop} { with_test_prefix "${scenario}" {
global verbose testfile testfile2 binfile2_dlopen
global srcfile
global decimal gdb_prompt
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
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
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
#********
-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
}
# 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"} {
# 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.
}
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 }
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
}
# 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
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
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
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}
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}
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}
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}
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
return -1
}
-foreach reorder {0 1} { with_test_prefix " reorder$reorder:" {
+foreach reorder {0 1} { with_test_prefix "reorder$reorder" {
clean_restart $testfile
# 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
# 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
# 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
# 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
# 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
# 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
# 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
# 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
# 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
# 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
# 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
# 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
gdb_load_shlibs $libipa
-proc strace_info_marker { } { with_test_prefix " info_marker" {
+proc strace_info_marker { } { with_test_prefix "info_marker" {
global executable
global gdb_prompt
}
}}
-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
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
}
}}
-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
# 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
# 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
# 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
# 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
# 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
# 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
# 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
"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
"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
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
# 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
# }
#
# global pf_prefix
# set saved_pf_prefix
-# append pf_prefix "${foo} bar"
+# append pf_prefix "${foo}: bar"
# ... actual tests ...
# set pf_prefix $saved_pf_prefix
#
# 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, then PREFIX, and then a colon.
+# 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