diff options
author | Yao Qi <yao@codesourcery.com> | 2012-03-09 03:47:15 +0000 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2012-03-09 03:47:15 +0000 |
commit | f4647387fe3182beb6a30539d4339b85a48fc14e (patch) | |
tree | 2873bd931b2ca36f6a0dc78ec043bc6e9d240771 /gdb/testsuite/gdb.trace/change-loc.exp | |
parent | 6f5e93622126860eaa9c57ae1bd889c803f13168 (diff) | |
download | fsf-binutils-gdb-f4647387fe3182beb6a30539d4339b85a48fc14e.zip fsf-binutils-gdb-f4647387fe3182beb6a30539d4339b85a48fc14e.tar.gz fsf-binutils-gdb-f4647387fe3182beb6a30539d4339b85a48fc14e.tar.bz2 |
2012-03-08 Yao Qi <yao@codesourcery.com>
Pedro Alves <palves@redhat.com>
Fix PR server/13392.
* linux-x86-low.c (amd64_install_fast_tracepoint_jump_pad): Check
offset of JMP insn.
* tracepoint.c (remove_tracepoint): New.
(cmd_qtdp): Call remove_tracepoint when failed to install.
2012-03-08 Yao Qi <yao@codesourcery.com>
Pedro Alves <palves@redhat.com>
Fix PR server/13392.
* gdb.trace/change-loc.exp (tracepoint_change_loc_1): Remove kfail.
(tracepoint_change_loc_2): Remove kfail. Return if failed to
download tracepoints.
* gdb.trace/pending.exp (pending_tracepoint_works): Likewise.
(pending_tracepoint_resolved_during_trace): Likewise.
(pending_tracepoint_installed_during_trace): Likewise.
(pending_tracepoint_with_action_resolved): Likewise.
Diffstat (limited to 'gdb/testsuite/gdb.trace/change-loc.exp')
-rw-r--r-- | gdb/testsuite/gdb.trace/change-loc.exp | 71 |
1 files changed, 53 insertions, 18 deletions
diff --git a/gdb/testsuite/gdb.trace/change-loc.exp b/gdb/testsuite/gdb.trace/change-loc.exp index d6062fc..a5a982f 100644 --- a/gdb/testsuite/gdb.trace/change-loc.exp +++ b/gdb/testsuite/gdb.trace/change-loc.exp @@ -98,7 +98,21 @@ proc tracepoint_change_loc_1 { trace_type } { with_test_prefix "1 $trace_type" { gdb_test "continue" ".*Breakpoint.*marker.*at.*$srcfile.*" \ "continue to marker 1" # Set a tracepoint during tracing. - gdb_test "${trace_type} set_tracepoint" ".*" "set tracepoint on set_tracepoint" + 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" "^$" @@ -109,15 +123,27 @@ proc tracepoint_change_loc_1 { trace_type } { with_test_prefix "1 $trace_type" { \[0-9\]+\[\t \]+\(|fast \)tracepoint\[ \]+keep y.*\<MULTIPLE\>.*4\.1.* in func4.*4\.2.* in func4.*" \ "tracepoint with two locations" - gdb_test_multiple "continue" "continue to marker 2" { - -re ".*Breakpoint.*marker.*at.*$srcfile.*$gdb_prompt $" { - pass "continue to marker 2" - } - -re ".*$gdb_prompt $" { - kfail "gdb/13392" "continue to marker 2" - return - } + 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 has three locations after shlib change-loc-2 is loaded. gdb_test "info trace" \ "Num Type\[ \]+Disp Enb Address\[ \]+What.* @@ -198,19 +224,28 @@ proc tracepoint_change_loc_2 { trace_type } { with_test_prefix "2 $trace_type" { "breakpoint on marker" # tracepoint with two locations will be downloaded and installed. - gdb_test_no_output "tstart" - - gdb_test_multiple "continue" "continue to marker 1" { - -re ".*Breakpoint.*marker.*at.*$srcfile.*$gdb_prompt $" { - pass "continue to marker 1" - } - -re ".*$gdb_prompt $" { - kfail "gdb/13392" "continue to marker 1" - return + 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 2" # tracepoint has three locations after shlib change-loc-2 is loaded. |