From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2927 invoked by alias); 17 Jun 2013 17:57:28 -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 2900 invoked by uid 89); 17 Jun 2013 17:57:24 -0000 X-Spam-SWARE-Status: No, score=-5.2 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,SPF_PASS autolearn=ham version=3.3.1 Received: from usevmg21.ericsson.net (HELO usevmg21.ericsson.net) (198.24.6.65) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 17 Jun 2013 17:57:23 +0000 Received: from EUSAAHC007.ericsson.se (Unknown_Domain [147.117.188.93]) by usevmg21.ericsson.net (Symantec Mail Security) with SMTP id 8C.FA.05617.20E4FB15; Mon, 17 Jun 2013 19:57:22 +0200 (CEST) Received: from eusaamw0711.eamcs.ericsson.se (147.117.20.178) by EUSAAHC007.ericsson.se (147.117.188.93) with Microsoft SMTP Server (TLS) id 14.2.328.9; Mon, 17 Jun 2013 13:57:01 -0400 Received: from [142.133.110.167] (147.117.20.214) by smtps-am.internal.ericsson.com (147.117.20.178) with Microsoft SMTP Server (TLS) id 8.3.279.1; Mon, 17 Jun 2013 13:57:00 -0400 Message-ID: <51BF4DEC.6070907@ericsson.com> Date: Mon, 17 Jun 2013 18:42:00 -0000 From: Simon Marchi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: Pedro Alves CC: Eli Zaretskii , , Subject: Re: [PATCH v2] Exit code of exited inferiors References: <51A5160D.40800@ericsson.com> <83k3mh6ant.fsf@gnu.org> <51A6263A.9080104@ericsson.com> <51B0BDBC.9030909@redhat.com> <51BF3393.30002@ericsson.com> <51BF3B57.3010906@redhat.com> In-Reply-To: <51BF3B57.3010906@redhat.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2013-06/txt/msg00393.txt.bz2 On 13-06-17 12:37 PM, Pedro Alves wrote: > On 06/17/2013 05:04 PM, Simon Marchi wrote: >> On 13-06-06 12:50 PM, Pedro Alves wrote: >>> Please also make sure the test works with gdbserver, with: >>> >>> make check RUNTESTFLAGS="--target_board=native-gdbserver" >>> >>> Thanks, >> >> Hmm, it seems that testing with gdbserver doesn't handle arguments passing, so it doesn't work. How could it be done? > > We haven't seen exit-code.c yet :-) but I imagine that it just > returns a different error code depending on the argument? > You could instead make gdb run to main, and then set a global in the > program with the desired return code. Or build two programs, and pick > the return code depending on a macro. You can pass additional_flags=-Dfoo=bar > to prepare_for_testing/gdb_compile to define macros/symbols. Several > examples on that in the testsuite. > > Do note: > http://sourceware.org/gdb/wiki/GDBTestcaseCookbook#Make_sure_test_executables_are_unique > Thanks, I chose the global variable solution.