From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26124 invoked by alias); 15 Dec 2008 06:07:42 -0000 Received: (qmail 26109 invoked by uid 22791); 15 Dec 2008 06:07:41 -0000 X-Spam-Check-By: sourceware.org Received: from nwd2mail10.analog.com (HELO nwd2mail10.analog.com) (137.71.25.55) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 15 Dec 2008 06:07:00 +0000 X-IronPort-AV: E=Sophos;i="4.36,222,1228107600"; d="diff'?scan'208";a="79776333" Received: from nwd2mhb1.analog.com ([137.71.5.12]) by nwd2mail10.analog.com with ESMTP; 15 Dec 2008 01:06:54 -0500 Received: from nwd2exm4.ad.analog.com (nwd2exm4.ad.analog.com [10.64.53.123]) by nwd2mhb1.analog.com (8.9.3 (PHNE_28810+JAGae91741)/8.9.3) with ESMTP id BAA21105 for ; Mon, 15 Dec 2008 01:06:57 -0500 (EST) Received: from chinexm1.ad.analog.com ([10.99.27.42]) by nwd2exm4.ad.analog.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 15 Dec 2008 01:06:55 -0500 Received: from [10.99.29.101] ([10.99.29.101]) by chinexm1.ad.analog.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 15 Dec 2008 14:06:40 +0800 Message-ID: <4945F3EF.6050004@analog.com> Date: Mon, 15 Dec 2008 06:07:00 -0000 From: Jie Zhang User-Agent: Mozilla-Thunderbird 2.0.0.17 (X11/20081018) MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: Testsuite: Don't use global command in gdb_expect Content-Type: multipart/mixed; boundary="------------060707000507040003030103" 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: 2008-12/txt/msg00269.txt.bz2 This is a multi-part message in MIME format. --------------060707000507040003030103 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 807 The Tcl global command has no effect unless executed in the context of a proc body. So the global commands in the following code are useless. Even worse, they would cause unexpected result. When gdb_expect gets something containing "global", it will try to execute hex as a command, which will cause an error. gdb_expect { global hex global nl global bp_addr global gdb_prompt -re "$hex.*${nl}($hex).*$gdb_prompt $" { set bp_addr $expect_out(1,string) pass "get breakpoint address for foo" } -re ".*$gdb_prompt $" { fail "get breakpoint address for foo" return 0; } timeout { fail "get breakpoint address for foo (timeout)" return 0; } } This patch should fix this issue. Is it OK? Thanks, Jie --------------060707000507040003030103 Content-Type: text/x-patch; name="gdb-testsuite-consecutive.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="gdb-testsuite-consecutive.diff" Content-length: 719 2008-12-15 Jie Zhang * gdb.base/consecutive.exp: Don't use global in gdb_expect. Index: gdb.base/consecutive.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/consecutive.exp,v retrieving revision 1.7 diff -u -p -r1.7 consecutive.exp --- gdb.base/consecutive.exp 6 Aug 2008 12:52:07 -0000 1.7 +++ gdb.base/consecutive.exp 15 Dec 2008 05:51:49 -0000 @@ -64,11 +64,6 @@ set stop_addr 0 send_gdb "x /2i \$pc\n" gdb_expect { - global hex - global nl - global bp_addr - global gdb_prompt - -re "$hex.*${nl}($hex).*$gdb_prompt $" { set bp_addr $expect_out(1,string) pass "get breakpoint address for foo" --------------060707000507040003030103--