aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2012-12-08 11:58:01 +0000
committerYao Qi <yao@codesourcery.com>2012-12-08 11:58:01 +0000
commitf0b6d50a0c31941cba04926e755efedc06d538a2 (patch)
treed4b8cf74f9a1a60fad0841556f5ce58112b8be40 /gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp
parent53ab32d837176766b2b3962914f0ba54dc1bd0eb (diff)
downloadgdb-f0b6d50a0c31941cba04926e755efedc06d538a2.zip
gdb-f0b6d50a0c31941cba04926e755efedc06d538a2.tar.gz
gdb-f0b6d50a0c31941cba04926e755efedc06d538a2.tar.bz2
gdb/testsuite
2012-12-08 Yao Qi <yao@codesourcery.com> Pedro Alves <palves@redhat.com> * gdb.trace/mi-tracepoint-changed.exp (test_reconnect): Test '=breakpoint-created' when GDB merges the tracepoints of both sides.
Diffstat (limited to 'gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp')
-rw-r--r--gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp36
1 files changed, 34 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp b/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp
index aa386bb..2913b12 100644
--- a/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp
+++ b/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp
@@ -68,8 +68,12 @@ proc test_reconnect { } { with_test_prefix "reconnect" {
fail "Can't run to main"
return 0
}
+ # Create tracepoints on marker and main, and leave them in the
+ # remote stub.
gdb_test "trace marker" "Tracepoint.*at.* file .*" \
- "tracepointpoint on marker"
+ "tracepoint on marker"
+ gdb_test "trace main" "Tracepoint.*at.* file .*" \
+ "tracepoint on main"
gdb_test_no_output "tstart" "start trace experiment"
set test "disconnect"
@@ -102,18 +106,46 @@ proc test_reconnect { } { with_test_prefix "reconnect" {
global gdbserver_protocol
global gdbserver_gdbport
+ # Create tracepoints on marker and pendfunc2.
+ mi_gdb_test "-break-insert -a -f pendfunc2" \
+ {.*\^done,bkpt=.*addr=\"<PENDING>\".*} \
+ "insert tracepoint on pendfunc2"
+ mi_gdb_test "-break-insert -a marker" {.*\^done,bkpt=.*\".*} \
+ "insert tracepoint on marker"
+
+ # Connect to the remote stub again, and make sure GDB merges the
+ # tracepoints of both sides correctly.
send_gdb "47-target-select $gdbserver_protocol $gdbserver_gdbport\n"
global mi_gdb_prompt
set test "tracepoint created"
gdb_expect {
- -re "=breakpoint-created,bkpt=\{number=\"1\",type=\"tracepoint\",disp=\"keep\",enabled=\"y\",.*,func=\"marker\".*${mi_gdb_prompt}" {
+ -re "=breakpoint-created,bkpt=\{number=\"1\",type=\"tracepoint\"" {
+ # Tracepoint 1 in GDB, which has already existed before
+ # connecting, should have been merged with a tracepoint on
+ # the target, so we shouldn't see a =breakpoint-created
+ # notification for it.
+ fail "$test: 1"
+ exp_continue
+ }
+ -re "=breakpoint-created,bkpt=\{number=\"2\",type=\"tracepoint\"" {
+ # Similar to above.
+ fail "$test: 2"
+ exp_continue
+ }
+ -re "=breakpoint-created,bkpt=\{number=\"3\",type=\"tracepoint\",disp=\"keep\",enabled=\"y\",.*,func=\"main\".*${mi_gdb_prompt}" {
+ # A tracepoint on main was defined in the stub, not in GDB,
+ # so we should see a =breakpoint-created notification.
pass $test
}
timeout {
fail $test
}
}
+ # Check that tracepoint 1 is still pending.
+ mi_gdb_test "-break-info 1" \
+ {.*\^done,BreakpointTable=.*addr=\"<PENDING>\".*} \
+ "break-info 1"
set gdbserver_reconnect_p 0
}}