aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.trace/pending.exp
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2012-03-09 03:47:15 +0000
committerYao Qi <yao@codesourcery.com>2012-03-09 03:47:15 +0000
commitf4647387fe3182beb6a30539d4339b85a48fc14e (patch)
tree2873bd931b2ca36f6a0dc78ec043bc6e9d240771 /gdb/testsuite/gdb.trace/pending.exp
parent6f5e93622126860eaa9c57ae1bd889c803f13168 (diff)
downloadgdb-f4647387fe3182beb6a30539d4339b85a48fc14e.zip
gdb-f4647387fe3182beb6a30539d4339b85a48fc14e.tar.gz
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/pending.exp')
-rw-r--r--gdb/testsuite/gdb.trace/pending.exp90
1 files changed, 64 insertions, 26 deletions
diff --git a/gdb/testsuite/gdb.trace/pending.exp b/gdb/testsuite/gdb.trace/pending.exp
index 017aea9..4e7dc31 100644
--- a/gdb/testsuite/gdb.trace/pending.exp
+++ b/gdb/testsuite/gdb.trace/pending.exp
@@ -132,18 +132,28 @@ proc pending_tracepoint_works { trace_type } { with_test_prefix "$trace_type wor
gdb_test "break marker" "Breakpoint.*at.* file .*$srcfile, line.*" \
"breakpoint on marker"
- gdb_test_no_output "tstart" "start trace experiment"
-
- gdb_test_multiple "continue" "continue to marker" {
- -re "Continuing.\r\n\r\nBreakpoint.*marker.*at.*$srcfile.*$gdb_prompt $" {
- pass "continue to marker"
+ set test "start trace experiment"
+ gdb_test_multiple "tstart" $test {
+ -re "^tstart\r\n$gdb_prompt $" {
+ pass $test
}
- -re ".*$gdb_prompt $" {
- kfail "gdb/13392" "continue to marker"
- return
+ -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" "Continuing.\r\n\r\nBreakpoint.*marker.*at.*$srcfile.*" \
+ "continue to marker"
+
gdb_test "tstop" "\[\r\n\]+" "stop trace experiment"
gdb_test "tfind start" "#0 .*" "tfind test frame 0"
@@ -189,13 +199,22 @@ proc pending_tracepoint_resolved_during_trace { trace_type } \
gdb_test "continue" "Continuing.\r\n\r\nBreakpoint.*marker.*at.*pending.c.*" \
"continue to marker 1"
- gdb_test_multiple "continue" "continue to marker 2" {
- -re "Continuing.\r\n\r\nBreakpoint.*marker.*at.*$srcfile.*$gdb_prompt $" {
- pass "continue to marker 2"
+ 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 $test
+ }
}
- -re ".*$gdb_prompt $" {
- kfail "gdb/13392" "continue to marker 2"
- return
+ -re "Continuing.\r\n\r\nBreakpoint.*marker.*at.*$srcfile.*$gdb_prompt $" {
+ pass $test
}
}
@@ -253,14 +272,23 @@ proc pending_tracepoint_installed_during_trace { trace_type } \
\[0-9\]+\[\t \]+\(fast |\)tracepoint\[ \t\]+keep y.*PENDING.*set_point2.*" \
"single pending tracepoint on set_point2"
- gdb_test_multiple "continue" "continue to marker 2" {
- -re "Continuing.\r\n\r\nBreakpoint.*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 $test
+ }
}
+ -re "Continuing.\r\n\r\nBreakpoint.*marker.*at.*$srcfile.*$gdb_prompt $" {
+ pass $test
+ }
}
gdb_test "tstop" "\[\r\n\]+" "stop trace experiment"
@@ -423,14 +451,24 @@ proc pending_tracepoint_with_action_resolved { trace_type } \
gdb_test "continue" "Continuing.\r\n\r\nBreakpoint.*marker.*at.*pending.c.*" \
"continue to marker 1"
- gdb_test_multiple "continue" "continue to marker 2" {
+ 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 $test
+ }
+ }
-re "Continuing.\r\n\r\nBreakpoint.*marker.*at.*$srcfile.*$gdb_prompt $" {
pass "continue to marker 2"
}
- -re ".*$gdb_prompt $" {
- kfail "gdb/13392" "continue to marker 2"
- return
- }
+
}
gdb_test "tstop" "\[\r\n\]+" "stop trace experiment"