From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id h4Y0NAMKD2DCCgAAWB0awg (envelope-from ) for ; Mon, 25 Jan 2021 13:12:19 -0500 Received: by simark.ca (Postfix, from userid 112) id C70AA1EF80; Mon, 25 Jan 2021 13:12:19 -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.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 722551E940 for ; Mon, 25 Jan 2021 13:12:19 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D78633954C5A; Mon, 25 Jan 2021 18:12:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D78633954C5A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1611598338; bh=ZTpZpVS2wjVwmywueVwFPnxWWALLw9Vw+RLkyo/2/l4=; 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=FLxgPfGnPpYQSVLKBIbjpM5JmcfszESqO4LWqLEOq84zq4PR93kHEueFtARJnUK6g qZt8VfDq9QJF2GWu9zANP/RV4xWGGnANkSYGpRp5ItGGoF4JJ+KX6Nr5DPrUje9fcb WiStlS1e77A6X+Qh4ZRCFbS9ntYFyZkOaDiCQ+9s= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 8FE9939524A9 for ; Mon, 25 Jan 2021 18:12:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8FE9939524A9 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 10PIC64s016355 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Jan 2021 13:12:11 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 10PIC64s016355 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 8FC721E940; Mon, 25 Jan 2021 13:12:06 -0500 (EST) Subject: Re: [PATCH][gdb/symtab] Handle DW_AT_ranges with DW_FORM_sec_off in partial DIE To: Bernd Edlinger , Tom de Vries , gdb-patches@sourceware.org References: <20210125122444.GA15885@delia> <56f38801-477e-fa38-5e16-22a4ed73437c@polymtl.ca> Message-ID: Date: Mon, 25 Jan 2021 13:12:06 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 25 Jan 2021 18:12:06 +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@sourceware.org Sender: "Gdb-patches" On 2021-01-25 12:42 p.m., Bernd Edlinger wrote: > On 1/25/21 5:36 PM, Simon Marchi wrote: >>> Yes, unfortunately I have not any experience with writing such assembly >>> tests, but I am always impressed when one of you does it though :-) >>> >>> Nevertheless, the test case seems to be stable from gcc-4.8 .. gcc-11, >>> that it fails without the patch and passes with the patch. >>> >>> So is it okay to push my partial symbols test as-is? >> >> My patch here adds a test that uses DW_FORM_sec_offset to point >> to a .debug_rnglists (DWARF5) section. Maybe that's sufficient, >> but if not I could probably do a DWARF4 equivalent. >> >> https://sourceware.org/pipermail/gdb-patches/2021-January/175229.html >> > > Yeah, the hardest part on a one-line change like this is always the test case. > > So, I tried this patch on current trunk, but it fails: > > Running /home/ed/gnu/gdb-build-1/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.dwarf2/rnglists-multiple-cus.exp ... > ERROR: Couldn't load rnglists-multiple-cus-dw32 into GDB (GDB internal error). > ERROR: Couldn't load rnglists-multiple-cus-dw64 into GDB (GDB internal error). > Running /home/ed/gnu/gdb-build-1/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.dwarf2/rnglists-sec-offset.exp ... > FAIL: gdb.dwarf2/rnglists-sec-offset.exp: is_64=false: p/x &foo > FAIL: gdb.dwarf2/rnglists-sec-offset.exp: is_64=true: p/x &foo > > This probably means that your test tests more than this single-line change alone? Hmm, with current master (so with Tom's patch merged), gdb.dwarf2/rnglists-sec-offset.exp passes for me. But gdb.dwarf2/rnglists-multiple-cus.exp is expected to fail if you don't have the other patches in my series. > I always thought that the partial symbols are replaced by the > full symbols as soon as the first item from the CU is accessed, say "main". > Can you explain how that can be? > I was never able to get a reproducer for partial symbols with only one CU. The bug fixed by this patch triggers as soon as you have a function (DW_TAG_subprogram) with a DW_AT_ranges, I don't think it matters whether there is one or more CUs. But perhaps it's difficult to force the compiler to emit a function with DW_AT_ranges (so, with a non-contiguous range) when using a single CU. Simon