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]

[PATCH] gdb.trace/circ.exp: FAIL: maint packet QTBuffer:size:ffffffff, with the extended-remote board


I'm applying the patch below.

Running the gdb.trace/circ.exp test against the
native-extended-gdbserver board, I see:

 Running ../../../src/gdb/testsuite/gdb.trace/circ.exp ...
 FAIL: gdb.trace/circ.exp: maint packet QTBuffer:size:ffffffff

In gdb.log we see:

 (gdb) maint packet QTBuffer:size:ffffffff
 sending: "QTBuffer:size:ffffffff"
 received: "E01"
 (gdb) FAIL: gdb.trace/circ.exp: maint packet QTBuffer:size:ffffffff

QTBuffer:size is an undocumented packet, and gdbserver does not
support it.  It is meant to change the trace buffer size.  I guess it
was implemented in the old stub tracepoints were originally written
for.  We'll probably end up supporting it, or something like it, at
some point.

When we run this test against target remote gdbserver, we see:

 Running target native-gdbserver
 Running ../../../src/gdb/testsuite/gdb.trace/circ.exp ...
 PASS: gdb.trace/circ.exp: set circular-trace-buffer on
 PASS: gdb.trace/circ.exp: show circular-trace-buffer (on)
 PASS: gdb.trace/circ.exp: set circular-trace-buffer off
 PASS: gdb.trace/circ.exp: show circular-trace-buffer (off)
 PASS: gdb.trace/circ.exp: Current target does not support trace

                 === gdb Summary ===

 # of expected passes            5

and in gdb.log, we see:

 (gdb) PASS: gdb.trace/circ.exp: show circular-trace-buffer (off)
 tstatus
 Trace can not be run on this target.
 (gdb) PASS: gdb.trace/circ.exp: Current target does not support trace
 tfind none


This patch makes us not FAIL due to unsupported functionality, but
instead issue UNSUPPORTED.

2012-02-15  Pedro Alves  <palves@redhat.com>

	* gdb.trace/circ.exp (trace_buffer_normal): Rewrite using
	gdb_test_multiple, and call unsupported instead of fail, if the
	remote side does not support the request.
---
 gdb/testsuite/gdb.trace/circ.exp |   34 ++++++++++++++++++++++++++++------
 1 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/gdb/testsuite/gdb.trace/circ.exp b/gdb/testsuite/gdb.trace/circ.exp
index 61a5235..4344beb 100644
--- a/gdb/testsuite/gdb.trace/circ.exp
+++ b/gdb/testsuite/gdb.trace/circ.exp
@@ -88,16 +88,38 @@ proc setup_tracepoints { } {
 
 # return 0 for success, 1 for failure
 proc trace_buffer_normal { } {
-    if [gdb_test "maint packet QTBuffer:size:ffffffff" \
-	    "received: .OK." ""] then { 
-	pass "This test cannot be run on this target"
+    global gdb_prompt
+
+    set ok 0
+    set test "maint packet QTBuffer:size:ffffffff"
+    gdb_test_multiple $test $test {
+	-re "received: .OK.\r\n$gdb_prompt $" {
+	    set ok 1
+	    pass $test
+	}
+	-re "\r\n$gdb_prompt $" {
+	}
+    }
+    if { !$ok } {
+	unsupported $test
 	return 1;
     }
-    if [gdb_test "maint packet QTBuffer:circular:0" \
-	    "received: .OK." ""] then { 
-	pass "This test cannot be run on this target"
+
+    set ok 0
+    set test "maint packet QTBuffer:circular:0"
+    gdb_test_multiple $test $test {
+	-re "received: .OK.\r\n$gdb_prompt $" {
+	    set ok 1
+	    pass $test
+	}
+	-re "\r\n$gdb_prompt $" {
+	}
+    }
+    if { !$ok } {
+	unsupported $test
 	return 1;
     }
+
     return 0;
 }
 


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