From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8302 invoked by alias); 6 Aug 2012 15:48:03 -0000 Received: (qmail 8274 invoked by uid 22791); 6 Aug 2012 15:48:01 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 06 Aug 2012 15:47:48 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1SyPX1-0004ca-FB from Yao_Qi@mentor.com ; Mon, 06 Aug 2012 08:47:47 -0700 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 6 Aug 2012 08:47:47 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.1.289.1; Mon, 6 Aug 2012 08:47:46 -0700 From: Yao Qi To: CC: Tom Tromey Subject: Re: [PATCH 3/3] test case Date: Mon, 06 Aug 2012 15:48:00 -0000 Message-ID: <2510564.KTj9X6l9jh@qiyao.dyndns.org> User-Agent: KMail/4.8.3 (Linux/3.3.7-1.fc16.i686; KDE/4.8.3; i686; ; ) In-Reply-To: <87r4rnnafw.fsf@fleche.redhat.com> References: <1343992904-9375-1-git-send-email-yao@codesourcery.com> <1343992904-9375-4-git-send-email-yao@codesourcery.com> <87r4rnnafw.fsf@fleche.redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-08/txt/msg00183.txt.bz2 On Friday, August 03, 2012 11:37:39 AM Tom Tromey wrote: > This looks good but I did not see a test for abbreviated multi-word > commands, and I think that would be a useful addition. Right, a test for a abbreviated multi-word is added. + # Full command parameters are included in the notification when a + # abbreviated one is typed. + mi_gdb_test "set ch type on" \ + ".*=3Dcmd-param-changed,param=3D\"check type\",value=3D\"on\".*\\^done" \ + "\"set ch type on\"" Except this, there is no other changes. --=20 Yao (=E9=BD=90=E5=B0=A7) gdb/testsuite: 2012-08-06 Yao Qi * gdb.mi/mi-cmd-param-changed.exp: New. * gdb.mi/mi-cli.exp: Update for MI notification "=3Dcmd-param-changed". * gdb.mi/mi-var-rtti.exp, gdb.mi/mi2-cli.exp: Likewise. * gdb.mi/mi2-prompt.exp: Likewise. --- gdb/testsuite/gdb.mi/mi-cli.exp | 4 +- gdb/testsuite/gdb.mi/mi-cmd-param-changed.exp | 103 +++++++++++++++++++++= ++++ gdb/testsuite/gdb.mi/mi-var-rtti.exp | 2 +- gdb/testsuite/gdb.mi/mi2-cli.exp | 4 +- gdb/testsuite/gdb.mi/mi2-prompt.exp | 5 +- 5 files changed, 111 insertions(+), 7 deletions(-) create mode 100644 gdb/testsuite/gdb.mi/mi-cmd-param-changed.exp diff --git a/gdb/testsuite/gdb.mi/mi-cli.exp b/gdb/testsuite/gdb.mi/mi-cli.= exp index b7abbc7..f487cbd 100644 --- a/gdb/testsuite/gdb.mi/mi-cli.exp +++ b/gdb/testsuite/gdb.mi/mi-cli.exp @@ -70,7 +70,7 @@ set line_callee4_body [expr $line_callee4_head + 2] set line_callee4_next [expr $line_callee4_body + 1] =20 mi_gdb_test "-interpreter-exec console \"set args foobar\"" \ - {\^done} \ + ".*=3Dcmd-param-changed,param=3D\"args\",value=3D\"foobar\".*\\^done" \ "-interpreter-exec console \"set args foobar\"" =20 mi_gdb_test "-interpreter-exec console \"show args\"" \ @@ -90,7 +90,7 @@ mi_gdb_test "-interpreter-exec console \"info break\"" \ "-interpreter-exec console \"info break\"" =20 mi_gdb_test "-interpreter-exec console \"set listsize 1\"" \ - {\^done} \ + ".*=3Dcmd-param-changed,param=3D\"listsize\",value=3D\"1\".*\\^done" \ "-interpreter-exec console \"set listsize 1\"" =20 # {.*\~"32[ \t(\\t)]*callee1.*\\n".*\^done } diff --git a/gdb/testsuite/gdb.mi/mi-cmd-param-changed.exp b/gdb/testsuite/= gdb.mi/mi-cmd-param-changed.exp new file mode 100644 index 0000000..8c2195c --- /dev/null +++ b/gdb/testsuite/gdb.mi/mi-cmd-param-changed.exp @@ -0,0 +1,103 @@ +# Copyright 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 . + +load_lib mi-support.exp +set MIFLAGS "-i=3Dmi" + +standard_testfile basics.c + +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executabl= e {debug}] !=3D "" } { + untested mi-cmd-param-changed.exp + return -1 +} + +proc test_command_param_changed { } { with_test_prefix "cmd param" { + if [mi_gdb_start] { + return + } + mi_run_to_main + + foreach opt { "on" "off" "step" } { + mi_gdb_test "set scheduler-locking ${opt}" \ + ".*=3Dcmd-param-changed,param=3D\"scheduler-locking\",value=3D\"${opt= }\".*\\^done" \ + "\"set scheduler-locking ${opt}\"" + } + foreach opt { "on" "off" "step" } { + mi_gdb_test "interpreter-exec console \"set scheduler-locking ${opt}\"" \ + ".*=3Dcmd-param-changed,param=3D\"scheduler-locking\",value=3D\"${opt= }\".*\\^done" \ + "interpreter-exec \"set scheduler-locking ${opt}\"" + } + # Don't emit MI notification for request from MI. + mi_gdb_test "-gdb-set scheduler-locking on" \ + {\^done} \ + "\"set scheduler-locking on\" no event (requested by MI)" + + mi_gdb_test "interpreter-exec mi \"-gdb-set scheduler-locking step\"" \ + "\\&\"interpreter-exec mi .*\"-gdb-set scheduler-locking step.*\"\\\\n\"\= r\n\\^done\r\n\\^done" \ + "\"set scheduler-locking step\" no event (requested by MI interp)" + mi_gdb_test "set scheduler-locking step" \ + "\\&\"set scheduler-locking step\\\\n\"\r\n\\^done" \ + "\"set scheduler-locking stepr\" no event" + + + foreach command { "circular-trace-buffer" "check type" } { + + # The default value of each command option may be different, so we first + # set it to 'off', and this may or may not trigger MI notification. + mi_gdb_test "set ${command} off" ".*\\^done" "\"set ${command}\" warmup" + + foreach boolean_opt { "on" "off" } { + mi_gdb_test "set ${command} ${boolean_opt}" \ + ".*=3Dcmd-param-changed,param=3D\"${command}\",value=3D\"${boolean_opt}\= ".*\\^done" \ + "\"set ${command} ${boolean_opt}\"" + } + mi_gdb_test "set ${command} off" \ + "\\&\"set ${command} off\\\\n\"\r\n\\^done" \ + "\"set ${command}\" no event" + } + + + foreach command { "trace-notes" "remote exec-file" } { + foreach str_opt { "foo" "bar" } { + mi_gdb_test "set ${command} ${str_opt}" \ + ".*=3Dcmd-param-changed,param=3D\"${command}\",value=3D\"${str_opt}\".*\= \^done" \ + "\"set ${command} ${str_opt}\"" + } + mi_gdb_test "set ${command} bar" \ + "\\&\"set ${command} bar\\\\n\"\r\n(\\&\"warning.*|)\\^done" \ + "\"set ${command} bar\" no event" + } + + # No notification is emitted for 'maint set' commands. + foreach command { "profile" "show-debug-regs" } { + foreach boolean_opt { "on" "off" } { + mi_gdb_test "maint set ${command} ${boolean_opt}" \ + "\\&\"maint set ${command} ${boolean_opt}\\\\n\"\r\n\\^done" \ + "\"maint set ${command} ${boolean_opt}\"" + } + } + + # Full command parameters are included in the notification when a + # abbreviated one is typed. + mi_gdb_test "set ch type on" \ + ".*=3Dcmd-param-changed,param=3D\"check type\",value=3D\"on\".*\\^done" \ + "\"set ch type on\"" + + mi_gdb_exit +}} + +test_command_param_changed + +return 0 diff --git a/gdb/testsuite/gdb.mi/mi-var-rtti.exp b/gdb/testsuite/gdb.mi/mi= -var-rtti.exp index a718ffb..dc2f922 100644 --- a/gdb/testsuite/gdb.mi/mi-var-rtti.exp +++ b/gdb/testsuite/gdb.mi/mi-var-rtti.exp @@ -37,7 +37,7 @@ mi_prepare_inline_tests $srcfile # Enable using RTTI to determine real types of the objects proc set_print_object {state testname} { mi_gdb_test "-interpreter-exec console \"set print object ${state}\"" \ - {\^done} \ + "(.*=3Dcmd-param-changed,param=3D\"print object\",value=3D\"${state}\".*|= )\\^done" \ "-interpreter-exec console \"set print object ${state}\" in $testn= ame" } =20 diff --git a/gdb/testsuite/gdb.mi/mi2-cli.exp b/gdb/testsuite/gdb.mi/mi2-cl= i.exp index e84b191..9ab7518 100644 --- a/gdb/testsuite/gdb.mi/mi2-cli.exp +++ b/gdb/testsuite/gdb.mi/mi2-cli.exp @@ -69,7 +69,7 @@ set line_callee4_head [gdb_get_line_number "callee4 ("] set line_callee4_body [expr $line_callee4_head + 2] =20 mi_gdb_test "-interpreter-exec console \"set args foobar\"" \ - {\^done} \ + ".*=3Dcmd-param-changed,param=3D\"args\",value=3D\"foobar\".*\\^done" \ "-interpreter-exec console \"set args foobar\"" =20 mi_gdb_test "-interpreter-exec console \"show args\"" \ @@ -89,7 +89,7 @@ mi_gdb_test "-interpreter-exec console \"info break\"" \ "-interpreter-exec console \"info break\"" =20 mi_gdb_test "-interpreter-exec console \"set listsize 1\"" \ - {\^done} \ + ".*=3Dcmd-param-changed,param=3D\"listsize\",value=3D\"1\".*\\^done" \ "-interpreter-exec console \"set listsize 1\"" =20 # {.*\~"32[ \t(\\t)]*callee1.*\\n".*\^done } diff --git a/gdb/testsuite/gdb.mi/mi2-prompt.exp b/gdb/testsuite/gdb.mi/mi2= -prompt.exp index 6145c38..eb9edec 100644 --- a/gdb/testsuite/gdb.mi/mi2-prompt.exp +++ b/gdb/testsuite/gdb.mi/mi2-prompt.exp @@ -23,8 +23,9 @@ if [mi_gdb_start] { =20 # Check console 'set prompt' does not affect the MI output. =20 -mi_gdb_test {-interpreter-exec console "set prompt (banana) "} {\^done} \ - "console set prompt" +mi_gdb_test {-interpreter-exec console "set prompt (banana) "} \ + ".*=3Dcmd-param-changed,param=3D\"prompt\",value=3D\"\\(banana\\) \".*= \\^done" \ + "console set prompt" mi_gdb_test "-break-list" ".*}" "-break-list" =20 gdb_exit --=20 1.7.7.6