From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ZRxABcqYDGJ+JgAAWB0awg (envelope-from ) for ; Wed, 16 Feb 2022 01:25:14 -0500 Received: by simark.ca (Postfix, from userid 112) id 047F91F3C9; Wed, 16 Feb 2022 01:25:14 -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 8E34E1EA69 for ; Wed, 16 Feb 2022 01:25:13 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 932DB3858436 for ; Wed, 16 Feb 2022 06:25:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 932DB3858436 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1644992710; bh=FZo7NMe72gU+rjmhCzRmO1OGqeg0HsMtDHA+AvEzfgo=; h=To:In-Reply-To:Subject:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=GDbueHG22rqx69KK+gmKu/BGz7XckbFib24hm90cpyXsjO3WD9F8PbxPtWyKyurhT ZL9rdunVYDoorIZmWenfhuJWxYHfJONQAfj/hHg5S5kAFwGqan0pJGFN3IHTu2uwvn JUIPQR4RtKCqM4XDclWfuV6t2OOch/LcOaCF4+zo= Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by sourceware.org (Postfix) with ESMTPS id B10CE3858D3C for ; Wed, 16 Feb 2022 06:24:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B10CE3858D3C To: Mike Frysinger In-Reply-To: (message from Mike Frysinger on Tue, 15 Feb 2022 23:49:47 -0500) Subject: Re: [PATCH 06/12] sim/testsuite: Support "requires: simoption <--name-of-option>" MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT References: <20220214225824.AC90A20439@pchp3.se.axis.com> <20220214230356.BA97820439@pchp3.se.axis.com> Message-ID: <20220216062451.703AD2040B@pchp3.se.axis.com> Date: Wed, 16 Feb 2022 07:24:51 +0100 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: Hans-Peter Nilsson via Gdb-patches Reply-To: Hans-Peter Nilsson Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" > 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[=off|=on]. To avoid failures in > > test-suite-runs when testing such configurations, a new > > predicate is needed, as neither "target", "progos" nor > > "mach" fits cleanly. > > > > 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. > > i really don't want --help to be an API surface like this. it's the wrong > layer for the job. > > we have a sim_config_print function which dumps configuration information. > 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. > > 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 version` > does though :x. i'd be amenable to improving this interface, either by a > new option like --info-config or some other route. 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. brgds, H-P