From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cUteBnKwSGGXEgAAWB0awg (envelope-from ) for ; Mon, 20 Sep 2021 12:01:54 -0400 Received: by simark.ca (Postfix, from userid 112) id 07D4A1EE25; Mon, 20 Sep 2021 12:01:54 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,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 603901EDDB for ; Mon, 20 Sep 2021 12:01:53 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F34FB385842E for ; Mon, 20 Sep 2021 16:01:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F34FB385842E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1632153713; bh=La+oHagXPIal5BQeTD1d7bprRsysBuPXb+0/jVWw3f0=; 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=bd3E/gfVfPGUO3NL6zEfHBymT2embwVveV8PZprAI3UaWNhswVf/LvwhugjzH4BoE bY4ky1jpidoP9pOXdZ/CFsFQOOBcYdMBacxJA2051nEcts78ct52l0jiXzImM9A35w V0x4lyBNiBFWxIixbo3qz6M0CtUrU1u+zPk4FB+s= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 6C0C93858C60 for ; Mon, 20 Sep 2021 16:01:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6C0C93858C60 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 18KG1Tsp023648 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Sep 2021 12:01:34 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 18KG1Tsp023648 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id CC6F21EDDB; Mon, 20 Sep 2021 12:01:29 -0400 (EDT) Subject: Re: [RFC][gdb/testsuite] Register test for each arch separately in register_test_foreach_arch To: Tom de Vries , gdb-patches@sourceware.org References: <20210913154034.GA3115@delia.home> Message-ID: <1786b296-3fb6-881e-2e08-f030a0d5a513@polymtl.ca> Date: Mon, 20 Sep 2021 12:01:29 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210913154034.GA3115@delia.home> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 20 Sep 2021 16:01:29 +0000 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: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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. 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. The problem with PR28336 makes it so that we try to register tests with duplicate names, and that asserts? Simon