From patchwork Sun Dec 10 16:44:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 81809 Return-Path: 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 463363857C61 for ; Sun, 10 Dec 2023 16:45:25 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta040.useast.a.cloudfilter.net (omta040.useast.a.cloudfilter.net [44.202.169.39]) by sourceware.org (Postfix) with ESMTPS id 1F2D33858C74 for ; Sun, 10 Dec 2023 16:45:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1F2D33858C74 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 1F2D33858C74 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702226706; cv=none; b=vRrC6efBlk2Yf/2+rpOiJ9or9jKdsQDDSCPMHar4rOGWNLtOatybainezZaiaNaU3DZsLn1UZmZ/SLRV/GIHGae79TiELv6OzweGdM8GV5uF4IevUFgJkguN5ZgKeMeOUlIScfL5xJjj81QbB4nPIipnAVsaRhJGXdKeSg9d6Pg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702226706; c=relaxed/simple; bh=mzaop/1NHFOXFS7IIMf49VOCMT/3k2e4rWDIItl5Vu0=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=MkuFdfFB3McoM5G9Gs+G5GFl95tsuwavWLpxsgcQOmBMbfLUAGjK5/D9O+n47YIsFJOuxA7EXZJyT8G8f0kqRW1nDyciQs+6YD0kqHeblvtfqMdCFMPuBUMJwXznnyhgf+F9qg0cc4bpy5JRbfAj2c9WmQa1jDAS/CFCrNujcqM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6009a.ext.cloudfilter.net ([10.0.30.184]) by cmsmtp with ESMTPS id CHXYrVh7d6nOZCMvPrqujx; Sun, 10 Dec 2023 16:45:03 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id CMvOre6yiBOccCMvPr3jWy; Sun, 10 Dec 2023 16:45:03 +0000 X-Authority-Analysis: v=2.4 cv=J+25USrS c=1 sm=1 tr=0 ts=6575eb0f a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10 a=e2cXIFwxEfEA:10 a=Qbun_eYptAEA:10 a=_8YuhEdOrvctkKKJAOoA:9 a=QEXdDO2ut3YA:10 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=clvKUasCOcK4r+77yHW9pipiVqmzxlIfMDuskwpWi0U=; b=xnPq48OP6CA+G4uVNXHZkleg/4 aPgbC/QAB6C5CySpPJR8kc+qvn1FijmwaZMZmLpSvyWcleo0TDevSNHLJ5Tj15h3QNjvSIfEqVGFZ z9mUUIEy+GgadJ2kcgCPx0r1D; Received: from [198.59.47.65] (port=52394 helo=[192.168.131.83]) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rCMvO-001rpu-2A for gdb-patches@sourceware.org; Sun, 10 Dec 2023 09:45:02 -0700 From: Tom Tromey Date: Sun, 10 Dec 2023 09:44:54 -0700 Subject: [PATCH 05/17] Document GDB extensions to DWARF .debug_names MIME-Version: 1.0 Message-Id: <20231210-debug-names-fix-v1-5-a8f6d2525018@tromey.com> References: <20231210-debug-names-fix-v1-0-a8f6d2525018@tromey.com> In-Reply-To: <20231210-debug-names-fix-v1-0-a8f6d2525018@tromey.com> To: gdb-patches@sourceware.org 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: 198.59.47.65 X-Source-L: No X-Exim-ID: 1rCMvO-001rpu-2A X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([192.168.131.83]) [198.59.47.65]:52394 X-Source-Auth: tom+tromey.com X-Email-Count: 6 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfJIEeKBswvSqaoxz1g1B+60HzaK3fKVKI418kqguyzuSRTG2h5GxPZkGcNoTto/hWg6TyuqgAA1lkPmRh4GF1gd/3UqG5rmVy7+lsN5lbrb+hQDLDXsr MwUFliLXFedutNB75qS965mTkyjzbClhxXAhuHJzPxUkuPlgXVma+JCbqAWQ2pbV9wnFpLYORcx7NuQEDnwR+ifqwvYuHUNrN14= X-Spam-Status: No, score=-3023.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org GDB's new .debug_names implementation uses some extensions. This patch adds some documentation on this to the manual. Reviewed-By: Eli Zaretskii --- gdb/doc/gdb.texinfo | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 139484460c8..755f48ed1de 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -21477,6 +21477,7 @@ program. To debug a core dump of a previous run, you must also tell * Separate Debug Files:: Debugging information in separate files * MiniDebugInfo:: Debugging information in a special section * Index Files:: Index files speed up GDB +* Debug Names:: Extensions to .debug_names * Symbol Errors:: Errors reading symbol files * Data Files:: GDB data files @end menu @@ -22680,6 +22681,44 @@ Print the number of cache hits and misses since the launch of @value{GDBN}. @end table +@node Debug Names +@section Extensions to @samp{.debug_names} +@cindex index files +@cindex @samp{.debug_names} section + +The DWARF specification documents an optional index section called +@samp{.debug_names}. @value{GDBN} can both read and create this +section. However, in order to work with @value{GDBN}, some extensions +were necessary. + +@value{GDBN} uses the augmentation string @samp{GDB2}. Earlier +versions used the string @samp{GDB}, but these versions of the index +are no longer supported. + +@value{GDBN} does not use the specified hash table. Therefore, +because this hash table is optional, @value{GDBN} also does not write +it. + +@value{GDBN} also generates and uses some extra index attributes: +@table @code +@item DW_IDX_GNU_internal +This has the value @samp{0x2000}. It is a flag that, when set, +indicates that the associated entry has @code{static} linkage. + +@item DW_IDX_GNU_main +This has the value @samp{0x2002}. It is a flag that, when set, +indicates that the associated entry is the program's @code{main}. + +@item DW_IDX_GNU_language +This has the value @samp{0x2003}. It is @samp{DW_LANG_} constant, +indicating the language of the associated entry. + +@item DW_IDX_GNU_linkage_name +This has the value @samp{0x2004}. It is a flag that, when set, +indicates that the associated entry is a linkage name, and not a +source name. +@end table + @node Symbol Errors @section Errors Reading Symbol Files