From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: Re: [RFC] Merge mi-cli.exp and mi2-cli.exp
Date: Wed, 19 Sep 2012 11:22:00 -0000 [thread overview]
Message-ID: <5059AAB3.3030805@codesourcery.com> (raw)
In-Reply-To: <1346419770-5718-1-git-send-email-yao@codesourcery.com>
Hi,
Looks we have got some conclusions in this thread on MI and its tests,
- mi1 was died
- mi3 still doesn't happen
- mi2 is only what we are using
so, we are testing mi2 twice by mi-foo.exp and mi2-foo.exp. This patch
is to merge mi-cli.exp to mi2-clil.exp, and remove mi-cli.exp from
suite.
--
Yao
gdb/testsuite:
2012-09-19 Yao Qi <yao@codesourcery.com>
* gdb.mi/mi-cli.exp: Remove.
* gdb.mi/mi2-cli.exp: Merged from mi-cli.exp.
---
gdb/testsuite/gdb.mi/mi-cli.exp | 215 --------------------------------------
gdb/testsuite/gdb.mi/mi2-cli.exp | 40 +++++++-
2 files changed, 38 insertions(+), 217 deletions(-)
delete mode 100644 gdb/testsuite/gdb.mi/mi-cli.exp
diff --git a/gdb/testsuite/gdb.mi/mi-cli.exp b/gdb/testsuite/gdb.mi/mi-cli.exp
deleted file mode 100644
index f487cbd..0000000
--- a/gdb/testsuite/gdb.mi/mi-cli.exp
+++ /dev/null
@@ -1,215 +0,0 @@
-# Copyright 2002-2005, 2007-2012 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# This file tests that GDB's console can be accessed via the MI.
-# Specifically, we are testing the "interpreter-exec" command and that
-# the commands that are executed via this command are properly executed.
-# Console commands executed via MI should use MI output wrappers, MI event
-# handlers, etc.
-
-load_lib mi-support.exp
-set MIFLAGS "-i=mi"
-
-gdb_exit
-if [mi_gdb_start] {
- continue
-}
-
-standard_testfile basics.c
-
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
- untested mi-cli.exp
- return -1
-}
-
-mi_gdb_test "-interpreter-exec" \
- {\^error,msg="-interpreter-exec: Usage: -interpreter-exec interp command"} \
- "-interpreter-exec with no arguments"
-
-mi_gdb_test "-interpreter-exec console" \
- {\^error,msg="-interpreter-exec: Usage: -interpreter-exec interp command"} \
- "-interpreter-exec with one argument"
-
-mi_gdb_test "-interpreter-exec bogus command" \
- {\^error,msg="-interpreter-exec: could not find interpreter \\\"bogus\\\""} \
- "-interpreter-exec with bogus interpreter"
-
-set msg {Undefined command: \\\"bogus\\\"\. Try \\\"help\\\"\.}
-mi_gdb_test "-interpreter-exec console bogus" \
- "&\\\"$msg\\\\n\\\".*\\^error,msg=\\\"$msg\\\".*" \
- "-interpreter-exec console bogus"
-
-# NOTE: cagney/2003-02-03: Not yet.
-# mi_gdb_test "-interpreter-exec console \"file $binfile\"" \
-# {(=.*)+\^done} \
-# "-interpreter-exec console \"file \$binfile\""
-mi_gdb_test "-interpreter-exec console \"file $binfile\"" \
- {~"Reading symbols from .*mi-cli...".*done} \
- "-interpreter-exec console \"file \$binfile\""
-
-mi_run_to_main
-
-set line_main_head [gdb_get_line_number "main ("]
-set line_main_body [expr $line_main_head + 2]
-set line_main_hello [gdb_get_line_number "Hello, World!"]
-set line_main_return [expr $line_main_hello + 2]
-set line_callee4_head [gdb_get_line_number "callee4 ("]
-set line_callee4_body [expr $line_callee4_head + 2]
-set line_callee4_next [expr $line_callee4_body + 1]
-
-mi_gdb_test "-interpreter-exec console \"set args foobar\"" \
- ".*=cmd-param-changed,param=\"args\",value=\"foobar\".*\\^done" \
- "-interpreter-exec console \"set args foobar\""
-
-mi_gdb_test "-interpreter-exec console \"show args\"" \
- {\~"Argument list to give program being debugged when it is started is \\\"foobar\\\"\.\\n".*\^done} \
- "-interpreter-exec console \"show args\""
-
-# NOTE: cagney/2003-02-03: Not yet.
-# mi_gdb_test "-interpreter-exec console \"break callee4\"" \
-# {(&.*)*.*~"Breakpoint 2 at.*\\n".*=breakpoint-create,number="2".*\^done} \
-# "-interpreter-exec console \"break callee4\""
-mi_gdb_test "-interpreter-exec console \"break callee4\"" \
- {(&.*)*.*~"Breakpoint 2 at.*\\n".*\^done} \
- "-interpreter-exec console \"break callee4\""
-
-mi_gdb_test "-interpreter-exec console \"info break\"" \
- {\~"Num[ \t]*Type[ \t]*Disp[ \t]*Enb[ \t]*Address[ \t]*What\\n".*~"2[ \t]*breakpoint[ \t]*keep[ \t]*y[ \t]*0x[0-9A-Fa-f]+[ \t]*in callee4 at .*basics.c:[0-9]+\\n".*\^done} \
- "-interpreter-exec console \"info break\""
-
-mi_gdb_test "-interpreter-exec console \"set listsize 1\"" \
- ".*=cmd-param-changed,param=\"listsize\",value=\"1\".*\\^done" \
- "-interpreter-exec console \"set listsize 1\""
-
-# {.*\~"32[ \t(\\t)]*callee1.*\\n".*\^done }
-mi_gdb_test "-interpreter-exec console \"list\"" \
- ".*\~\"$line_main_body\[\\\\t \]*callee1.*;\\\\n\".*\\^done" \
- "-interpreter-exec console \"list\""
-
-mi_execute_to "exec-continue" "breakpoint-hit" "callee4" "" ".*basics.c" $line_callee4_body \
- { "" "disp=\"keep\"" } "continue to callee4"
-
-# NOTE: cagney/2003-02-03: Not yet.
-# mi_gdb_test "100-interpreter-exec console \"delete 2\"" \
-# {.*=breakpoint-delete,number=\"2\".*\^done} \
-# "-interpreter-exec console \"delete 2\""
-mi_gdb_test "100-interpreter-exec console \"delete 2\"" \
- {=breakpoint-deleted,id=\"2\"\r\n100\^done} \
- "-interpreter-exec console \"delete 2\""
-
-# NOTE: cagney/2003-02-03: Not yet.
-# mi_gdb_test "200-interpreter-exec console \"up\"" \
-# {.*=selected-frame-level-changed,level="1".*\^done} \
-# "-interpreter-exec console \"up\""
-mi_gdb_test "200-interpreter-exec console \"up\"" \
- {~"#.*".*200\^done} \
- "-interpreter-exec console \"up\""
-
-# NOTE: cagney/2003-02-03: Not yet.
-# mi_gdb_test "300-interpreter-exec console \"down\"" \
-# {.*=selected-frame-level-changed,level="0".*\^done} \
-# "-interpreter-exec console \"down\""
-mi_gdb_test "300-interpreter-exec console \"down\"" \
- {~"#.*".*300\^done} \
- "-interpreter-exec console \"down\""
-
-# NOTE: cagney/2003-02-03: Not yet.
-# mi_gdb_test "-interpreter-exec console \"frame 2\"" \
-# {.*=selected-frame-level-changed,level="2".*\^done} \
-# "-interpreter-exec console \"frame 2\""
-mi_gdb_test "400-interpreter-exec console \"frame 2\"" \
- {~"#.*".*400\^done} \
- "-interpreter-exec console \"frame 2\""
-
-# NOTE: cagney/2003-02-03: Not yet.
-# mi_gdb_test "-stack-select-frame 0" \
-# {.*=selected-frame-level-changed,level="0".*\^done} \
-# "-stack-select-frame 0"
-mi_gdb_test "500-stack-select-frame 0" \
- {500\^done} \
- "-stack-select-frame 0"
-
-# When a CLI command is entered in MI session, the respose is different in
-# sync and async modes. In sync mode normal_stop is called when current
-# interpreter is CLI. So:
-# - print_stop_reason prints stop reason in CLI uiout, and we don't show it
-# in MI
-# - The stop position is printed, and appears in MI 'console' channel.
-#
-# In async mode the stop event is processed when we're back to MI interpreter,
-# so the stop reason is printed into MI uiout an.
-if {$async} {
- set reason "end-stepping-range"
-} else {
- set reason ""
-}
-
-mi_execute_to "interpreter-exec console step" $reason "callee4" "" ".*basics.c" $line_callee4_next \
- "" "check *stopped from CLI command"
-
-# NOTE: cagney/2003-02-03: Not yet.
-# mi_gdb_test "-break-insert -t basics.c:$line_main_hello" \
-# {.*=breakpoint-create,number="3".*\^done} \
-# "-break-insert -t basics.c:\$line_main_hello"
-mi_gdb_test "600-break-insert -t basics.c:$line_main_hello" \
- {600\^done,bkpt=.number="3",type="breakpoint".*\}} \
- "-break-insert -t basics.c:\$line_main_hello"
-
-mi_execute_to "exec-continue" "breakpoint-hit" "main" "" ".*basics.c" \
- $line_main_hello { "" "disp=\"del\"" } \
- "-exec-continue to line $line_main_hello"
-
-# Test that the token is output even for CLI commands
-# Also test that *stopped includes frame information.
-mi_gdb_test "34 next" \
- ".*34\\\^running.*\\*running,thread-id=\"all\"" \
- "34 next: run"
-
-if {!$async} {
- gdb_expect {
- -re "~\[^\r\n\]+\r\n" {
- }
- }
-}
-
-# Note that the output does not include stop reason. This is fine.
-# The purpose of *stopped notification for CLI command is to make
-# sure that frontend knows that inferior is stopped, and knows where.
-# Supplementary information is not necessary.
-mi_expect_stop "$reason" "main" "" ".*basics.c" $line_main_return "" \
- "34 next: stop"
-
-mi_gdb_test "-interpreter-exec console \"list\"" \
- "\~\"$line_main_return\[\\\\t ]*callme \\(1\\);\\\\n\".*\\^done" \
- "-interpreter-exec console \"list\" at basics.c:\$line_main_return"
-
-mi_gdb_test "-interpreter-exec console \"help set args\"" \
- {\~"Set argument list to give program being debugged when it is started\.\\nFollow this command with any number of args, to be passed to the program\.".*\^done} \
- "-interpreter-exec console \"help set args\""
-
-# NOTE: cagney/2003-02-03: Not yet.
-# mi_gdb_test "-interpreter-exec console \"set \$pc=0x0\"" \
-# {.*=target-changed.*\^done} \
-# "-interpreter-exec console \"set \$pc=0x0\""
-mi_gdb_test "888-interpreter-exec console \"set \$pc=0x0\"" \
- {888\^done} \
- "-interpreter-exec console \"set \$pc=0x0\""
-
-#mi_gdb_test "-interpreter-exec console \"\"" \
- {} \
- "-interpreter-exec console \"\""
-
-mi_gdb_exit
-return 0
diff --git a/gdb/testsuite/gdb.mi/mi2-cli.exp b/gdb/testsuite/gdb.mi/mi2-cli.exp
index 9ab7518..73a79b5 100644
--- a/gdb/testsuite/gdb.mi/mi2-cli.exp
+++ b/gdb/testsuite/gdb.mi/mi2-cli.exp
@@ -67,6 +67,7 @@ set line_main_hello [gdb_get_line_number "Hello, World!"]
set line_main_return [expr $line_main_hello + 2]
set line_callee4_head [gdb_get_line_number "callee4 ("]
set line_callee4_body [expr $line_callee4_head + 2]
+set line_callee4_next [expr $line_callee4_body + 1]
mi_gdb_test "-interpreter-exec console \"set args foobar\"" \
".*=cmd-param-changed,param=\"args\",value=\"foobar\".*\\^done" \
@@ -141,6 +142,24 @@ mi_gdb_test "500-stack-select-frame 0" \
{500\^done} \
"-stack-select-frame 0"
+# When a CLI command is entered in MI session, the respose is different in
+# sync and async modes. In sync mode normal_stop is called when current
+# interpreter is CLI. So:
+# - print_stop_reason prints stop reason in CLI uiout, and we don't show it
+# in MI
+# - The stop position is printed, and appears in MI 'console' channel.
+#
+# In async mode the stop event is processed when we're back to MI interpreter,
+# so the stop reason is printed into MI uiout an.
+if {$async} {
+ set reason "end-stepping-range"
+} else {
+ set reason ""
+}
+
+mi_execute_to "interpreter-exec console step" $reason "callee4" "" ".*basics.c" $line_callee4_next \
+ "" "check *stopped from CLI command"
+
# NOTE: cagney/2003-02-03: Not yet.
# mi_gdb_test "-break-insert -t basics.c:$line_main_hello" \
# {.*=breakpoint-create,number="3".*\^done} \
@@ -153,8 +172,25 @@ mi_execute_to "exec-continue" "breakpoint-hit" "main" "" ".*basics.c" \
$line_main_hello { "" "disp=\"del\"" } \
"-exec-continue to line $line_main_hello"
-mi_execute_to "exec-next" "end-stepping-range" "main" "" ".*basics.c" $line_main_return "" \
- "-exec-next to line $line_main_return"
+# Test that the token is output even for CLI commands
+# Also test that *stopped includes frame information.
+mi_gdb_test "34 next" \
+ ".*34\\\^running.*\\*running,thread-id=\"all\"" \
+ "34 next: run"
+
+if {!$async} {
+ gdb_expect {
+ -re "~\[^\r\n\]+\r\n" {
+ }
+ }
+}
+
+# Note that the output does not include stop reason. This is fine.
+# The purpose of *stopped notification for CLI command is to make
+# sure that frontend knows that inferior is stopped, and knows where.
+# Supplementary information is not necessary.
+mi_expect_stop "$reason" "main" "" ".*basics.c" $line_main_return "" \
+ "34 next: stop"
mi_gdb_test "-interpreter-exec console \"list\"" \
"\~\"$line_main_return\[\\\\t ]*callme \\(1\\);\\\\n\".*\\^done" \
--
1.7.7.6
next prev parent reply other threads:[~2012-09-19 11:22 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-31 13:29 Yao Qi
2012-09-03 9:08 ` Vladimir Prus
2012-09-03 15:55 ` Yao Qi
2012-09-05 0:29 ` Stan Shebs
2012-09-10 20:09 ` Tom Tromey
2012-09-11 15:15 ` Pedro Alves
2012-09-11 21:53 ` Stan Shebs
2012-09-12 15:28 ` Pedro Alves
2012-09-12 13:59 ` Yao Qi
2012-09-19 11:22 ` Yao Qi [this message]
2012-09-19 13:47 ` Pedro Alves
2012-09-21 8:40 ` Yao Qi
2012-09-28 0:04 ` [PATCH 0/11] Cleanup MI test cases Yao Qi
2012-09-28 0:04 ` [PATCH 02/11] mi-var-block.exp Yao Qi
2012-09-28 0:04 ` [PATCH 05/11] mi-pthreads.exp Yao Qi
2012-09-28 0:05 ` [PATCH 07/11] mi-var-cmd.exp Yao Qi
2012-09-28 0:05 ` [PATCH 10/11] mi-stack.exp Yao Qi
2012-09-28 0:05 ` [PATCH 04/11] mi-basics.exp Yao Qi
2012-09-28 0:05 ` [PATCH 03/11] mi-file.exp Yao Qi
2012-09-28 0:05 ` [PATCH 08/11] mi-var-display.exp Yao Qi
2012-09-28 0:05 ` [PATCH 09/11] mi-console.exp Yao Qi
2012-09-28 0:05 ` [PATCH 06/11] mi-break.exp Yao Qi
2012-09-28 0:05 ` [PATCH 01/11] Remove mi-FOO.exp which are identical to mi2-FOO.exp Yao Qi
2012-09-28 0:05 ` [PATCH 11/11] mi-syn-frame.exp Yao Qi
2012-09-28 19:36 ` [PATCH 0/11] Cleanup MI test cases Pedro Alves
2012-10-12 9:47 ` Yao Qi
2012-10-12 10:05 ` Pedro Alves
2012-10-14 12:25 ` [committed] : " Yao Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5059AAB3.3030805@codesourcery.com \
--to=yao@codesourcery.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox