From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28611 invoked by alias); 18 Sep 2019 23:16:06 -0000 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 Received: (qmail 28603 invoked by uid 89); 18 Sep 2019 23:16:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=sourcing X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Sep 2019 23:16:04 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 32310AE04; Wed, 18 Sep 2019 23:16:02 +0000 (UTC) Subject: Re: [PATCH][gdb/testsuite] Handle unreachable network in server-connect.exp To: Tom Tromey Cc: gdb-patches@sourceware.org References: <20190914102344.GA5471@delia> <87y2ymx0o2.fsf@tromey.com> <5f724500-d168-9bbb-139f-c455899b6c82@suse.de> <871rwdthw0.fsf@tromey.com> From: Tom de Vries Openpgp: preference=signencrypt Message-ID: <26c1539c-8aef-0977-9706-652595620854@suse.de> Date: Wed, 18 Sep 2019 23:16:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <871rwdthw0.fsf@tromey.com> Content-Type: multipart/mixed; boundary="------------1D6FC474685F20996AA2A4E4" X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg00355.txt.bz2 This is a multi-part message in MIME format. --------------1D6FC474685F20996AA2A4E4 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-length: 713 On 18-09-19 23:27, Tom Tromey wrote: >>>>>> "Tom" == Tom de Vries writes: > > Tom> So, I'm attaching an updated patch that does not modify the existing > Tom> semantics of gdb_target_cmd. > > Tom> 2019-09-14 Tom de Vries > > Tom> * lib/gdbserver-support.exp (gdb_target_cmd_ext): Return 2 (meaning > Tom> UNSUPPORTED) for 'Network is unreachable' message. Factor out of ... > Tom> (gdb_target_cmd): ... here. > Tom> * gdb.server/server-connect.exp: Use gdb_target_cmd_ext, handle return > Tom> value 2. > > Thanks you for doing this. This is ok. I did not find any FAILs when testing this, but in fact there were errors. Fixed with this commit. Thanks, - Tom --------------1D6FC474685F20996AA2A4E4 Content-Type: text/x-patch; name="0001-gdb-testsuite-Fix-gdb_target_cmd.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="0001-gdb-testsuite-Fix-gdb_target_cmd.patch" Content-length: 1238 gdb/testsuite/ChangeLog: 2019-09-19 Tom de Vries * lib/gdbserver-support.exp: [gdb/testsuite] Fix gdb_target_cmd In commit 81dc3ab594 "[gdb/testsuite] Handle unreachable network in server-connect.exp" a regression was introduced in gdb_target_cmd, causing ERRORs like this: ... ERROR: tcl error sourcing src/gdb/testsuite/gdb.server/abspath.exp. ERROR: wrong # args: should be "gdb_target_cmd {$args}" while executing "gdb_target_cmd $gdbserver_protocol $gdbserver_gdbport" ... Fix the argument passing in gdb_target_cmd. --- gdb/testsuite/lib/gdbserver-support.exp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp index 2ad53c1f60..00f46c8264 100644 --- a/gdb/testsuite/lib/gdbserver-support.exp +++ b/gdb/testsuite/lib/gdbserver-support.exp @@ -112,8 +112,8 @@ proc gdb_target_cmd_ext { targetname serialport {additional_text ""} } { # Like gdb_target_cmd_ext, but returns 0 on success, 1 on failure. -proc gdb_target_cmd { $args } { - set res [gdb_target_cmd_ext $args] +proc gdb_target_cmd { args } { + set res [eval gdb_target_cmd_ext $args] return [expr $res == 0 ? 0 : 1] } --------------1D6FC474685F20996AA2A4E4--