From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 7220D38708AC for ; Sun, 10 May 2020 16:09:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7220D38708AC Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.193] (unknown [192.222.164.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 5D9761E5F9; Sun, 10 May 2020 12:09:30 -0400 (EDT) Subject: Re: [PATCH 4/4] [PR gdbserver/25893]: Add gdbserver test for argument with space in it From: Simon Marchi To: Michael Weghorn , gdb-patches@sourceware.org References: <20200429111638.1327262-1-m.weghorn@posteo.de> <20200429111638.1327262-6-m.weghorn@posteo.de> <1190e73a-8f10-dc6d-4d59-b9a2929530ad@simark.ca> Message-ID: <8839910b-7018-78b7-a46b-7b2bfcb6d2ef@simark.ca> Date: Sun, 10 May 2020 12:09:29 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <1190e73a-8f10-dc6d-4d59-b9a2929530ad@simark.ca> Content-Type: text/plain; charset=utf-8 Content-Language: tl Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 16:09:35 -0000 On 2020-05-07 6:15 p.m., Simon Marchi wrote: > It would be nice to write a test in such a way that it can cover this use case > when using GDB (without GDBserver) too. > > It's possible to run the same test using plain GDB with: > > make check TESTS="gdb.base/foo.exp" > > or > > make check TESTS="gdb.base/foo.exp" RUNTESTFLAGS="--target_board=unix" > > unix is the default DejaGNU (runtest) board, so these two are equivalent. > > It's also possible to run a test using gdbserver as a target: > > make check TESTS="gdb.base/foo.exp" RUNTESTFLAGS="--target_board=native-gdbserver" > make check TESTS="gdb.base/foo.exp" RUNTESTFLAGS="--target_board=native-extended-gdbserver" > > So it should be possible to write a test that runs a process with arguments > containing spaces. However, it's not currently possible with the testsuite > to pass arguments to a test program using the native-gdbserver board. These > arguments would have to be forwarded all the way to gdbserver's command line, > exactly like when you start gdbserver by hand. This will require a bit of > testsuite refactoring, I'll try to look into it. > > With native-extended-gdbserver, the args could be passed to the `run` command, > just like the native debugging case. It's by playing with this that I noticed > gdbserver crashing with this patchset applied when trying to remotely run a > process with arguments. > > Simon Hi Michael, Can you please check the patches I proposed for such a test? https://sourceware.org/pipermail/gdb-patches/2020-May/168262.html https://sourceware.org/pipermail/gdb-patches/2020-May/168263.html Your fix should make this work: make check TESTS="gdb.base/inferior-args.exp" RUNTESTFLAGS="--target_board=native-gdbserver" But these two should work as well: make check TESTS="gdb.base/inferior-args.exp" RUNTESTFLAGS="--target_board=unix" make check TESTS="gdb.base/inferior-args.exp" RUNTESTFLAGS="--target_board=native-extended-gdbserver" Simon