From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id MAzLKkTOSGHwFQAAWB0awg (envelope-from ) for ; Mon, 20 Sep 2021 14:09:08 -0400 Received: by simark.ca (Postfix, from userid 112) id ABF0C1EE25; Mon, 20 Sep 2021 14:09:08 -0400 (EDT) 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=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.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 3EC811EE14 for ; Mon, 20 Sep 2021 14:09:07 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B6BCF385841F for ; Mon, 20 Sep 2021 18:09:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B6BCF385841F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1632161346; bh=zMFIxLpgL8GxjwSH4bIkAHZXqMvMke4JK+v6lCMtyPI=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=iU7P9Fdabb4Wv2NalwoC2EI4NOS1IG4H1+p8oLJF7Mzn8Kue5Wy7l6bor38Y1i2Gi BYXWXt5nUQuQmHkn+LfHZzLP3uukUxoP2WFhll6ISut+A1hZa4V7bEv8QFOXKWMowX K+7oYsN2yH7nP1vmJXemfEn2SOUK1fLU/gsrL6Cc= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 1D43D385840F for ; Mon, 20 Sep 2021 18:07:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1D43D385840F Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 5696822068; Mon, 20 Sep 2021 18:07:31 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1DCDD13AE9; Mon, 20 Sep 2021 18:07:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id UhwLBOPNSGHRcQAAMHmgww (envelope-from ); Mon, 20 Sep 2021 18:07:31 +0000 Subject: Re: [RFC][gdb/testsuite] Register test for each arch separately in register_test_foreach_arch To: Simon Marchi , gdb-patches@sourceware.org References: <20210913154034.GA3115@delia.home> <1786b296-3fb6-881e-2e08-f030a0d5a513@polymtl.ca> Message-ID: <410fff03-8b65-184e-b96c-b9e0b79dac93@suse.de> Date: Mon, 20 Sep 2021 20:07:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <1786b296-3fb6-881e-2e08-f030a0d5a513@polymtl.ca> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 9/20/21 6:01 PM, Simon Marchi wrote: > > > On 2021-09-13 11:40 a.m., Tom de Vries via Gdb-patches wrote: >> Hi, >> >> In gdb/disasm-selftests.c we have: >> ... >> selftests::register_test_foreach_arch ("print_one_insn", >> selftests::print_one_insn_test); >> ... >> and we get: >> ... >> $ gdb -q -batch -ex "maint selftest print_one_insn" 2>&1 \ >> | grep ^Running >> Running selftest print_one_insn. >> $ >> ... >> >> Change the semantics register_test_foreach_arch such that a version of >> print_one_insn is registered for each architecture, such that we have: >> ... >> $ gdb -q -batch -ex "maint selftest print_one_insn" 2>&1 \ >> | grep ^Running >> Running selftest print_one_insn::A6. >> Running selftest print_one_insn::A7. >> Running selftest print_one_insn::ARC600. >> ... >> $ >> ... >> >> This makes it f.i. possible to do: >> ... >> $ gdb -q -batch a.out -ex "maint selftest print_one_insn::armv8.1-m.main" >> Running selftest print_one_insn::armv8.1-m.main. >> Self test failed: self-test failed at src/gdb/disasm-selftests.c:165 >> Ran 1 unit tests, 1 failed >> ... >> >> Currently this runs into a bfd problem, filed at PR28336 - "bfd printable arch >> names not unique" ( https://sourceware.org/bugzilla/show_bug.cgi?id=28336 ). >> >> Any comments? > > I think the idea is good. Great :) > It's still possible to run the test for all > arches, since the argument to "maint selftest" can match just a subset > of the test name. So we don't lose anything. Ack. > The problem with PR28336 > makes it so that we try to register tests with duplicate names, and that > asserts? Yes, but that PR's fixed now, so that assert no longer triggers. [ FWIW, we could make things less dramatic by not asserting but throwing an exception in register_test, and handling the exception in register_test_foreach_arch. But there's no immediate need atm, so I'll leave it as is in this patch. ] Thanks, - Tom