From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17513 invoked by alias); 4 Oct 2011 17:27:28 -0000 Received: (qmail 17474 invoked by uid 22791); 4 Oct 2011 17:27:26 -0000 X-SWARE-Spam-Status: No, hits=-7.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 04 Oct 2011 17:27:10 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p94HR5c1009198 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 4 Oct 2011 13:27:05 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p94HR4cx021685; Tue, 4 Oct 2011 13:27:05 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p94HR2mW032242; Tue, 4 Oct 2011 13:27:03 -0400 From: Tom Tromey To: "Pierre Muller" Cc: Subject: Re: [RFA-v2] testsuite: Add a test for passing of environment variables to inferior References: <006301cc8292$367539b0$a35fad10$@muller@ics-cnrs.unistra.fr> <20111004134506.GB24369@calimero.vinschen.de> <000901cc82a4$dfba7cd0$9f2f7670$@muller@ics-cnrs.unistra.fr> <20111004151236.GC15757@calimero.vinschen.de> <12954.5351061553$1317744599@news.gmane.org> Date: Tue, 04 Oct 2011 17:27:00 -0000 In-Reply-To: <12954.5351061553$1317744599@news.gmane.org> (Pierre Muller's message of "Tue, 4 Oct 2011 18:09:19 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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: 2011-10/txt/msg00103.txt.bz2 >>>>> "Pierre" == Pierre Muller writes: Pierre> 2011-10-04 Pierre Muller Pierre> Add tests for passing of environment variables to inferior. Pierre> * gdb.base/testenv.c: New test source. Pierre> * gdb.base/testenv.exp: New expect test. Thanks for doing this. Pierre> +#ifdef PROTOTYPES Pierre> +int main (int argc, char **argv, char **envp) You don't need to handle the no PROTOTYPES case any more. Pierre> +if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable {debug}] != "" } { Pierre> + untested testenv.exp Pierre> + return -1 Pierre> +} Pierre> + Pierre> +# Start with a fresh gdb Pierre> + Pierre> +gdb_exit Pierre> +gdb_start Pierre> +gdb_reinitialize_dir $srcdir/$subdir Pierre> +gdb_load ${binfile} You can use prepare_for_testing instead. Pierre> +runto main There's a special runto_main proc for this. Pierre> +gdb_exit Pierre> + Pierre> +set env(TEST_GDB_GLOBAL) "Global environment value" Pierre> + Pierre> +gdb_start Pierre> +gdb_reinitialize_dir $srcdir/$subdir Pierre> +gdb_load ${binfile} You can use clean_restart here. Tom