From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 From: Mike Frysinger To: Hans-Peter Nilsson Cc: gdb-patches@sourceware.org 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-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Wed, 16 Feb 2022 07:09:50 -0000 --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--