This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: MI testsuite to use PTY for inferior
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: bob at brasko dot net
- Cc: gdb-patches at sources dot redhat dot com
- Date: Fri, 2 Sep 2005 00:11:41 +0200 (CEST)
- Subject: Re: MI testsuite to use PTY for inferior
- References: <20050727031758.GA15798@white> <200508132151.j7DLpnoR015475@elgar.sibelius.xs4all.nl> <20050819222721.GA20029@white> <20050830025203.GA16646@nevyn.them.org> <20050901005200.GA6990@white>
> Date: Wed, 31 Aug 2005 20:52:00 -0400
> From: Bob Rossi <bob@brasko.net>
>
> Index: gdb/testsuite/lib/mi-support.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
> retrieving revision 1.30
> diff -u -r1.30 mi-support.exp
> --- gdb/testsuite/lib/mi-support.exp 9 Aug 2005 19:00:16 -0000 1.30
> +++ gdb/testsuite/lib/mi-support.exp 1 Sep 2005 00:46:01 -0000
> @@ -659,7 +659,15 @@
> gdb_start
> set result -1
> }
> - -re "\[\r\n\]*($pattern)\[\r\n\]+$mi_gdb_prompt\[ \]*$" {
> + -re "\[\r\n\]*($pattern)\[\r\n\]+$mi_gdb_prompt\[ \]*" {
> + # NOTE, there is no trailing anchor because with GDB/MI,
> + # asynchronous responses can happen at any point, causing more
> + # data to be available. Normally an anchor is used to make
> + # sure the end of the output is matched, however, $mi_gdb_prompt
> + # is just as good of an anchor since mi_gdb_test is meant to
> + # match a single mi output command. If a second GDB/MI output
> + # response is sent, it will be in the buffer for the next
> + # time mi_gdb_test is called.
> if ![string match "" $message] then {
> pass "$message"
> }
>
> Basically, this passes the mi-console.exp testcase if the 'sleep 1' is
> there or not. Also, it didn't break any testcases. It changes
> mi_gdb_test to enforce the fact that only a single MI output command can
> be matched. What do you think?
Fixes the problems in mi-console.exp, but I still see the following:
403-exec-continue
403^running
(gdb)
FAIL: gdb.mi/mi-syn-frame.exp: testing exec continue
403*stopped
(gdb)
404-stack-list-frames 0 0
404^done,stack=[frame={level="0",addr="0x1c0006c8",func="main",file="../../../..
/src/gdb/gdb/testsuite/gdb.mi/mi-syn-frame.c",fullname="/home/kettenis/src/gdb/g
db/testsuite/gdb.mi/mi-syn-frame.c",line="14"}]
(gdb)
PASS: gdb.mi/mi-syn-frame.exp: list stack frames
Seems the attached patch solves those though.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* gdb.mi/mi-syn-frame.exp (my_mi_gdb_prompt): Remove. Split tests
that were using this variable.
Index: gdb.mi/mi-syn-frame.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-syn-frame.exp,v
retrieving revision 1.6
diff -u -p -r1.6 mi-syn-frame.exp
--- gdb.mi/mi-syn-frame.exp 4 Aug 2005 01:52:31 -0000 1.6
+++ gdb.mi/mi-syn-frame.exp 1 Sep 2005 22:10:47 -0000
@@ -35,8 +35,6 @@ if { [gdb_compile "${srcdir}/${subdir}/
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
-set my_mi_gdb_prompt "\\(gdb\\)\[ \]*\[\r\n\]*"
-
mi_gdb_exit
mi_gdb_start separate-inferior-tty
mi_delete_breakpoints
@@ -61,9 +59,18 @@ mi_gdb_test "402-stack-list-frames" "402
# Continue back to main()
#
mi_gdb_test "403-exec-continue" \
- "403\\^running\[\r\n\]+${my_mi_gdb_prompt}403\\\*stopped" \
- "testing exec continue" \
- "hi in foo\[\r\n\]\+"
+ "403\\^running" \
+ "testing exec continue" \
+ "hi in foo\[\r\n\]\+"
+
+gdb_expect {
+ -re "403\\*stopped.*$mi_gdb_prompt$" {
+ pass "finished exec continue"
+ }
+ timeout {
+ fail "finished exec continue (timeout)"
+ }
+}
mi_gdb_test "404-stack-list-frames 0 0" \
"404\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"\}.*\\\]" \
@@ -92,7 +99,16 @@ mi_gdb_test "407-stack-list-frames" \
mi_gdb_test "408-exec-continue" \
- "408\\^running\[\r\n\]+${my_mi_gdb_prompt}408\\\*stopped"
+ "408\\^running"
+
+gdb_expect {
+ -re "408\\*stopped.*$mi_gdb_prompt$" {
+ pass "finished exec continue"
+ }
+ timeout {
+ fail "finished exec continue (timeout)"
+ }
+}
mi_gdb_test "409-stack-list-frames 0 0" \
"409\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"main\",file=\".*mi-syn-frame.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"$decimal\"\}.*\\\]" \