public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* have gdb.trace/collection.exp catch bytecode generator warnings
@ 2010-03-29  0:48 Pedro Alves
  0 siblings, 0 replies; only message in thread
From: Pedro Alves @ 2010-03-29  0:48 UTC (permalink / raw)
  To: gdb-patches

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"

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-03-29  0:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-29  0:48 have gdb.trace/collection.exp catch bytecode generator warnings Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).