gdb/testsuite/

PR testsuite/12649
	* gdb.trace/collection.exp (gdb_collect_return_test): Import gdb_prompt.
	Protect gdb_test_multiple by final $gdb_prompt match.
	* gdb.trace/tspeed.exp (gdb_fast_trace_speed_test): Likewise.
	* gdb.trace/tstatus.exp (run_trace_experiment): Likewise.
	(test_tracepoints): Likewise.
This commit is contained in:
Jan Kratochvil
2011-12-02 12:43:29 +00:00
parent 9750bca92c
commit 968643aaa9
4 changed files with 29 additions and 16 deletions

View File

@ -1,3 +1,12 @@
2011-12-02 Jan Kratochvil <jan.kratochvil@redhat.com>
PR testsuite/12649
* gdb.trace/collection.exp (gdb_collect_return_test): Import gdb_prompt.
Protect gdb_test_multiple by final $gdb_prompt match.
* gdb.trace/tspeed.exp (gdb_fast_trace_speed_test): Likewise.
* gdb.trace/tstatus.exp (run_trace_experiment): Likewise.
(test_tracepoints): Likewise.
2011-12-02 Jan Kratochvil <jan.kratochvil@redhat.com> 2011-12-02 Jan Kratochvil <jan.kratochvil@redhat.com>
PR breakpoints/13346 PR breakpoints/13346

View File

