Message ID | 20220922202054.2773698-1-tromey@adacore.com |
---|---|
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 67E9A3857BB3 for <patchwork@sourceware.org>; Thu, 22 Sep 2022 20:21:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 67E9A3857BB3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1663878092; bh=sxi6VAZRORR18ruhVGEt9+f9GxY15+hmtARmRyFPUR4=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=PQ1dETJ7yd2ZFcEYrOqSb6HglHrvO4VFb7Tw6S1x4peA3txiFW6soCE1kVHAPL086 aFrEacAohp/jpoLcCg3hA2mVSPaTrxrfL0nncA4uoixoyXpUzR3tGvQcMdl/BnZ60r fiTBUQfaWf/h4+KEPo8DlGTAY5h9rEYQjyVhqYPg= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) by sourceware.org (Postfix) with ESMTPS id 9059E3858D38 for <gdb-patches@sourceware.org>; Thu, 22 Sep 2022 20:21:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9059E3858D38 Received: by mail-qk1-x732.google.com with SMTP id i3so7051387qkl.3 for <gdb-patches@sourceware.org>; Thu, 22 Sep 2022 13:21:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date; bh=sxi6VAZRORR18ruhVGEt9+f9GxY15+hmtARmRyFPUR4=; b=hYnQ+HFVsv3hQxy2VecW0T5xNQlbMG2ObiVmEWhexoOo+FRl9MpqrthLsO2jHEz83p 1x1nMx7M8g1z1vP26SbJN+l5M88AEWaaJPLgeRN89lMwXb4sSgwa2KQgZMaUpegDIXf9 RlP/lH1koq18xhY44qDgOU9q0HJAqrL/PGxbnMecDsM0tXPu8qO4mNcEJiRGo7qleB2M i7qR+ss0lBiwI/SsEAsfwjB5ksZAmwgDN7uuvcxkdolcqmB/RyLH7/mdbr149S6zNZ0k J9FxmIzpPu4E/iU6Snd2ywAq90uLLASSpgFTkze0nK25gg8Bco+KfMbiadcNhXgmJBNI mAeA== X-Gm-Message-State: ACrzQf27aQQDz+Wlcrrc+MQSGg9y91MNJfU1n8kd4Ju8N9Mz+WjtKk3C b6dc8+ezPWOI3fMIKquIJn5lhMfL74W7zA== X-Google-Smtp-Source: AMsMyM44Ya+Bdi4LiJR7YrFRxBzz25DEQNBVSGRuA1416PTkFtBqmnMlrXNhUqgox+xUWjhX0yn0Cw== X-Received: by 2002:a05:620a:17a8:b0:6ce:99f0:7626 with SMTP id ay40-20020a05620a17a800b006ce99f07626mr3454002qkb.194.1663878064211; Thu, 22 Sep 2022 13:21:04 -0700 (PDT) Received: from localhost.localdomain (71-211-160-49.hlrn.qwest.net. [71.211.160.49]) by smtp.gmail.com with ESMTPSA id cp4-20020a05622a420400b0035cdd7a42d0sm3869093qtb.22.2022.09.22.13.21.03 for <gdb-patches@sourceware.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 13:21:03 -0700 (PDT) To: gdb-patches@sourceware.org Subject: [PATCH 0/2] Fix .gdb_index with Ada Date: Thu, 22 Sep 2022 14:20:52 -0600 Message-Id: <20220922202054.2773698-1-tromey@adacore.com> X-Mailer: git-send-email 2.34.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> From: Tom Tromey via Gdb-patches <gdb-patches@sourceware.org> Reply-To: Tom Tromey <tromey@adacore.com> Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
Fix .gdb_index with Ada
|
|
Message
Tom Tromey
Sept. 22, 2022, 8:20 p.m. UTC
This series improves .gdb_index support for Ada, fixing a regression introduced by the DWARF reader rewrite. I regression tested this using the cc-with-gdb-index target board on x86-64 Fedora 34. There were no regressions, only improvements. Tom
Comments
On 9/22/22 22:20, Tom Tromey via Gdb-patches wrote: > This series improves .gdb_index support for Ada, fixing a regression > introduced by the DWARF reader rewrite. > > I regression tested this using the cc-with-gdb-index target board on > x86-64 Fedora 34. There were no regressions, only improvements. > Hi, I've tested this series with target board cc-with-gdb-index. The only FAILs I found were: ... $ grep ^FAIL: gdb.sum FAIL: gdb.base/c-linkage-name.exp: print symada__cS before partial symtab expansion FAIL: gdb.dwarf2/dw2-zero-range.exp: ranges_sect=ranges: Zero address complaint - relocated - psymtab FAIL: gdb.dwarf2/dw2-zero-range.exp: ranges_sect=ranges: Zero address complaint - unrelocated - psymtab FAIL: gdb.dwarf2/dw2-zero-range.exp: ranges_sect=rnglists: Zero address complaint - relocated - psymtab FAIL: gdb.dwarf2/dw2-zero-range.exp: ranges_sect=rnglists: Zero address complaint - unrelocated - psymtab FAIL: gdb.python/py-symbol.exp: print (len (gdb.lookup_static_symbols ('rr'))) ... The FAILs from gdb.python/py-symbol.exp and gdb.dwarf2/dw2-zero-range.exp are know, they also fail with target board cc-with-debug-names. The gdb.base/c-linkage-name.exp FAIL does look relevant to this series, and probably was regressed by the same offending commit. Doing: ... diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c index ae05946e790..0268371ec2e 100644 --- a/gdb/dwarf2/index-write.c +++ b/gdb/dwarf2/index-write.c @@ -1167,7 +1167,6 @@ write_cooked_index (cooked_index_vector *table, minimal symbols anyway, so including it in the index is usually redundant -- and the cases where it would not be redundant are rare and not worth supporting. */ - continue; } gdb_index_symbol_kind kind; ... fixes the FAIL, so is this one of the "rare and not worth supporting" cases you're referring to? Thanks, - Tom
>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
Tom> The gdb.base/c-linkage-name.exp FAIL does look relevant to this
Tom> series, and probably was regressed by the same offending commit.
I see this was failing before my series -- but it works in gdb 12.
So, it's one of the regressions the series was intended to fix :(
Tom> Doing:
Tom> ...
Tom> diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c
Tom> index ae05946e790..0268371ec2e 100644
Tom> --- a/gdb/dwarf2/index-write.c
Tom> +++ b/gdb/dwarf2/index-write.c
Tom> @@ -1167,7 +1167,6 @@ write_cooked_index (cooked_index_vector *table,
Tom> minimal symbols anyway, so including it in the index is
Tom> usually redundant -- and the cases where it would not be
Tom> redundant are rare and not worth supporting. */
Tom> - continue;
Tom> }
Tom> gdb_index_symbol_kind kind;
Tom> ...
Tom> fixes the FAIL, so is this one of the "rare and not worth supporting"
Tom> cases you're referring to?
I thought that was necessary to avoid redundancy in the index, but I see
now it isn't, or at least not in that way. I'm looking again at why the
new indices are larger in general.
Tom
Tom> [ ... patch ... ] Tom> fixes the FAIL, so is this one of the "rare and not worth supporting" Tom> cases you're referring to? > I thought that was necessary to avoid redundancy in the index, but I see > now it isn't, or at least not in that way. I'm looking again at why the > new indices are larger in general. I looked into this more. Older versions of gdb don't add C++ symbols to the index, so when I diff'd the indexes I saw a lot of "_Z" additions. Locally I've changed this code to skip linkage names for C++ only. I compared the symbols from old and new indexes. In every case (except the one below) I checked, the new gdb seemed more correct. In particular it added inlined functions to the index, and it used the correct name for "enum class" enumerator constants. I did find out that the new index included entries for the linkage names of classes. This isn't generally useful, and they have weird names like "6mumble", so I also have a patch to drop these entries from the cooked index entirely. Tom
On 10/13/22 22:40, Tom Tromey wrote: > Tom> [ ... patch ... ] > Tom> fixes the FAIL, so is this one of the "rare and not worth supporting" > Tom> cases you're referring to? > >> I thought that was necessary to avoid redundancy in the index, but I see >> now it isn't, or at least not in that way. I'm looking again at why the >> new indices are larger in general. > > I looked into this more. > > Older versions of gdb don't add C++ symbols to the index, so when I > diff'd the indexes I saw a lot of "_Z" additions. Locally I've changed > this code to skip linkage names for C++ only. > Ah, does that then fix the c-linkage-name.exp regression? Thanks, - Tom > I compared the symbols from old and new indexes. In every case (except > the one below) I checked, the new gdb seemed more correct. In > particular it added inlined functions to the index, and it used the > correct name for "enum class" enumerator constants. > > I did find out that the new index included entries for the linkage names > of classes. This isn't generally useful, and they have weird names like > "6mumble", so I also have a patch to drop these entries from the cooked > index entirely. > > Tom
>> I looked into this more. >> Older versions of gdb don't add C++ symbols to the index, so when I >> diff'd the indexes I saw a lot of "_Z" additions. Locally I've changed >> this code to skip linkage names for C++ only. >> Tom> Ah, does that then fix the c-linkage-name.exp regression? Yeah. I'm testing the updated series now, I hope to send it today. Tom