From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 8JRjDZYkRWFeNwAAWB0awg (envelope-from ) for ; Fri, 17 Sep 2021 19:28:22 -0400 Received: by simark.ca (Postfix, from userid 112) id 32BE41EE25; Fri, 17 Sep 2021 19:28:22 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,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 8E4221EE14 for ; Fri, 17 Sep 2021 19:28:21 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2B6FD385AC1B for ; Fri, 17 Sep 2021 23:28:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2B6FD385AC1B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1631921301; bh=WGWpETqIspaj8DQUD8c8v6T0sCkMDI8s4CUyYEFNSM8=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ZAt+58JdUn8pSWVaq5qyueSsmfrGU9MxFGWy0cgIshj/m7h6ZCWMtdYIwhrcbCVms 7Fi3OkEp9YEiE4mGT0vrWQ9OmTpPIv2Cul1Rj1lpwA5aCRTcAwkYNMcaMQE7JGv1jQ z1mfYOFtd5LYOdeK74Gy3MtapadQqIOl9+Cc1Yq0= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 7E2EC3858428 for ; Fri, 17 Sep 2021 23:28:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7E2EC3858428 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id B0F042240D; Fri, 17 Sep 2021 23:28:01 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 9C23213C98; Fri, 17 Sep 2021 23:28:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 9Z7RJIEkRWHKawAAMHmgww (envelope-from ); Fri, 17 Sep 2021 23:28:01 +0000 Subject: Re: [PATCH][gdb/ada] Handle artificial local symbols To: Tom Tromey , Tom de Vries via Gdb-patches References: <20210824111357.GA28507@delia> <87zgsbng4x.fsf@tromey.com> Message-ID: <91f01f82-446e-9e80-692f-11cfefb7c4ee@suse.de> Date: Sat, 18 Sep 2021 01:28:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <87zgsbng4x.fsf@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 9/17/21 9:42 PM, Tom Tromey wrote: >>>>>> "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. > Ack. > 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. > There may be trouble with other languages though. So for now I'm going ahead with this approach. > Tom> + /* Whether this symbol is artificial. */ > Tom> + > Tom> + unsigned int artificial : 1; > > I think making this bool would be better. Hmm, the struct is advertised as space-critical, and a 1-bit bitfield is smaller than an 8-bit bool. So I wonder why you prefer bool here. Thanks, - Tom