From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 8fx4JST0B2GASQAAWB0awg (envelope-from ) for ; Mon, 02 Aug 2021 09:33:24 -0400 Received: by simark.ca (Postfix, from userid 112) id 883BD1EDFB; Mon, 2 Aug 2021 09:33:24 -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 CBC2E1E4A3 for ; Mon, 2 Aug 2021 09:33:23 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 204373839C7A for ; Mon, 2 Aug 2021 13:33:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 204373839C7A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1627911203; bh=/wsPqVPvJd1e7t7LkoMxIVT5SDi+Vc0dAIRHMzu7lx4=; 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=C9yIil8+vmbwMU2++Z+/zimdRdP+31qtP/krivcwOPTqiLYSS0AFX8HDz1uNPvYDZ 00vgzClFM3BJCfesEwCTxJ/IZfik7oFZNe7LyzMdaciz+1JN3OCa0G5g0UFlGjUcoq APBi7sXaAi5yymw8jAa4xxYosvc9PVi58Jv1LgGs= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 8D56D3839835 for ; Mon, 2 Aug 2021 13:29:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8D56D3839835 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 172DTlSv023089 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 2 Aug 2021 09:29:52 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 172DTlSv023089 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)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id BA97F1E4A3; Mon, 2 Aug 2021 09:29:47 -0400 (EDT) Subject: Re: [PATCH][gdb/symtab] Recognize .gdb_index symbol table with empty entries as empty To: Tom de Vries , gdb-patches@sourceware.org References: <20210801180400.GA9164@delia> Message-ID: <5c1bb8ec-e2f7-468a-8035-d6279167f7f4@polymtl.ca> Date: Mon, 2 Aug 2021 09:29:47 -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: <20210801180400.GA9164@delia> 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, 2 Aug 2021 13:29:47 +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-08-01 2:04 p.m., Tom de Vries wrote: > Hi, > > When reading a .gdb_index that contains a non-empty symbol table with only > empty entries, gdb doesn't recognize it as empty. > > Fix this by recognizing that the constant pool is empty, and then setting the > symbol table to empty. > > Tested on x86_64-linux. > > Any comments? > > I don't see the need to propagate to gdb-11-branch, but perhaps I'm wrong there? > > Thanks, > - Tom > > [gdb/symtab] Recognize .gdb_index symbol table with empty entries as empty > > gdb/ChangeLog: > > 2021-08-01 Tom de Vries > > PR symtab/28159 > * dwarf2/read.c (read_gdb_index_from_buffer): Handle symbol table > filled with empty entries. > > gdb/testsuite/ChangeLog: > > 2021-08-01 Tom de Vries > > PR symtab/28159 > * gdb.dwarf2/dw2-zero-range.exp: Remove kfail. > > --- > gdb/dwarf2/read.c | 7 +++++++ > gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp | 22 ++-------------------- > 2 files changed, 9 insertions(+), 20 deletions(-) > > diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c > index de84c47b626..a937fbef1cc 100644 > --- a/gdb/dwarf2/read.c > +++ b/gdb/dwarf2/read.c > @@ -2777,6 +2777,13 @@ to use the section anyway."), > ++i; > map->constant_pool = buffer.slice (metadata[i]); > > + if (map->constant_pool.empty () && !map->symbol_table.empty ()) > + { > + map->symbol_table > + = offset_view (gdb::array_view (symbol_table, > + symbol_table)); > + } That probably warrants a little comment. Otherwise, LGTM. Simon