From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id MChjA+L9KWJ+EgAAWB0awg (envelope-from ) for ; Thu, 10 Mar 2022 08:32:18 -0500 Received: by simark.ca (Postfix, from userid 112) id 0AE8B1F3CA; Thu, 10 Mar 2022 08:32:18 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham 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 791971EDF0 for ; Thu, 10 Mar 2022 08:32:17 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 029F83857C67 for ; Thu, 10 Mar 2022 13:32:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 029F83857C67 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1646919137; bh=KUyrJbe7zk8Pb1WpKjizDi1Alv//rz850pv33gbFO+E=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=E6kwUgLSZJBWtY5/iSVUS+fJezgsqkFLQq2xOnI/i2Ie+xGTuEMgstigwD6tM/RrX 89zkh+nrTfeUPpKJR2fa3ZPwikApXSueKIRDeFVa4hEHQEOcm2VtAuBTpPOH0848Pz j5tOSkMfULqT6MMyRPNiNYJz3ku7v00EradVj07A= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 955A73858404 for ; Thu, 10 Mar 2022 13:31:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 955A73858404 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-487-3xkpRy17MJ2DdHmwHXA6rA-1; Thu, 10 Mar 2022 08:31:30 -0500 X-MC-Unique: 3xkpRy17MJ2DdHmwHXA6rA-1 Received: by mail-wm1-f71.google.com with SMTP id n62-20020a1ca441000000b0038124c99ebcso2079074wme.9 for ; Thu, 10 Mar 2022 05:31:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KUyrJbe7zk8Pb1WpKjizDi1Alv//rz850pv33gbFO+E=; b=wKx8P2gdgYj0cdco52Vfcj6Tb65ItBk3fHCTFZbeIu80ZpF4xdcdfoDMZgUHT5MpUi ROJjFiUyLcWgmXNp+ort7dz3O2kWiTNvhy7uDRrwvFzVt8vzK6FlGcbfrLJefGrOVRgy 9qe3qtPFiEZ/8mVYTSB5OSdETlp7zUbwmN+gVJzVfu6PgNLJz1hzgvspXGcAT1mQ+kCg CTszXX7/APfGPHbodkjkBim0eecOUmIeo3nGF8Vw5VnAEm0nZtHct8kf0I7+eegm5DFp JMlUlfVDhyf4ttv3UaANOLfhz7vsybjmpWgyODnUhMKLgb1hDmq11aOPxnwz+8LIzI+8 awdA== X-Gm-Message-State: AOAM530C27GQFc/zYqaw/349I0NTZa+XeXN2gnBlxuq8Q+EE4d4StsVq afztnIKcWeHzMzt2RRmxAqAE0dl3OwPy4hbc1LQgfJoByyY6Z+lDeIYqtLpcizQzXBSYaCXcK3f 6YFrnPLQd0rZwY31r7CUqGBTs9oi8quhZxbpPwM4iOQcIPUI5X619ZSywyIq4cTHtWDG4vOX9Bg == X-Received: by 2002:a7b:c091:0:b0:389:95d0:ad21 with SMTP id r17-20020a7bc091000000b0038995d0ad21mr3705359wmh.56.1646919088505; Thu, 10 Mar 2022 05:31:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+ltuVaDq9GbPjFGkCb1J2dRCH8GazwqtrRHJKNlwqmXadRP0nSTHSXC68BpoGkMPVuWcvgw== X-Received: by 2002:a7b:c091:0:b0:389:95d0:ad21 with SMTP id r17-20020a7bc091000000b0038995d0ad21mr3705342wmh.56.1646919088250; Thu, 10 Mar 2022 05:31:28 -0800 (PST) Received: from localhost (host86-134-151-205.range86-134.btcentralplus.com. [86.134.151.205]) by smtp.gmail.com with ESMTPSA id a17-20020a5d5091000000b001edb61b2687sm6098420wrt.63.2022.03.10.05.31.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Mar 2022 05:31:27 -0800 (PST) To: gdb-patches@sourceware.org Subject: [PATCH 1/2] gdb/gdbarch: remove the predicate function for gdbarch_register_type Date: Thu, 10 Mar 2022 13:31:23 +0000 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" 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: Andrew Burgess via Gdb-patches Reply-To: Andrew Burgess Cc: Andrew Burgess Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" I don't believe that the gdbarch_register_type_p predicate is called anywhere in GDB, and the gdbarch_register_type function is called without checking the gdbarch_register_type_p predicate function everywhere it is used, for example in init_regcache_descr (regcache.c). My claim is that the gdbarch_register_type function is required for every architecture, and GDB will not work if this function is not supplied. And so, in this commit, I remove the 'predicate=True' from gdbarch-components.py for the 'register_type' field, and regenerate the gdbarch files. There should be no user visible changes after this commit. --- gdb/gdbarch-components.py | 1 - gdb/gdbarch-gen.h | 2 -- gdb/gdbarch.c | 11 ----------- 3 files changed, 14 deletions(-) diff --git a/gdb/gdbarch-components.py b/gdb/gdbarch-components.py index bc09d35f9de..aa0b3682593 100644 --- a/gdb/gdbarch-components.py +++ b/gdb/gdbarch-components.py @@ -574,7 +574,6 @@ use "register_type". type="struct type *", name="register_type", params=[("int", "reg_nr")], - predicate=True, invalid=True, ) diff --git a/gdb/gdbarch-gen.h b/gdb/gdbarch-gen.h index b7beb73d36d..7a8721328ab 100644 --- a/gdb/gdbarch-gen.h +++ b/gdb/gdbarch-gen.h @@ -296,8 +296,6 @@ extern void set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch_register the register cache should call this function directly; others should use "register_type". */ -extern bool gdbarch_register_type_p (struct gdbarch *gdbarch); - typedef struct type * (gdbarch_register_type_ftype) (struct gdbarch *gdbarch, int reg_nr); extern struct type * gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr); extern void set_gdbarch_register_type (struct gdbarch *gdbarch, gdbarch_register_type_ftype *register_type); diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 55dd602b27f..28e1fbc2c71 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -443,7 +443,6 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */ if (gdbarch->register_name == 0) log.puts ("\n\tregister_name"); - /* Skip verify of register_type, has predicate. */ /* Skip verify of dummy_id, invalid_p == 0 */ /* Skip verify of deprecated_fp_regnum, invalid_p == 0 */ /* Skip verify of push_dummy_call, has predicate. */ @@ -780,9 +779,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) fprintf_filtered (file, "gdbarch_dump: register_name = <%s>\n", host_address_to_string (gdbarch->register_name)); - fprintf_filtered (file, - "gdbarch_dump: gdbarch_register_type_p() = %d\n", - gdbarch_register_type_p (gdbarch)); fprintf_filtered (file, "gdbarch_dump: register_type = <%s>\n", host_address_to_string (gdbarch->register_type)); @@ -2219,13 +2215,6 @@ set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch->register_name = register_name; } -bool -gdbarch_register_type_p (struct gdbarch *gdbarch) -{ - gdb_assert (gdbarch != NULL); - return gdbarch->register_type != NULL; -} - struct type * gdbarch_register_type (struct gdbarch *gdbarch, int reg_nr) { -- 2.25.4