This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 5/6] Test tracepoints are installed or not


On 12/07/2012 10:20 PM, Pedro Alves wrote:
>> When pending tracepoint is resolved, breakpoint_modified observer is notified, and then, when tracepoint is downloaded, the breakpoint_modified observer is notified again.
> Okay.  Could you add a comment mentioning this in the test?

Sure.  Comments are added in the new version.

-- 
Yao (éå)

gdb/testsuite:

2012-12-09  Yao Qi  <yao@codesourcery.com>

	* gdb.trace/mi-tracepoint-changed.exp (test_pending_resolved): Check
	'installed' field in '=breakpoint-modified'.
	(test_reconnect): Check 'installed' field in
	'=breakpoint-modified' and '=breakpoint-created'.
---
 gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp b/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp
index 2913b12..5955b58 100644
--- a/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp
+++ b/gdb/testsuite/gdb.trace/mi-tracepoint-changed.exp
@@ -133,10 +133,20 @@ proc test_reconnect { } { with_test_prefix "reconnect" {
 	    fail "$test: 2"
 	    exp_continue
 	}
-	-re "=breakpoint-created,bkpt=\{number=\"3\",type=\"tracepoint\",disp=\"keep\",enabled=\"y\",.*,func=\"main\".*${mi_gdb_prompt}" {
+	-re "=breakpoint-created,bkpt=\{number=\"3\",type=\"tracepoint\",disp=\"keep\",enabled=\"y\",.*,func=\"main\".*installed=\"y\"" {
 	    # A tracepoint on main was defined in the stub, not in GDB,
 	    # so we should see a =breakpoint-created notification.
 	    pass $test
+	    exp_continue
+	}
+	-re "=breakpoint-modified,bkpt=\{number=\"2\".*,func=\"marker\".*installed=\"y\"" {
+	    # Tracepoint on marker is defined.  After the sync, we
+	    # know that the tracepoint is in remote stub.  Mark it
+	    # 'installed'.
+	    pass "tracepoint on marker is installed"
+	    exp_continue
+	}
+	-re ".*${mi_gdb_prompt}" {
 	}
 	timeout {
 	    fail $test
@@ -189,9 +199,16 @@ proc test_pending_resolved { } { with_test_prefix "pending resolved" {
     mi_send_resuming_command "exec-continue" "continuing execution to marker 1"
 
     set test "tracepoint on pendfunc2 resolved"
+    # It is expected to get two "=breakpoint-modified" notifications.
     gdb_expect {
-	-re ".*=breakpoint-modified,bkpt=\{number=\"1\",type=\"tracepoint\".*.*times=\"0\"" {
+	-re "=breakpoint-modified,bkpt=\{number=\"1\",type=\"tracepoint\".*.*times=\"0\".*installed=\"n\"" {
+	    # Pending tracepoint is resolved.
 	    pass "$test"
+	    exp_continue
+	}
+	-re "=breakpoint-modified,bkpt=\{number=\"1\",type=\"tracepoint\".*.*times=\"0\".*installed=\"y\"" {
+	    # Resolved tracepoint is installed.
+	    pass "tracepoint on pendfunc2 installed"
 	}
 	-re ".*${mi_gdb_prompt}$" {
 	    fail $test
-- 
1.7.7.6



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]