From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78378 invoked by alias); 10 Oct 2018 09:28:27 -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 77368 invoked by uid 89); 10 Oct 2018 09:27:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.9 required=5.0 tests=BAYES_00,GIT_PATCH_1,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=guessing X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 10 Oct 2018 09:27:39 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 957133001FEC; Wed, 10 Oct 2018 09:27:38 +0000 (UTC) Received: from blade.nx (ovpn-117-250.ams2.redhat.com [10.36.117.250]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2192A6B8DA; Wed, 10 Oct 2018 09:27:38 +0000 (UTC) Received: by blade.nx (Postfix, from userid 1000) id 419DD80B0904; Wed, 10 Oct 2018 10:27:37 +0100 (BST) Date: Wed, 10 Oct 2018 09:28:00 -0000 From: Gary Benson To: Tom de Vries Cc: gdb-patches@sourceware.org, Pedro Alves Subject: Re: [PATCH][gdb/testsuite] Rewrite catch-follow-exec.exp Message-ID: <20181010092735.GA29557@blade.nx> References: <20181005101122.GA23867@delia> <20181009135155.GB12668@blade.nx> <8f8ffb94-5a0c-8b2b-d541-eaacd7d1f42c@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8f8ffb94-5a0c-8b2b-d541-eaacd7d1f42c@suse.de> X-IsSubscribed: yes X-SW-Source: 2018-10/txt/msg00245.txt.bz2 Tom de Vries wrote: > On 10/9/18 3:51 PM, Gary Benson wrote: > > Tom de Vries wrote: > > > append FLAGS " \"$binfile\"" > > > append FLAGS " -batch" > > > + append FLAGS " -ex \"target native\"" > > > append FLAGS " -ex \"catch exec\"" > > > append FLAGS " -ex \"set follow-exec-mode new\"" > > > > I'm a little confused with this part, doesn't this force the test to > > run on the host? > > The "target native" was an attempt to fix problems when running with > --target_board=native-gdbserver. Perhaps it's better to bail out in > that case, but I haven't yet figured out how to. Any advice here? Tests that can't run remote usually bail with something like this at the start: if ![isnative] then { return } There should probably also be an 'append FLAGS " -nx"' too. > > > + # We're not testing the "status returned by the spawned process", > > > + # because it's currently one, and we suspect it will be zero after > > > + # fixing PR23368 - "gdb goes to into background when hitting exec > > > + # catchpoint with follow-exec-mode new" > > > + #gdb_assert { [lindex $result 3] == 0 } > > > > I'm not sure we should commit commented-out code. Why not have the > > test assert { [lindex $result 3] == 1 } if that's what's happening > > now, with the comment reworded to indicate that it might need changing > > to zero when PR23368 is fixed. That way, when PR23368 *is* fixed, > > whoever's fixing it gets a failing test, they investigate, find the > > comment, and update it as part of their series. > > > > Makes sense, will do. I'm guessing this whole function could be replaced with something more regular (which would work remote) once PR23368 is fixed? Something like this: clean_restart ${binfile} gdb_test "catch exec" "Catchpoint \[0-9\]+ \\\(exec\\\).*" gdb_test "set follow-exec-mode new" gdb_run_cmd ... If that is the case, could you note that in that comment? Or just paste the URL of this thread in the archive. I'm happy with this patch with these changes, but I'm not a maintainer so one of those guys will have to give the final approval. Thanks, Gary