From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id qIIJMlCjDGIPKAAAWB0awg (envelope-from ) for ; Wed, 16 Feb 2022 02:10:08 -0500 Received: by simark.ca (Postfix, from userid 112) id BCD651F3C9; Wed, 16 Feb 2022 02:10:08 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id B964E1F0BB for ; Wed, 16 Feb 2022 02:10:07 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EC61F3857C43 for ; Wed, 16 Feb 2022 07:10:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC61F3857C43 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1644995407; bh=74GIycvOUIylS1jim27Gx2CvDtHQGZY6LdqN/Pq7uA0=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=uoPzEPaBgXgGhvvul6XwRrwQ1w0ILziu++pNM4MrPYYs2ZOYg/Rn3hm0oWc8Xqj7a ENayK7elCfqVJKU4hAzx6seHkdpj7csrBsEDCQgadgN3x/vwPZLICb3ejBq4GpQ6TF xb2byPLvCImqRCaKmSUYQ1QAGEoEKB1TG3mIfIhU= Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 2DCEF3858D3C for ; Wed, 16 Feb 2022 07:09:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2DCEF3858D3C Received: by smtp.gentoo.org (Postfix, from userid 559) id 3E585342FD5; Wed, 16 Feb 2022 07:09:47 +0000 (UTC) Date: Wed, 16 Feb 2022 02:09:44 -0500 To: Hans-Peter Nilsson Subject: Re: [PATCH 06/12] sim/testsuite: Support "requires: simoption <--name-of-option>" Message-ID: Mail-Followup-To: Hans-Peter Nilsson , gdb-patches@sourceware.org References: <20220214225824.AC90A20439@pchp3.se.axis.com> <20220214230356.BA97820439@pchp3.se.axis.com> <20220216062451.703AD2040B@pchp3.se.axis.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4QGucVOZHNk/3cDd" Content-Disposition: inline In-Reply-To: <20220216062451.703AD2040B@pchp3.se.axis.com> 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: , From: Mike Frysinger via Gdb-patches Reply-To: Mike Frysinger Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" --4QGucVOZHNk/3cDd Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 16 Feb 2022 07:24, Hans-Peter Nilsson wrote: > Date: Tue, 15 Feb 2022 23:49:47 -0500 From: Mike Frysinger > > On 15 Feb 2022 00:03, Hans-Peter Nilsson via Gdb-patches wrote: > > > Simulator features can be present or not, typically > > > depending on different-valued configure options, like > > > --enable-sim-hardware[=3Doff|=3Don]. To avoid failures in > > > test-suite-runs when testing such configurations, a new > > > predicate is needed, as neither "target", "progos" nor > > > "mach" fits cleanly. > > >=20 > > > The immediate need was to check for presence of a simulator > > > option, but rather than a specialized "requires-simoption:" > > > predicate I thought I'd handle the general (parametrized) > > > need, so here's a generic predicate machinery and a (first) > > > predicate to use together with it; checking whether a > > > particular option is supported, by looking at "run --help" > > > output. This was inspired by the check_effective_target_ > > > machinery in the gcc test-suite. > >=20 > > i really don't want --help to be an API surface like this. it's the wr= ong > > layer for the job. > >=20 > > we have a sim_config_print function which dumps configuration informati= on. > > i'd be fine making that the surface to build off of. i don't think we > > print hardware there atm, but should be trivial to introduce. > >=20 > > only other missing piece is that it's not obvious how to access it from > > the CLI. `run --version` doesn't include it. `run --do-command versio= n` > > does though :x. i'd be amenable to improving this interface, either by= a > > new option like --info-config or some other route. >=20 > But, "run --version" is a check for the *option* to exist, > which exactly meets the need. You describe a probe for a > particular *configuration*, which is arguably useful, but > not for checking whether a particular option is supported. i think you misunderstand. you're basically running: run --help | grep -e--option where --option is some functionality you care about. i'm saying --help is not an interface. it should be free to change and reformat things as makes sense and not worry about testsuites breaking. in the case of a multitarget binary, we probably wouldn't display all the options in a single page, but have arch-specific sections. i'm proposing: run --do-command version | grep where in this case you seem to care about hardware support being enabled. so the test would look like: # requires: simoption WITH_HW and then the code would look for that in the structured output produced by the sim config output (which is included in the extended version). -mike --4QGucVOZHNk/3cDd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAmIMozgACgkQQWM7n+g3 9YGdDA/+Lv8dDnerZax/vHTUGLb4RW353RFO6KfjOGB29zriV3k+E12pdu2kve7e ct1fedmOdjrraFImfa94brv+SIsamIb2gg7ihabaojdkJPQ0atE3aGmrPcctsvna QnsjeBJxqTXwDTgRU5XsAj72Dr7+J9nNW39kKqZEgZ26B/VAUs6roGhu2v3lxHwd sUDAnu6QzhhcVLn1P3HqzeYUaErvwNF0uyFTEbxt06uB3XOsumLgazoL7NKhpPBW kWPhvzztJKUaqeu5G4QOSb8ybOmRj9HPHQ0fatxmcGs3C25WLAFpnABEuOFlXTB4 At+MzMfMDjWjd9+chGW9p1pPXOOfRZWarOzHZIQjx/DNc3x+n8jzshIRe2sZO3hO trFmnj2cnu0w1cfUkMV9Dt+sPZCBxKjaExUg8BKJfxfpBzaweEnjckB3/ga/SOi5 kYT3kfWVB3ZpnpuIZCqAXMMqQPpZkthqsL2ySFKdQvfyTYOXEPYKbJSpV37lNh9I BxZQJRr4+uzdQ0KBbimXT5VxAwT15/hHXnm5RpdZ/bsk5vK4TrtIxjdF73eUHKgR tuSdpUj4kH0C/SHi8T5wXmOcMbe554LuWVHbm8rBMPyl3kb6FG9R9aWijyLUCX/j v++gskHxXFRnoRxR98NZI7hMrWHUd67JpdWPsXW2sA0bG1Izuco= =j4Wi -----END PGP SIGNATURE----- --4QGucVOZHNk/3cDd--