From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id zDDSKNblDmADBgAAWB0awg (envelope-from ) for ; Mon, 25 Jan 2021 10:37:58 -0500 Received: by simark.ca (Postfix, from userid 112) id 974581EF80; Mon, 25 Jan 2021 10:37:58 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=MAILING_LIST_MULTI,RDNS_NONE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [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 37C7F1E945 for ; Mon, 25 Jan 2021 10:37:58 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7891639C0BB7; Mon, 25 Jan 2021 15:37:57 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 3C1953857003 for ; Mon, 25 Jan 2021 15:37:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3C1953857003 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 448DCADE0; Mon, 25 Jan 2021 15:37:54 +0000 (UTC) To: Simon Marchi , Bernd Edlinger , gdb-patches@sourceware.org References: <20210125122444.GA15885@delia> <56f38801-477e-fa38-5e16-22a4ed73437c@polymtl.ca> From: Tom de Vries Subject: Re: [PATCH][gdb/symtab] Handle DW_AT_ranges with DW_FORM_sec_off in partial DIE Message-ID: Date: Mon, 25 Jan 2021 16:37:53 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <56f38801-477e-fa38-5e16-22a4ed73437c@polymtl.ca> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit 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: , Cc: Tom Tromey Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 1/25/21 4:27 PM, Simon Marchi wrote: > > > On 2021-01-25 7:52 a.m., Bernd Edlinger wrote: >> On 1/25/21 1:24 PM, Tom de Vries wrote: >>> Hi, >>> >>> While looking into a failure in gdb.go/package.exp with gcc-11, I noticed that >>> gdb shows some complaints when loading the executable (also with gcc-10, where >>> the test-case passes): >>> ... >>> $ gdb -batch -iex "set complaints 100" package.10 -ex start >>> During symbol reading: Attribute value is not a constant (DW_FORM_sec_offset) >>> Temporary breakpoint 1 at 0x402ae6: file gdb.go/package1.go, line 8. >>> During symbol reading: Attribute value is not a constant (DW_FORM_sec_offset) >>> During symbol reading: Invalid .debug_rnglists data (no base address) >>> ... >>> >>> Fix this by using as_unsigned () to read DW_AT_ranges in the partial DIE >>> reader, similar to how that is done in dwarf2_get_pc_bounds. >>> >>> Tested on x86_64-linux. >>> >>> Any comments? >>> >> >> Oh, interesting. >> >> This is exactly what I have posted here: >> >> https://sourceware.org/pipermail/gdb-patches/2021-January/174660.html >> >> but my test case shows the regression in the partial symbols. >> >> >> >> Maybe you can take my test case and merge it to your patch? >> >> I've looked at it, but it's optimized code, which may be fragile in terms of number of break locations. I wouldn't mind a dwarf assembly version of that one though. >> Thanks >> Bernd. >> > > Haha, I also wrote the same patch: > > https://sourceware.org/pipermail/gdb-patches/2021-January/175225.html > Heh, this starts to sound a lot like a "how many software engineers does it take to fix one line of code" kind of joke :) > Either of your patches is fine with me. Note that the test that I add > later in my series (written with the DWARF assembler) triggers the bug > as well. Ah, that's good to know. I've push mine, and added you both as author in the ChangeLog. Thanks, - Tom