From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 0EqJL03b/mC9WgAAWB0awg (envelope-from ) for ; Mon, 26 Jul 2021 11:57:01 -0400 Received: by simark.ca (Postfix, from userid 112) id B01A11EDFB; Mon, 26 Jul 2021 11:57:01 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,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 F013C1EA7E for ; Mon, 26 Jul 2021 11:57:00 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7C53A385F015 for ; Mon, 26 Jul 2021 15:57:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7C53A385F015 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1627315020; bh=+WTInJEviKdH3Yj6edIgtPLTUg920c5N77L4ePQz+I0=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=a4N4n4qgT4H05fHxdt9bmhEyvA3OEAiiAzL+S+Fx3c79znvr4KzELvXEh3RGChCMU K85Cnboah8EaRVWkgCCyIfs2UP3k9AJ+Q3Ietp/UC5v4GYbRpl1Sa6JSg9G3ksAPYJ eZTZM6UAGcdImcNrouKMdI/oW2mS1QRUn2NOF1P8= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id DFA6B38618F9 for ; Mon, 26 Jul 2021 15:55:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DFA6B38618F9 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 16QFtiWb024373 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Jul 2021 11:55:48 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 16QFtiWb024373 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id F20B61EA7E; Mon, 26 Jul 2021 11:55:43 -0400 (EDT) Subject: Re: [PATCH][gdb/symtab] Fix unhandled dwarf expression opcode with gcc-11 -gdwarf-5 To: Tom de Vries , gdb-patches@sourceware.org References: <20210725072237.GA31689@delia> <3aab540b-f859-4310-a802-5416e3603282@suse.de> Message-ID: <14e9a2b9-23e9-c57a-41c0-75734ce0cb4a@polymtl.ca> Date: Mon, 26 Jul 2021 11:55:43 -0400 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: <3aab540b-f859-4310-a802-5416e3603282@suse.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 26 Jul 2021 15:55:44 +0000 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: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: Tom Tromey Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2021-07-26 10:41 a.m., Tom de Vries wrote: >> However, this high bounds value stored as a location expression won't be >> very useful anyway. In most places (see get_discrete_high_bound), we >> just return 0 if the property is not constant. But we did evaluate it, >> the current interfaces that evaluate dynamic properties return CORE_ADDR >> or LONGEST, all 64-bit values, so we could not return that value. So if >> the property that you create was ever evaluated, it wouldn't yield a >> valid result anyway. I quickly tried to find a way to make GDB evaluate >> it to see what happens, but couldn't find one. >> >> If we ever want such a large high bound value to be useful, I think that >> some interfaces and some code would need to be converted to use >> arbitrary precision integers (using GMP maybe). And then >> dynamic_prop_data::const_val could be a GMP type instead of a LONGEST, >> allowing it to store that 16 bytes value. In which case we would >> probably undo your patch here, because, if we can store the 16-byte >> value as a constant directly, there's no need to convert it to a >> location expression. >> > > Yes, if we'd address PR20991 then this patch might be reverted. I don't > see that as a problem. > > What I see as a problem is that we currently give the user the confusing > "Unhandled dwarf expression opcode 0xff" which suggests either: > - there's a compiler problem, or > - gdb needs to handle the dwarf expression opcode 0xff, > and neither is correct. > > With this patch, we give: > ... > That operation is not available on integers of more than 8 bytes. > ... > which points nicely to PR20991. I agree with the user-visible behavior / change, so even though the implementation does not look pretty, I can live with it. Simon