From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 76287385843D for ; Thu, 23 Feb 2023 22:18:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 76287385843D Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com Received: from smarchi-efficios.internal.efficios.com (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) (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 ACF351E221; Thu, 23 Feb 2023 17:18:31 -0500 (EST) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 1/9] gdb: remove invalid / dead code from gdbarch.py Date: Thu, 23 Feb 2023 17:18:22 -0500 Message-Id: <20230223221830.499934-2-simon.marchi@efficios.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230223221830.499934-1-simon.marchi@efficios.com> References: <20230223221830.499934-1-simon.marchi@efficios.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3497.6 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_NONE,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_SOFTFAIL,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 List-Id: My editor flagged that the variable `c` (in the lines removed by this patch) was unknown. I guess it ends up working because there is a `c` variable in the global scope. I tried putting `assert False` inside that if, and it is not hit, showing that we never enter this if. So, remove it. There is no change in the generated files. Change-Id: Id3b9f67719e88cada7c6fde673c8d7842ab13617 --- gdb/gdbarch.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/gdb/gdbarch.py b/gdb/gdbarch.py index 3ebc35980472..68c7bbae6618 100755 --- a/gdb/gdbarch.py +++ b/gdb/gdbarch.py @@ -64,8 +64,6 @@ class _Component: assert self.predicate and not isinstance(self.invalid, str) if self.predefault: predicate = f"gdbarch->{self.name} != {self.predefault}" - elif isinstance(c, Value): - predicate = f"gdbarch->{self.name} != 0" else: predicate = f"gdbarch->{self.name} != NULL" return predicate -- 2.39.2