Re: [PATCH v3] Add a 'starti' command.

John Baldwin
2017-11-15T20:11:54Z

On Friday, November 03, 2017 01:00:18 PM Yao Qi wrote:
> John Baldwin <jhb@FreeBSD.org> writes:
>
> > +# Continue to the start of main(). The constructor should have run so
> > +# 'x' should be 1.
> > +
> > +gdb_breakpoint main
> > +gdb_test_sequence "continue" "" {
> > + "\\$2 = 1"
> > + ".*Breakpoint .*main \\(\\) at .*starti.c.*"
>
> Here is a test failure, captured by buildbot,
> https://sourceware.org/ml/gdb-testers/2017-q3/msg04381.html
>
> (gdb) gdb_expect_list pattern: /\$2 = 1/
> continue^M
> Continuing.^M
> $2 = 1^M
> gdb_expect_list pattern: /.*Breakpoint .*main \(\) at .*starti.c.*/
> ^M
> Breakpoint 1, Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing: ^M
> main () at /home/yao/SourceCode/gnu/gdb/git/gdb/testsuite/gdb.base/starti.c:29^M
> 29 return 0;^M
> (gdb) gdb_expect_list pattern: //
> FAIL: gdb.base/starti.exp: continue (pattern 3 + sentinel) (timeout)
>
> Can you take a look?

Hmm, so it seems the python exception adds a newline which throws the regex
match off as 'main \(\)' is now on a second line. The 'start.exp' test
only looks for the 'main' bit and not the preceding 'Breakpoint', so
something like this instead?

commit ec4df1376eee46840faa5857ed6fb497df2e7a69
Author: John Baldwin <jhb@FreeBSD.org>
Date: Wed Nov 15 12:08:13 2017 -0800

Relax final regex in starti.exp test.

Python exceptions from unwinders can interrupt the output between
'Breakpoint <n>' and the function name, so use a simpler regex that
only looks for the function name and filename similar to the regex
used in start.exp.

gdb/testsuite/ChangeLog:

* gdb.base/starti.exp ("continue" test): Loosen regex.

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index bb8dd7923d..601b43cde2 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2017-11-15 John Baldwin <jhb@FreeBSD.org>
+
+ * gdb.base/starti.exp ("continue" test): Loosen regex.
+
2017-11-15 Simon Marchi <simon.marchi@ericsson.com>

* gdb.tui/completionn.exp (test_tab_completion): Add space in
diff --git a/gdb/testsuite/gdb.base/starti.exp b/gdb/testsuite/gdb.base/starti.exp
index 98167ce5c7..78d092e5fd 100644
--- a/gdb/testsuite/gdb.base/starti.exp
+++ b/gdb/testsuite/gdb.base/starti.exp
@@ -47,5 +47,5 @@ gdb_test_sequence "" "starti" {
gdb_breakpoint main
gdb_test_sequence "continue" "" {
"\\$2 = 1"
- ".*Breakpoint .*main \\(\\) at .*starti.c.*"
+ "main \\(\\) at .*starti.c.*"
}

--
John Baldwin