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]

have gdb.trace/collection.exp catch bytecode generator warnings


The tracepoint bytecode generator isn't perfect, and in several cases,
it doesn't know what to do with its input, just prints a warning to
the user, and proceeds anyway.  For example, a user has seen this one:

 (gdb) tstart
 W: don't know symbol class 8
 (gdb) 

Appart being a pretty cryptic notice, the issue was that
W was just a struct definition local to a function that had
a tracepoint with a "collect $locals" action set, and,
there's a part of the bytecode generator that doesn't
know to skip those symbols properly, but knows to print
that note, pointing out that something was not quite right.

A good place for a test that covers this bug would
be gdb.trace/collection.exp, but before that, I think
it's worth it to make the test catch any output
not-the-prompt after tstart, so that these warnings don't
go silently unnoticed.

Hence this patch.  I've applied it.

-- 
Pedro Alves

2010-03-29  Pedro Alves  <pedro@codesourcery.com>

	gdb/testsuite/
	* gdb.trace/collection.exp (run_trace_experiment): Make sure
	"tstart" is silent.

---
 gdb/testsuite/gdb.trace/collection.exp |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

Index: src/gdb/testsuite/gdb.trace/collection.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.trace/collection.exp	2010-03-29 01:07:37.000000000 +0100
+++ src/gdb/testsuite/gdb.trace/collection.exp	2010-03-29 01:28:18.000000000 +0100
@@ -93,13 +93,19 @@ proc prepare_for_trace_test {} {
 }
 
 proc run_trace_experiment { msg test_func } {
+    global gdb_prompt
+
     gdb_test "continue" \
 	".*Breakpoint \[0-9\]+, begin .*" \
 	"collect $msg: advance to begin"
 
-    gdb_test "tstart" \
-	    "\[\r\n\]+" \
-	    "collect $msg: start trace experiment"
+    set test "collect $msg: start trace experiment"
+    gdb_test_multiple "tstart" "$test" {
+	-re "^tstart\r\n$gdb_prompt $" {
+	    pass "$test"
+	}
+    }
+
     gdb_test "continue" \
 	    "Continuing.*Breakpoint \[0-9\]+, end.*" \
 	    "collect $msg: run trace experiment"


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