diff options
author | Yao Qi <yao@codesourcery.com> | 2013-03-15 01:41:29 +0000 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2013-03-15 01:41:29 +0000 |
commit | 0a251e08fa4e7130f05462ecc9f60e6683cdefca (patch) | |
tree | c79ccfc1f502d7e7d48c54b67720381603201b98 /gdb/testsuite/gdb.trace/change-loc.exp | |
parent | 2c415c0f382fd6361d9d702ebdd71cd6d6a06d19 (diff) | |
download | gdb-0a251e08fa4e7130f05462ecc9f60e6683cdefca.zip gdb-0a251e08fa4e7130f05462ecc9f60e6683cdefca.tar.gz gdb-0a251e08fa4e7130f05462ecc9f60e6683cdefca.tar.bz2 |
gdb/testsuite/
* gdb.threads/non-ldr-exc-1.exp (do_test): Fix the indent of
using with_test_prefix.
* gdb.threads/non-ldr-exc-2.exp (do_test): Likewise.
* gdb.threads/non-ldr-exc-3.exp (do_test): Likewise.
* gdb.threads/non-ldr-exc-4.exp (do_test): Likewise.
* gdb.threads/watchpoint-fork.exp (test): Likewise.
* gdb.base/break-interp.exp (test_core): Likewise.
(test_attach_gdb): Likewise.
* gdb.base/catch-load.exp (one_catch_load_test): Likewise.
* gdb.base/disp-step-syscall.exp (disp_step_cross_syscall):
Likewise.
* gdb.base/jit-so.exp (one_jit_test): Likewise.
* gdb.base/jit.exp (one_jit_test): Likewise.
* gdb.base/sepdebug.exp (test_different_dir): Likewise.
* gdb.dwarf2/dw2-dir-file-name.exp (test): Likewise.
* gdb.dwarf2/dw2-noloc.exp (file_symbols): Likewise.
* gdb.mi/mi-breakpoint-changed.exp (test_pending_resolved):
Likewise.
* gdb.mi/mi-cmd-param-changed.exp (test_command_param_changed):
Likewise.
* gdb.mi/mi-watch.exp test_watchpoint_all): Likewise.
* gdb.mi/pr11022.exp (test_memory_changed_observer): Likewise.
* gdb.trace/change-loc.exp (tracepoint_change_loc_1): Likewise.
(tracepoint_change_loc_2): Likewise.
* gdb.trace/disconnected-tracing.exp (disconnected_tracing):
Likewise.
(disconnected_tfind): Likewise.
* gdb.trace/mi-traceframe-changed.exp (test_tfind_tfile):
Likewise.
(test_tfind_remote): Likewise.
* gdb.trace/mi-tracepoint-changed.exp (test_reconnect):
Likewise.
(test_pending_resolved): Likewise.
* gdb.trace/mi-tsv-changed.exp (test_create_delete_modify_tsv):
Likewise.
(test_upload_tsv): Likewise.
* gdb.trace/pending.exp (pending_tracepoint_resolved):
Likewise.
(pending_tracepoint_works): Likewise.
* gdb.trace/report.exp (use_collected_data): Likewise.
* gdb.trace/status-stop.exp (test_tstart_tstop_tstart):
Likewise.
(test_tstart_tstart, test_buffer_full_tstart): Likewise.
* gdb.trace/strace.exp (strace_info_marker): Likewise.
(strace_trace_on_same_addr): Likewise.
(strace_trace_on_diff_addr): Likewise.
* gdb.trace/unavailable.exp (gdb_collect_args_test): Likewise.
(gdb_collect_locals_test): Likewise.
(gdb_unavailable_registers_test): Likewise.
(gdb_collect_globals_test): Likewise.
Diffstat (limited to 'gdb/testsuite/gdb.trace/change-loc.exp')
-rw-r--r-- | gdb/testsuite/gdb.trace/change-loc.exp | 338 |
1 files changed, 174 insertions, 164 deletions
diff --git a/gdb/testsuite/gdb.trace/change-loc.exp b/gdb/testsuite/gdb.trace/change-loc.exp index b02cf27..3a79b10 100644 --- a/gdb/testsuite/gdb.trace/change-loc.exp +++ b/gdb/testsuite/gdb.trace/change-loc.exp @@ -69,208 +69,218 @@ if [is_amd64_regs_target] { # Set tracepoint during tracing experiment. -proc tracepoint_change_loc_1 { trace_type } { with_test_prefix "1 $trace_type" { - global testfile - global srcfile - global pcreg - global gdb_prompt - - clean_restart ${testfile} - if ![runto_main] { - fail "Can't run to main" - return -1 - } - gdb_test_no_output "delete break 1" - - # Set a tracepoint we'll never meet. Just to avoid the complain after - # type `tstart' later. - gdb_test "next" ".*" - gdb_test "trace main" "Tracepoint \[0-9\] at.* file .*$srcfile, line.*" \ - "set tracepoint on main" - - gdb_test "break marker" "Breakpoint.*at.* file .*$srcfile, line.*" \ - "breakpoint on marker" - - gdb_test_no_output "tstart" - - gdb_test "continue" ".*Breakpoint.*marker.*at.*$srcfile.*" \ - "continue to marker 1" - # Set a tracepoint during tracing. - set test "set tracepoint on set_tracepoint" - gdb_test_multiple "${trace_type} set_tracepoint" $test { - -re "Target returns error code .* too far .*$gdb_prompt $" { - if [string equal $trace_type "ftrace"] { - # The target was unable to install the fast tracepoint - # (e.g., jump pad too far from tracepoint). - pass "$test (too far)" - } else { - fail $test - } +proc tracepoint_change_loc_1 { trace_type } { + with_test_prefix "1 $trace_type" { + global testfile + global srcfile + global pcreg + global gdb_prompt + + clean_restart ${testfile} + if ![runto_main] { + fail "Can't run to main" + return -1 } - -re "\r\n$gdb_prompt $" { - pass $test + gdb_test_no_output "delete break 1" + + # Set a tracepoint we'll never meet. Just to avoid the + # complain after type `tstart' later. + gdb_test "next" ".*" + gdb_test "trace main" \ + "Tracepoint \[0-9\] at.* file .*$srcfile, line.*" \ + "set tracepoint on main" + + gdb_test "break marker" \ + "Breakpoint.*at.* file .*$srcfile, line.*" \ + "breakpoint on marker" + + gdb_test_no_output "tstart" + + gdb_test "continue" ".*Breakpoint.*marker.*at.*$srcfile.*" \ + "continue to marker 1" + # Set a tracepoint during tracing. + set test "set tracepoint on set_tracepoint" + gdb_test_multiple "${trace_type} set_tracepoint" $test { + -re "Target returns error code .* too far .*$gdb_prompt $" { + if [string equal $trace_type "ftrace"] { + # The target was unable to install the fast tracepoint + # (e.g., jump pad too far from tracepoint). + pass "$test (too far)" + } else { + fail $test + } + } + -re "\r\n$gdb_prompt $" { + pass $test + } } - } - gdb_trace_setactions "set action for tracepoint" "" \ - "collect \$$pcreg" "^$" + gdb_trace_setactions "set action for tracepoint" "" \ + "collect \$$pcreg" "^$" - # tracepoint has two locations after shlib change-loc-1 is loaded. - gdb_test "info trace" \ - "Num Type\[ \]+Disp Enb Address\[ \]+What.* + # tracepoint has two locations after shlib change-loc-1 is loaded. + gdb_test "info trace" \ + "Num Type\[ \]+Disp Enb Address\[ \]+What.* \[0-9\]+\[\t \]+\(|fast \)tracepoint\[ \]+keep y.*\<MULTIPLE\>.*4\.1.* in func4.*4\.2.* in func4.*" \ - "tracepoint with two locations" - - set test "continue to marker 2" - gdb_test_multiple "continue" $test { - -re "Target returns error code .* too far .*$gdb_prompt $" { - if [string equal $trace_type "ftrace"] { - # Expected if the target was unable to install the - # fast tracepoint (e.g., jump pad too far from - # tracepoint). - pass "$test (too far)" - # Skip the rest of the tests. - return - } else { - fail "continue to marker 2" - fail $test - } - - } - -re ".*Breakpoint.*marker.*at.*$srcfile.*$gdb_prompt $" { - pass "continue to marker 2" - } - } + "tracepoint with two locations" + + set test "continue to marker 2" + gdb_test_multiple "continue" $test { + -re "Target returns error code .* too far .*$gdb_prompt $" { + if [string equal $trace_type "ftrace"] { + # Expected if the target was unable to install the + # fast tracepoint (e.g., jump pad too far from + # tracepoint). + pass "$test (too far)" + # Skip the rest of the tests. + return + } else { + fail "continue to marker 2" + fail $test + } - # tracepoint has three locations after shlib change-loc-2 is loaded. - gdb_test "info trace" \ - "Num Type\[ \]+Disp Enb Address\[ \]+What.* + } + -re ".*Breakpoint.*marker.*at.*$srcfile.*$gdb_prompt $" { + pass "continue to marker 2" + } + } + + # tracepoint has three locations after shlib change-loc-2 is + # loaded. + gdb_test "info trace" \ + "Num Type\[ \]+Disp Enb Address\[ \]+What.* \[0-9\]+\[\t \]+\(|fast \)tracepoint\[ \]+keep y.*\<MULTIPLE\>.*4\.1.* in func4.*4\.2.* in func4.*4\.3.* in func4 .*" \ - "tracepoint with three locations" + "tracepoint with three locations" - gdb_test "continue" ".*Breakpoint.*marker.*at.*$srcfile.*" \ - "continue to marker 3" + gdb_test "continue" ".*Breakpoint.*marker.*at.*$srcfile.*" \ + "continue to marker 3" - # shlib is unloaded, there are still three locations, but one is pending. - gdb_test "info trace" \ - "Num Type\[ \]+Disp Enb Address\[ \]+What.* + # shlib is unloaded, there are still three locations, but one + # is pending. + gdb_test "info trace" \ + "Num Type\[ \]+Disp Enb Address\[ \]+What.* \[0-9\]+\[\t \]+\(|fast \)tracepoint\[ \]+keep y.*\<MULTIPLE\>.* 4\.1.* in func4.*\tinstalled on target\r\n(4\.2.* in func4.*\tinstalled on target\r\n4\.3.* \<PENDING\>\[\t \]+set_tracepoint|4\.2.* \<PENDING\>\[\t \]+set_tracepoint.*4\.3.* in func4.*\tinstalled on target).*" \ - "tracepoint with two locations (unload)" + "tracepoint with two locations (unload)" - gdb_test_no_output "tstop" + gdb_test_no_output "tstop" - gdb_test "tfind" "Found trace frame 0, tracepoint 4.*" "tfind frame 0" - gdb_test "tfind" "Target failed to find requested trace frame\\..*" -}} + gdb_test "tfind" "Found trace frame 0, tracepoint 4.*" \ + "tfind frame 0" + gdb_test "tfind" \ + "Target failed to find requested trace frame\\..*" + } +} # Set pending tracepoint. -proc tracepoint_change_loc_2 { trace_type } { with_test_prefix "2 $trace_type" { - global srcdir - global srcfile - global subdir - global pcreg - global binfile - global gdb_prompt - - gdb_exit - gdb_start - gdb_reinitialize_dir $srcdir/$subdir - - gdb_test_multiple "${trace_type} set_tracepoint" "set pending tracepoint" { - -re ".*Make \(|fast \)tracepoint pending.*y or \\\[n\\\]. $" { - gdb_test "y" "\(Fast t|T\)racepoint.*set_tracepoint.*pending." "set pending tracepoint" +proc tracepoint_change_loc_2 { trace_type } { + with_test_prefix "2 $trace_type" { + global srcdir + global srcfile + global subdir + global pcreg + global binfile + global gdb_prompt + + gdb_exit + gdb_start + gdb_reinitialize_dir $srcdir/$subdir + + gdb_test_multiple "${trace_type} set_tracepoint" "set pending tracepoint" { + -re ".*Make \(|fast \)tracepoint pending.*y or \\\[n\\\]. $" { + gdb_test "y" "\(Fast t|T\)racepoint.*set_tracepoint.*pending." "set pending tracepoint" + } } - } - gdb_trace_setactions "set action for tracepoint" "" \ - "collect \$$pcreg" "^$" + gdb_trace_setactions "set action for tracepoint" "" \ + "collect \$$pcreg" "^$" - # tracepoint has no location information now. Make sure nothing - # else is displayed. - gdb_test "info trace" \ - "Num Type\[ \]+Disp Enb Address\[ \]+What.* + # tracepoint has no location information now. Make sure nothing + # else is displayed. + gdb_test "info trace" \ + "Num Type\[ \]+Disp Enb Address\[ \]+What.* \[0-9\]+\[\t \]+\(|fast \)tracepoint\[ \]+keep y.*PENDING.*set_tracepoint\r\n\[\t \]+collect \\$$pcreg\r" \ - "single pending tracepoint info (without symbols)" + "single pending tracepoint info (without symbols)" - gdb_load ${binfile} - # tracepoint has one location after executable is loaded. - gdb_test "info trace" \ - "Num Type\[ \]+Disp Enb Address\[ \]+What.* + gdb_load ${binfile} + # tracepoint has one location after executable is loaded. + gdb_test "info trace" \ + "Num Type\[ \]+Disp Enb Address\[ \]+What.* \[0-9\]+\[\t \]+\(|fast \)tracepoint\[ \]+keep y.*func4.*" \ - "tracepoint with one location" + "tracepoint with one location" - set main_bp 0 - gdb_test_multiple "break main" "set breakpoint on main" { - -re "Breakpoint (\[0-9\]*) at .*, line.*$gdb_prompt $" { - set main_bp $expect_out(1,string) + set main_bp 0 + gdb_test_multiple "break main" "set breakpoint on main" { + -re "Breakpoint (\[0-9\]*) at .*, line.*$gdb_prompt $" { + set main_bp $expect_out(1,string) + } } - } - gdb_run_cmd + gdb_run_cmd - gdb_test "" \ - ".*Breakpoint.*main.*at.*$srcfile.*" \ - "run to main" - gdb_test_no_output "delete break $main_bp" + gdb_test "" \ + ".*Breakpoint.*main.*at.*$srcfile.*" \ + "run to main" + gdb_test_no_output "delete break $main_bp" - # tracepoint has two locations after shlib change-loc-1 is loaded. - gdb_test "info trace" \ - "Num Type\[ \]+Disp Enb Address\[ \]+What.* + # tracepoint has two locations after shlib change-loc-1 is loaded. + gdb_test "info trace" \ + "Num Type\[ \]+Disp Enb Address\[ \]+What.* \[0-9\]+\[\t \]+\(|fast \)tracepoint\[ \]+keep y.*\<MULTIPLE\>.*1\.1.* in func4.*1\.2.* in func4.*" \ - "tracepoint with two locations" - - gdb_test "break marker" "Breakpoint.*at.* file .*$srcfile, line.*" \ - "breakpoint on marker" - - # tracepoint with two locations will be downloaded and installed. - set test "tstart" - gdb_test_multiple "tstart" $test { - -re "^tstart\r\n$gdb_prompt $" { - pass "tstart" - } - -re "Target returns error code .* too far .*$gdb_prompt $" { - if [string equal $trace_type "ftrace"] { - # The target was unable to install the fast tracepoint - # (e.g., jump pad too far from tracepoint). - pass "$test (too far)" - # Skip the rest of the tests. - return - } else { - fail $test - } + "tracepoint with two locations" + + gdb_test "break marker" "Breakpoint.*at.* file .*$srcfile, line.*" \ + "breakpoint on marker" + + # tracepoint with two locations will be downloaded and installed. + set test "tstart" + gdb_test_multiple "tstart" $test { + -re "^tstart\r\n$gdb_prompt $" { + pass "tstart" + } + -re "Target returns error code .* too far .*$gdb_prompt $" { + if [string equal $trace_type "ftrace"] { + # The target was unable to install the fast tracepoint + # (e.g., jump pad too far from tracepoint). + pass "$test (too far)" + # Skip the rest of the tests. + return + } else { + fail $test + } + } } - } - gdb_test "continue" ".*Breakpoint.*marker.*at.*$srcfile.*" \ - "continue to marker 1" + gdb_test "continue" ".*Breakpoint.*marker.*at.*$srcfile.*" \ + "continue to marker 1" - gdb_test "continue" ".*Breakpoint.*marker.*at.*$srcfile.*" \ - "continue to marker 2" + gdb_test "continue" ".*Breakpoint.*marker.*at.*$srcfile.*" \ + "continue to marker 2" - # tracepoint has three locations after shlib change-loc-2 is loaded. - gdb_test "info trace" \ - "Num Type\[ \]+Disp Enb Address\[ \]+What.* + # tracepoint has three locations after shlib change-loc-2 is loaded. + gdb_test "info trace" \ + "Num Type\[ \]+Disp Enb Address\[ \]+What.* \[0-9\]+\[\t \]+\(|fast \)tracepoint\[ \]+keep y.*\<MULTIPLE\>.*1\.1.* in func4.*1\.2.* in func4.*1\.3.* in func4 .*" \ - "tracepoint with three locations" + "tracepoint with three locations" - gdb_test "continue" ".*Breakpoint.*marker.*at.*$srcfile.*" \ - "continue to marker 3" + gdb_test "continue" ".*Breakpoint.*marker.*at.*$srcfile.*" \ + "continue to marker 3" - # shlib is unloaded, there are still three locations, but one is pending. - gdb_test "info trace" \ - "Num Type\[ \]+Disp Enb Address\[ \]+What.* + # shlib is unloaded, there are still three locations, but one is pending. + gdb_test "info trace" \ + "Num Type\[ \]+Disp Enb Address\[ \]+What.* \[0-9\]+\[\t \]+\(|fast \)tracepoint\[ \]+keep y.*\<MULTIPLE\>.* 1\.1.* in func4.*\tinstalled on target\r\n(1\.2.* in func4.*\tinstalled on target\r\n1\.3.* \<PENDING\>\[\t \]+set_tracepoint|1\.2.* \<PENDING\>\[\t \]+set_tracepoint\r\n1\.3.* in func4.*\tinstalled on target).*" \ - "tracepoint with two locations (unload)" + "tracepoint with two locations (unload)" - gdb_test_no_output "tstop" + gdb_test_no_output "tstop" - gdb_test "tfind" "Found trace frame 0, tracepoint 1.*" "tfind frame 0" - gdb_test "tfind" "Found trace frame 1, tracepoint 1.*" "tfind frame 1" - gdb_test "tfind" "Found trace frame 2, tracepoint 1.*" "tfind frame 2" - gdb_test "tfind" "Target failed to find requested trace frame\\..*" -}} + gdb_test "tfind" "Found trace frame 0, tracepoint 1.*" "tfind frame 0" + gdb_test "tfind" "Found trace frame 1, tracepoint 1.*" "tfind frame 1" + gdb_test "tfind" "Found trace frame 2, tracepoint 1.*" "tfind frame 2" + gdb_test "tfind" "Target failed to find requested trace frame\\..*" + } +} tracepoint_change_loc_1 "trace" tracepoint_change_loc_2 "trace" |