@ -589,6 +589,7 @@ proc gdb_collect_global_in_pieces_test { } {
} }
proc gdb_collect_return_test { } { proc gdb_collect_return_test { } {
global gdb_prompt
prepare_for_trace_test prepare_for_trace_test
@ -606,10 +607,10 @@ proc gdb_collect_return_test { } {
# Since we can't guarantee that $_ret will give us the caller, # Since we can't guarantee that $_ret will give us the caller,
# pass either way, but giving different messages. # pass either way, but giving different messages.
gdb_test_multiple "backtrace" "" { gdb_test_multiple "backtrace" "" {
-re ".*#1 .* in main .*" { -re ".*#1 .* in main .*\r\n$gdb_prompt $" {
pass "collect \$_ret: backtrace lists main" pass "collect \$_ret: backtrace lists main"
} }
-re ".*#1 .* in ?? .*" { -re ".*#1 .* in ?? .*\r\n$gdb_prompt $" {
pass "collect \$_ret: backtrace not listing main" pass "collect \$_ret: backtrace not listing main"
} }
} }

View File

@ -89,6 +89,7 @@ proc gdb_slow_trace_speed_test { } {
} }
proc gdb_fast_trace_speed_test { } { proc gdb_fast_trace_speed_test { } {
global gdb_prompt
gdb_delete_tracepoints gdb_delete_tracepoints
@ -100,11 +101,11 @@ proc gdb_fast_trace_speed_test { } {
gdb_test_multiple "ftrace $testline if (globfoo != 12 && globfoo2 == 45)" \ gdb_test_multiple "ftrace $testline if (globfoo != 12 && globfoo2 == 45)" \
"set conditional fast tracepoint" { "set conditional fast tracepoint" {
-re "Fast tracepoint \[0-9\]+ at .*" { -re "Fast tracepoint \[0-9\]+ at .*\r\n$gdb_prompt $" {
pass "set conditional fast tracepoint, done" pass "set conditional fast tracepoint, done"
set run_ftrace 1 set run_ftrace 1
} }
-re "May not have a fast tracepoint at .*" { -re "May not have a fast tracepoint at .*\r\n$gdb_prompt $" {
pass "set conditional fast tracepoint, not allowed at line" pass "set conditional fast tracepoint, not allowed at line"
} }
} }

View File

@ -56,6 +56,7 @@ if ![runto_main] {
} }
proc run_trace_experiment {} { proc run_trace_experiment {} {
global gdb_prompt
# gdb_test_no_output "set debug remote 1" "" # gdb_test_no_output "set debug remote 1" ""
@ -74,10 +75,10 @@ proc run_trace_experiment {} {
# cases. # cases.
gdb_test_multiple "tstatus" "check on trace status" { gdb_test_multiple "tstatus" "check on trace status" {
-re "Trace is running.*Trace will stop if GDB disconnects\.\[\r\n\]+Trace notes: my tracing note\.\[\r\n\]+Not looking at any trace frame\..*" { -re "Trace is running.*Trace will stop if GDB disconnects\.\[\r\n\]+Trace notes: my tracing note\.\[\r\n\]+Not looking at any trace frame\..*\r\n$gdb_prompt $" {
pass "tstatus reports trace note" pass "tstatus reports trace note"
} }
-re "Trace is running.*Trace will stop if GDB disconnects\.\[\r\n\]+Not looking at any trace frame.*" { -re "Trace is running.*Trace will stop if GDB disconnects\.\[\r\n\]+Not looking at any trace frame.*\r\n$gdb_prompt $" {
pass "tstatus does not report any trace note" pass "tstatus does not report any trace note"
} }
} }
@ -85,10 +86,10 @@ proc run_trace_experiment {} {
gdb_test "set trace-notes different note" "" "change tracing note" gdb_test "set trace-notes different note" "" "change tracing note"
gdb_test_multiple "tstatus" "check on trace status with diff note" { gdb_test_multiple "tstatus" "check on trace status with diff note" {
-re "Trace is running.*Trace will stop if GDB disconnects\.\[\r\n\]+Trace notes: different note\.\[\r\n\]+Not looking at any trace frame\..*" { -re "Trace is running.*Trace will stop if GDB disconnects\.\[\r\n\]+Trace notes: different note\.\[\r\n\]+Not looking at any trace frame\..*\r\n$gdb_prompt $" {
pass "tstatus reports different trace note" pass "tstatus reports different trace note"
} }
-re "Trace is running.*Trace will stop if GDB disconnects\.\[\r\n\]+Not looking at any trace frame.*" { -re "Trace is running.*Trace will stop if GDB disconnects\.\[\r\n\]+Not looking at any trace frame.*\r\n$gdb_prompt $" {
pass "tstatus does not report any different trace note" pass "tstatus does not report any different trace note"
} }
} }
@ -96,10 +97,10 @@ proc run_trace_experiment {} {
gdb_test "set trace-user me me me" "" "change tracing user" gdb_test "set trace-user me me me" "" "change tracing user"
gdb_test_multiple "tstatus" "check on trace status with diff note" { gdb_test_multiple "tstatus" "check on trace status with diff note" {
-re "Trace is running.*Trace will stop if GDB disconnects\.\[\r\n\]+Trace user is me me me\.\[\r\n\]+Trace notes: different note\.\[\r\n\]+Not looking at any trace frame\..*" { -re "Trace is running.*Trace will stop if GDB disconnects\.\[\r\n\]+Trace user is me me me\.\[\r\n\]+Trace notes: different note\.\[\r\n\]+Not looking at any trace frame\..*\r\n$gdb_prompt $" {
pass "tstatus reports trace user" pass "tstatus reports trace user"
} }
-re "Trace is running.*Trace will stop if GDB disconnects\.\[\r\n\]+Not looking at any trace frame.*" { -re "Trace is running.*Trace will stop if GDB disconnects\.\[\r\n\]+Not looking at any trace frame.*\r\n$gdb_prompt $" {
pass "tstatus does not report trace user" pass "tstatus does not report trace user"
} }
} }
@ -107,10 +108,10 @@ proc run_trace_experiment {} {
gdb_test_no_output "tstop because I can" "trace stopped with note" gdb_test_no_output "tstop because I can" "trace stopped with note"
gdb_test_multiple "tstatus" "check on trace status after stop" { gdb_test_multiple "tstatus" "check on trace status after stop" {
-re "Trace stopped by a tstop command (because I can)\..*Trace will stop if GDB disconnects\.\[\r\n\]+Trace user is me me me\.\[\r\n\]+Trace notes: different note\.\[\r\n\]+Not looking at any trace frame\..*" { -re "Trace stopped by a tstop command (because I can)\..*Trace will stop if GDB disconnects\.\[\r\n\]+Trace user is me me me\.\[\r\n\]+Trace notes: different note\.\[\r\n\]+Not looking at any trace frame\..*\r\n$gdb_prompt $" {
pass "tstatus reports trace stop reason" pass "tstatus reports trace stop reason"
} }
-re "Trace stopped by a tstop command\..*" { -re "Trace stopped by a tstop command\..*\r\n$gdb_prompt $" {
pass "tstatus does not report trace stop reason" pass "tstatus does not report trace stop reason"
} }
} }
@ -118,16 +119,17 @@ proc run_trace_experiment {} {
# Tracepoint hit count is optional, so pass it either way. # Tracepoint hit count is optional, so pass it either way.
gdb_test_multiple "info trace" "show tracepoint state" { gdb_test_multiple "info trace" "show tracepoint state" {
-re "actions\.c:\[0-9\]+\[\r\n\]+\[\t ]+tracepoint already hit 1 time\[\r\n\]+\[\t ]+collect parm" { -re "actions\.c:\[0-9\]+\[\r\n\]+\[\t ]+tracepoint already hit 1 time\[\r\n\]+\[\t ]+collect parm.*\r\n$gdb_prompt $" {
pass "info trace reports tracepoint hit count" pass "info trace reports tracepoint hit count"
} }
-re "actions\.c:\[0-9\]+\[\r\n\]+\[\t ]+collect parm" { -re "actions\.c:\[0-9\]+\[\r\n\]+\[\t ]+collect parm.*\r\n$gdb_prompt $" {
pass "info trace does not report tracepoint hit count" pass "info trace does not report tracepoint hit count"
} }
} }
} }
proc test_tracepoints {} { proc test_tracepoints {} {
global gdb_prompt
gdb_test "break begin" ".*" "" gdb_test "break begin" ".*" ""
@ -142,10 +144,10 @@ proc test_tracepoints {} {
set fastgood 0 set fastgood 0
gdb_test_multiple "ftrace gdb_recursion_test" "set fast tracepoint" { gdb_test_multiple "ftrace gdb_recursion_test" "set fast tracepoint" {
-re "May not have a fast tracepoint at .*" { -re "May not have a fast tracepoint at .*\r\n$gdb_prompt $" {
pass "4-byte fast tracepoint could not be set" pass "4-byte fast tracepoint could not be set"
} }
-re "Fast tracepoint .*" { -re "Fast tracepoint .*\r\n$gdb_prompt $" {
pass "4-byte fast tracepoint is set" pass "4-byte fast tracepoint is set"
set fastgood 1 set fastgood 1
} }