This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] testsuite: Race fix: gdb.trace/ftrace.exp gdb_test_multiple (PR 12649) [Re: [commit] testsuite: Races fix: gdb.trace/* gdb_test_multiple (PR 12649)]
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Stan Shebs <stanshebs at earthlink dot net>
- Date: Sun, 11 Dec 2011 00:11:29 +0100
- Subject: [commit] testsuite: Race fix: gdb.trace/ftrace.exp gdb_test_multiple (PR 12649) [Re: [commit] testsuite: Races fix: gdb.trace/* gdb_test_multiple (PR 12649)]
- References: <20111202124420.GA7385@host2.jankratochvil.net>
Hi,
gdb_test_multiple does not expect final `\r\n$gdb_prompt $' (like gdb_test
does) which leads to races like:
ftrace four_byter
-Fast tracepoint 5 at 0x804850a: file gdb/testsuite/gdb.trace/ftrace.c, line 52.
-(gdb) PASS: gdb.trace/ftrace.exp: 4-byte fast tracepoint is set
+Fast tracepoint 5 at 0x804850a: file gdb/testsuite/gdb.trace/ftrace.c, line 52.PASS: gdb.trace/ftrace.exp: 4-byte fast tracepoint is set
+actions
+
+(gdb) PASS: gdb.trace/ftrace.exp: collect at four_byter: define actions
actions
Enter actions for tracepoint 5, one per line.
End with a line saying just "end".
->collect globvar, anarg
->end
-(gdb) PASS: gdb.trace/ftrace.exp: collect at four_byter: define actions
-continue
-Continuing.
-
-Breakpoint 2, begin () at gdb/testsuite/gdb.trace/ftrace.c:28
-28 {}
-(gdb) PASS: gdb.trace/ftrace.exp: advance to trace begin
+>continue
+`continue' is not a supported tracepoint action.
+(gdb) FAIL: gdb.trace/ftrace.exp: advance to trace begin
Checked in. Tested on x86_64-fedora16-linux-gnu. It is like the previous
patch, just this testcase runs only for i686 targets and due to the build it
does not get executed for x86_64-m32 so only for native i686 targets.
Regards,
Jan
http://sourceware.org/ml/gdb-cvs/2011-12/msg00085.html
--- src/gdb/testsuite/ChangeLog 2011/12/10 15:58:14 1.2975
+++ src/gdb/testsuite/ChangeLog 2011/12/10 23:05:08 1.2976
@@ -1,5 +1,11 @@
2011-12-10 Jan Kratochvil <jan.kratochvil@redhat.com>
+ PR testsuite/12649
+ * gdb.trace/ftrace.exp (test_fast_tracepoints): Import gdb_prompt.
+ Protect gdb_test_multiple by final $gdb_prompt match.
+
+2011-12-10 Jan Kratochvil <jan.kratochvil@redhat.com>
+
* gdb.cp/static-method.exp (have_gcc_45682_fixed, info addr A::func()):
New variable, new test.
(list static-method.cc:xxx::(anonymous namespace)::A::func)
--- src/gdb/testsuite/gdb.trace/ftrace.exp 2011/11/14 20:07:25 1.1
+++ src/gdb/testsuite/gdb.trace/ftrace.exp 2011/12/10 23:05:08 1.2
@@ -76,6 +76,7 @@
}
proc test_fast_tracepoints {} {
+ global gdb_prompt
set fourgood 0
@@ -111,10 +112,10 @@
}
gdb_test_multiple "ftrace four_byter" "set 4-byte fast tracepoint" {
- -re "May not have a fast tracepoint at .*" {
+ -re "May not have a fast tracepoint at .*\r\n$gdb_prompt $" {
pass "4-byte fast tracepoint could not be set"
}
- -re "Fast tracepoint .*" {
+ -re "Fast tracepoint .*\r\n$gdb_prompt $" {
pass "4-byte fast tracepoint is set"
set fourgood 1
}