From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gproxy3-pub.mail.unifiedlayer.com (gproxy3-pub.mail.unifiedlayer.com [69.89.30.42]) by sourceware.org (Postfix) with ESMTPS id 209CF385840D for ; Fri, 17 Sep 2021 19:42:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 209CF385840D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com Received: from cmgw12.mail.unifiedlayer.com (unknown [10.0.90.127]) by gproxy3.mail.unifiedlayer.com (Postfix) with ESMTP id 68AC38034F02 for ; Fri, 17 Sep 2021 19:42:09 +0000 (UTC) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTP id RJkOmAaCUEV4rRJkOmTGmg; Fri, 17 Sep 2021 19:42:09 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=NJkQR22g c=1 sm=1 tr=0 ts=6144ef91 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=7QKq2e-ADPsA:10:nop_rcvd_month_year a=Qbun_eYptAEA:10:endurance_base64_authed_username_1 a=CCpqsmhAAAAA:8 a=p9w4BGRRqleGRR1vP5kA:9 a=L6zrB5X5-hYA:10:demote_hacked_domain_1 a=ul9cdbp4aOFLsgKbc677:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=5x5xbCzmaHstSBsGLxfvakSPbWWKZJ1xwKihfo7Ar7g=; b=uJUb8bozf/HOFF9o2l0bptZ9q9 FSQeCEartyl/Q1c4XE+XZtX+juroB576Odj2ImAobR+SBF5DcRLhheAHPof2X+BoZoQjyYE9j+JkG Hrd8XsyA2Ibr5SnZikExyd5iy; Received: from 174-16-0-219.hlrn.qwest.net ([174.16.0.219]:42716 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mRJkN-0002py-SD; Fri, 17 Sep 2021 13:42:08 -0600 From: Tom Tromey To: Tom de Vries via Gdb-patches Cc: Tom de Vries , Tom Tromey Subject: Re: [PATCH][gdb/ada] Handle artificial local symbols References: <20210824111357.GA28507@delia> X-Attribution: Tom Date: Fri, 17 Sep 2021 13:42:06 -0600 In-Reply-To: <20210824111357.GA28507@delia> (Tom de Vries via Gdb-patches's message of "Tue, 24 Aug 2021 13:13:59 +0200") Message-ID: <87zgsbng4x.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 174.16.0.219 X-Source-L: No X-Exim-ID: 1mRJkN-0002py-SD X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 174-16-0-219.hlrn.qwest.net (murgatroyd) [174.16.0.219]:42716 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3026.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Fri, 17 Sep 2021 19:42:16 -0000 >>>>> "Tom" == Tom de Vries via Gdb-patches writes: Tom> Fix this instead by marking the symbol as artificial, and: Tom> - ignoring such symbols in ada_resolve_variable, which fixes the FAIL Tom> - ignoring such ada symbols in do_print_variable_and_value, which prevents Tom> them from showing up in "info locals" Tom> Note that a fix for the latter was submitted here ( Tom> https://sourceware.org/pipermail/gdb-patches/2008-January/054994.html ), and Tom> this patch borrows from it. Thanks for doing this. Tom> + /* Handle DW_AT_artificial. */ Tom> + attr = dwarf2_attr (die, DW_AT_artificial, cu); Tom> + if (attr != nullptr) Tom> + sym->artificial = 1; This should also check attr->as_boolean. Probably also use '= true', though sym->artificial = attr->as_boolean () would also be fine. Tom> + if (language_def (sym->language ())->symbol_printing_suppressed (sym)) Tom> + return; Seems fine though I also wonder if it would be better to just always suppress artificial variables here. Tom> + /* Whether this symbol is artificial. */ Tom> + Tom> + unsigned int artificial : 1; I think making this bool would be better. Tom