From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta034.useast.a.cloudfilter.net (omta034.useast.a.cloudfilter.net [44.202.169.33]) by sourceware.org (Postfix) with ESMTPS id 614813858424 for ; Wed, 17 Jan 2024 16:39:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 614813858424 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 614813858424 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705509579; cv=none; b=QUYlJnrkJmqO5M8l5RLdZKvr63MZR9WW+wOTObp9ImCUdyBeMWR25hrznESQwRhnm/STwc8i1kaD9OnnXKvb0BeaqBkMLgFNKwYbW6sfFGgClh82tIvs4p0WNeotwpLu1Dbl6SbpzvSFaMwpKOyxftrgq3LjVJ/upp/avwUz4sQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705509579; c=relaxed/simple; bh=OrTzIlW+ACQ83ld/+S6kA8IymroH8pvkQpkbmQqwYG4=; h=DKIM-Signature:From:Subject:Date:Message-Id:MIME-Version:To; b=GC9brgxU0xRz4Urb9y/6T1E70wygsDA3PpmGW7VsfaQVDFmMyTX/5UQb+p0b4QeSOVk6oTrK5v7G/opGZjPHkN42rwaKtdc14ovWdWRG9Ud2V31a7ftZx7dEiajQQck7GT3/G1B1hEXLVIOLgHlMxhjcrAR1rrhd4Fb+aXiAKgE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6006a.ext.cloudfilter.net ([10.0.30.182]) by cmsmtp with ESMTPS id Py2Frwby5AxAkQ8xErDaq6; Wed, 17 Jan 2024 16:39:53 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id Q8wyrlzZGYjq0Q8wyrFRCS; Wed, 17 Jan 2024 16:39:36 +0000 X-Authority-Analysis: v=2.4 cv=afxyIDkt c=1 sm=1 tr=0 ts=65a802c8 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10 a=dEuoMetlWLkA:10 a=Qbun_eYptAEA:10 a=CCpqsmhAAAAA:8 a=zstS-IiYAAAA:8 a=KGmeBRrGeaC3ehHGgzEA:9 a=QEXdDO2ut3YA:10 a=ul9cdbp4aOFLsgKbc677:22 a=4G6NA9xxw8l3yy4pmD5M:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Cc:To:Content-Transfer-Encoding:Content-Type:MIME-Version: Message-Id:Date:Subject:From:Sender:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=0wPur9tjEpwsq243YBT3ocZg8MTHpwaWadQa9ouq17c=; b=gyhamCKtaGFZyTniVqEYPRYQfg rhJ5Lr1MMJ5GMu88MrN+aeEYARSRMHQwu6yk4yNFptJXQKWx6MQeUq5+RTrhdedkJYGgKq7D4QIsc 1m5kW9DjvAPrcb+q/gSezcLY2; Received: from 97-122-68-157.hlrn.qwest.net ([97.122.68.157]:56636 helo=[192.168.0.21]) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rQ8wx-002OXE-2D; Wed, 17 Jan 2024 09:39:35 -0700 From: Tom Tromey Subject: [PATCH v2 00/17] Rewrite .debug_names reader and writer Date: Wed, 17 Jan 2024 09:39:28 -0700 Message-Id: <20240117-debug-names-fix-v2-0-dbd5971a9c31@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAMECqGUC/3WNwQ6DIBBEf8Vw7jZAozU99T8aD4CLcgCaXWpqj P9e9N7jm8zM2wQjBWTxaDZBuAQOOVXQl0a42aQJIYyVhZb6prSSMKL9TJBMRAYfvuC8Nb6/dwq dE3X1Jqzx+fgaKlvDCJZMcvPxEw0XpKM4By6Z1tO8qKP+X7IokGB634261a1U/bNQjrheXY5i2 Pf9BymNgUfIAAAA To: gdb-patches@sourceware.org Cc: Eli Zaretskii X-Mailer: b4 0.12.4 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.68.157 X-Source-L: No X-Exim-ID: 1rQ8wx-002OXE-2D X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-68-157.hlrn.qwest.net ([192.168.0.21]) [97.122.68.157]:56636 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfLYFdaaG5CvwJC7WB0zUB7dc8eC9ryUJp7c+7vKKlVEoiid8AC88r+JKBTywlAil8mjLwKUmtiV650sgqinpZM+bjP0UnX91+aw46pS+v6eKRqFm+WMR nw69lHaF154+JdejmuBcX8tX1NgtwXQFVzaQGZuB886h3UKAGZNUVxd9+NP6e0Ad3NbmqZO3W9rJ131THS7yv77DBXub/y7a2uY= X-Spam-Status: No, score=-3016.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This series rewrites gdb's .debug_names reader and writer. Currently, gdb can generate a .debug_names index, but the contents are very wrong -- they use fully-qualified names, which is not at all what is envisioned in the DWARF spec. After this series, the section contents will be much closer to DWARF. However, it's not really useful for gdb to follow DWARF exactly. First, the DWARF spec has a few bugs affecting the generation of the index. GDB fixes these -- you won't see these fixes in this series, though, as they were all handled by the new DWARF scanner. Second, gdb likes to have some information not readily available in the DWARF-specified contents. You can see the new DW_IDX_* constants patch for a list. I've regression tested this using the default board and the cc-with-debug-names board on x86-64 Fedora 38. It's possible that there are regressions with cc-with-debug-names at some intermediate points in the series -- in particular I think it would happen after the reader is rewritten but before the writer patch is applied. I didn't test this situation, since I don't think it is very important. It could be worked around by combining the two patches, but I thought that would make review much more difficult. --- Changes in v2: - Updated some tests - Reverted change to be strict about requiring .debug_aranges - Link to v1: https://inbox.sourceware.org/gdb-patches/20231210-debug-names-fix-v1-0-a8f6d2525018@tromey.com --- Tom Tromey (17): Refactor 'maint set dwarf synchronous' handling Refactor quick-function installation in DWARF reader Remove IS_ENUM_CLASS from cooked_index_flag Document GDB extensions to DWARF .debug_names Add language to cooked_index_entry Move cooked_index_functions to cooked-index.h Do not write the index cache from an index Change cooked_index_worker to abstract base class Remove cooked_index_worker::start_reading Empty hash table fix in .debug_names reader Fix dw2-zero-range.exp when an index is in use Explicitly expand CUs in dw2-inline-with-lexical-scope.exp Remove some .debug_names tests Allow other results in DW_TAG_entry_point test Rewrite .debug_names reader Export dwarf5_augmentation Rewrite .debug_names writer gdb/doc/gdb.texinfo | 39 + gdb/dwarf2/cooked-index.c | 164 +++- gdb/dwarf2/cooked-index.h | 168 +++- gdb/dwarf2/index-write.c | 401 ++++----- gdb/dwarf2/mapped-index.h | 4 +- gdb/dwarf2/read-debug-names.c | 956 ++++++++------------- gdb/dwarf2/read-debug-names.h | 2 + gdb/dwarf2/read.c | 341 ++------ gdb/testsuite/gdb.dwarf2/clang-debug-names-2-foo.c | 22 - gdb/testsuite/gdb.dwarf2/clang-debug-names-2.c | 27 - gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp | 42 - gdb/testsuite/gdb.dwarf2/clang-debug-names.c | 25 - gdb/testsuite/gdb.dwarf2/clang-debug-names.exp | 42 - gdb/testsuite/gdb.dwarf2/clang-debug-names.exp.tcl | 121 --- .../gdb.dwarf2/debug-names-bad-cu-index.exp | 20 +- gdb/testsuite/gdb.dwarf2/dw2-entry-points.exp | 5 +- gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp | 7 + .../gdb.dwarf2/dw2-inline-with-lexical-scope.exp | 4 + gdb/testsuite/gdb.dwarf2/dw2-minsym-in-cu.exp | 10 + gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp | 10 +- gdb/testsuite/lib/dwarf.exp | 7 +- 21 files changed, 976 insertions(+), 1441 deletions(-) --- base-commit: 2002c0099f9fb4d737930acd66733cfad39f68f1 change-id: 20231210-debug-names-fix-cfbaf8761ecc Best regards, -- Tom Tromey