From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by sourceware.org (Postfix) with ESMTPS id 4DD2C389040B for ; Mon, 11 May 2020 14:33:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4DD2C389040B Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 4D4D92400FC for ; Mon, 11 May 2020 16:33:41 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 49LNhz2VN3z6tmP; Mon, 11 May 2020 16:33:39 +0200 (CEST) Subject: Re: [PATCH 4/4] [PR gdbserver/25893]: Add gdbserver test for argument with space in it To: Simon Marchi , 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> <8839910b-7018-78b7-a46b-7b2bfcb6d2ef@simark.ca> From: Michael Weghorn Message-ID: Date: Mon, 11 May 2020 16:33:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <8839910b-7018-78b7-a46b-7b2bfcb6d2ef@simark.ca> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, 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: Mon, 11 May 2020 14:33:46 -0000 On 10/05/2020 18.09, Simon Marchi wrote: > 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, > Hi Simon, > 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" Indeed, this works fine. Thanks a lot for extending the test suite. > > 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" These don't work yet with the last patch series. I'll recheck once I have finished updating the patch series and in particular fixed the segfault you mentioned earlier. I hope to be able to send an updated patch series tomorrow. Do I understand correctly that I can just drop my patch adding the test, since this is now already covered in a better way by the test case added in your second patch? Michael