From patchwork Mon Feb 27 01:13:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 65663 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7498A3858017 for ; Mon, 27 Feb 2023 01:22:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7498A3858017 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677460959; bh=Jc4lAlqrIl3M9lF5iaDtgy9xTgeWo/hS3/amWLesj6g=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=F7HmnXrMuqV3B4C8r0ZnWWWRwUJswXrCg9ULRemWC9dO9OS52hr0oj1eDC0Han4wS g3SsdDJ31ZsmUO75feYYyHrfqEMFS00sXmgrZ14uV00nnU5T3KiklEjHicYRqr7pxu A4kFrOGKGy7kZ/ES8rm0A5OZXzY5mSNs5GRzawcg= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 7D0343858D1E for ; Mon, 27 Feb 2023 01:22:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7D0343858D1E 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 31R1M9SZ028442 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 26 Feb 2023 20:22:14 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 31R1M9SZ028442 Received: from simark.localdomain (unknown [217.28.27.60]) (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 ESMTPSA id 4F60E1E224; Sun, 26 Feb 2023 20:14:06 -0500 (EST) To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH v3 04/10] gdb: gdbarch.py: remove Info.__init__ Date: Sun, 26 Feb 2023 20:13:57 -0500 Message-Id: <20230227011403.612304-5-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230227011403.612304-1-simon.marchi@polymtl.ca> References: <20230227011403.612304-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 27 Feb 2023 01:22:09 +0000 X-Spam-Status: No, score=-3189.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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-Patchwork-Original-From: Simon Marchi via Gdb-patches From: Simon Marchi Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" Info.__init__ currently assigns `self.predicate = None`. This was helpful to ensure that all component types had a `predicate` attribute. The generator code could then avoid having code like "if the component is anything but Info, use predicate". Since the previous commit, all component types have a predicate attribute which defaults to False. We can therefore remove the assignment in Info.__init__, and in turn remove Info.__init__. We however need to make the printer parameter of _Component.__init__ optional, as Info don't need a printer. Change-Id: I611edeca9cc9837eb49dddfe038595e1ff3b7239 --- gdb/gdbarch.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/gdb/gdbarch.py b/gdb/gdbarch.py index 63c3aee1dc0e..f97f39b6db0f 100755 --- a/gdb/gdbarch.py +++ b/gdb/gdbarch.py @@ -53,7 +53,7 @@ class _Component: self, name, type, - printer, + printer=None, comment=None, predicate=False, predefault=None, @@ -97,11 +97,6 @@ class _Component: class Info(_Component): "An Info component is copied from the gdbarch_info." - def __init__(self, *, name, type, printer=None): - super().__init__(name=name, type=type, printer=printer) - # This little hack makes the generator a bit simpler. - self.predicate = None - class Value(_Component): "A Value component is just a data member."