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 5482B3985429 for ; Wed, 16 Sep 2020 02:50:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5482B3985429 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id AAB4C1E50D; Tue, 15 Sep 2020 22:50:24 -0400 (EDT) Subject: Re: [pushed] gdb: remove TYPE_INSTANCE_FLAGS To: Luis Machado , Pedro Alves , gdb-patches@sourceware.org References: <20200914213112.19593-1-pedro@palves.net> <20200914213112.19593-2-pedro@palves.net> <3db19da5-af04-2f7f-52ed-c496c5b3e791@linaro.org> From: Simon Marchi Message-ID: <696a7481-60f0-859c-c0d0-590c6ae69689@simark.ca> Date: Tue, 15 Sep 2020 22:50:24 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <3db19da5-af04-2f7f-52ed-c496c5b3e791@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Wed, 16 Sep 2020 02:50:26 -0000 On 2020-09-15 5:28 p.m., Luis Machado wrote: > I think you missed adjusting the stale references in gdb/gdb-gdb.py.in. I wasn't sure what you meant, but I suppose it is: 115 fields.append("instance_flags = %s" 116 % TypeFlagsPrinter(self.val['instance_flags'])) ? Indeed, instance_flags there should be changed to m_instance_flags. Does the patch below look good? >From c99a87806247d5f68a3e4d665dd1abf95b8e77ab Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 15 Sep 2020 22:31:24 -0400 Subject: [PATCH] gdb: update instance_flags field name in gdb-gdb.py.in Commit 314ad88df63c ("Use type_instance_flags more throughout") changed the name of field type::instance_flags to type::m_instance_flags. It however missed changing it in the gdb-gdb.py.in file, which results in this when trying to use the pretty-printer: (top-gdb) p *val.type Traceback (most recent call last): File "/home/smarchi/build/binutils-gdb/gdb/gdb-gdb.py", line 116, in to_string % TypeFlagsPrinter(self.val['instance_flags'])) File "/home/smarchi/build/binutils-gdb/gdb/gdb-gdb.py", line 76, in __str__ flag_list = [flag.short_name for flag in TYPE_FLAGS File "/home/smarchi/build/binutils-gdb/gdb/gdb-gdb.py", line 77, in if self.val & flag.value] gdb.error: Argument to arithmetic operation not a number or boolean. $7 = This patch fixes it. gdb/ChangeLog: * gdb-gdb.py.in (class StructTypePrettyPrinter) : Change instance_flags to m_instance_flags. Change-Id: Ib5e03c08fe41ca11cd71998f2b1c58052879ce95 --- gdb/gdb-gdb.py.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/gdb-gdb.py.in b/gdb/gdb-gdb.py.in index 594592d4d16..6594ac10b85 100644 --- a/gdb/gdb-gdb.py.in +++ b/gdb/gdb-gdb.py.in @@ -113,7 +113,7 @@ class StructTypePrettyPrinter: fields.append("reference_type = %s" % self.val['reference_type']) fields.append("chain = %s" % self.val['reference_type']) fields.append("instance_flags = %s" - % TypeFlagsPrinter(self.val['instance_flags'])) + % TypeFlagsPrinter(self.val['m_instance_flags'])) fields.append("length = %d" % self.val['length']) fields.append("main_type = %s" % self.val['main_type']) return "\n{" + ",\n ".join(fields) + "}" -- 2.28.0