From patchwork Sat Oct 5 04:50:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Guthrie X-Patchwork-Id: 98422 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 24F77385EC3F for ; Sat, 5 Oct 2024 04:55:04 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-oi1-x243.google.com (mail-oi1-x243.google.com [IPv6:2607:f8b0:4864:20::243]) by sourceware.org (Postfix) with ESMTPS id D42C7385DDDB for ; Sat, 5 Oct 2024 04:54:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D42C7385DDDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D42C7385DDDB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::243 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728104084; cv=none; b=x2vXd8P5Oc04CK/4ARb88QdI1OQzRPWWxQCMaywr/zgUIr4bPfcHhHuWiSDgycKRDod0T06fsH5DeUQxa1H7xHDNcjnmEtp84VXx0Dpsau8EJYxb9wlkPE7QTDhgy0OlMSJelh9pQndhOTYOV9tGmhi6USW1mFGtTdHeeuybP4U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728104084; c=relaxed/simple; bh=DBHjWTXksMUyKZf+2UNiZY+Clcx+UT2Q2uomvxR06m4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=iPqJEhH+fEBHtHyN1WaXsPPVqYs4HQCf1xOzNbahi43C4Z2hkbmduSfEep4syhu5CnviZnzPY4NVuj6ryB12iiHMXtk/I1MfO+elcT0NgZxzcXCIH31Egy+7O1eaqADiP8Tcmv+TUlPyN9d6Bw0t9OxtmAv1BlJAxvnBUjoP0TE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oi1-x243.google.com with SMTP id 5614622812f47-3e042f4636dso1725718b6e.1 for ; Fri, 04 Oct 2024 21:54:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728104080; x=1728708880; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=GVjeivy2sSKUIKyBnB9/2TIbQhQnaYamBC+4luTy8WE=; b=mIYrW/qX0vuAkFxCcwl9cfzTpN2uMxiuQtJeg0C/GoShY/mrjV8bEZa0EXSyajjinD hJ8LeCEB9BTxoo2468kAEpHkFRdHwkc3l0j5gOmQjDfglqiG0qO2bltQ5ldaBe5AUMnW JuComWeqfuZ1FY5GvGHJlaf5mzSFAbsFGVQxcaIqLMqpXoXrEvSlnfACO/8WvNCvaOkQ Cj+cKHuT7QdXq8xALVNMMy8KuGn5dYImuw9ABTd3jxdy1A2fFRLRuIpqmcV5dNdhi7+Q 72CQmxg3HBl+D+e9HeZvdh54+nW7hnx24Lr9VMnTehNuTFe1mSRQBhm6+2DdcMi5XElK 6Olg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728104080; x=1728708880; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GVjeivy2sSKUIKyBnB9/2TIbQhQnaYamBC+4luTy8WE=; b=ZGYAMaK+BlPxr3wE56HwKY1gQyNoPjVHq1hkMJqtxciCCeCCTZ40rHdsx/6aIhM5jZ XgcBdpZiiC9evOtkQm+FcOGUHTcJ8UVikMCwPGerbmE3gIjigQfdm0HR0tfcSAPLYDFW w6hcN2KUzAaxG9LheIlRLOOdSXeg906whD5GdN88PevLKwM0uWLGxn2CjEMR5MC8dFj4 DiSLWYosU8qcZ8RnyGdefC0wmUdaCdcRYEyOaTWycDYEGrbqHu+w4PHlcjn34oI6nzju pAL1lmkZpeswOMIISm6o37/AxSNFjDnme0hHUXzFHvvOdZlzeVrgjARf+G0SYk8L+2pE cUTA== X-Gm-Message-State: AOJu0YyY3o+H4zuxVlgf5igpxRKL0pVNkctAqX699PhD30/FN32c7tmb 7HUoY27/Rx9ibJeK8Vkh+Eg6mznvyrFgZPNsGtTYuG+/X6q0yMCEAYnTWAhpfMU= X-Google-Smtp-Source: AGHT+IEfuTFz4VG5yu9h8HXD+lSuMkIdinXvpBv2t88EXleGKrFV8FgcqTiA7M4cus0V3aWgOEKHQA== X-Received: by 2002:a05:6808:2229:b0:3e0:1299:4dc with SMTP id 5614622812f47-3e3c133d297mr3195522b6e.25.1728104080460; Fri, 04 Oct 2024 21:54:40 -0700 (PDT) Received: from berttop.attlocal.net ([2600:382:3df0:e047::2f]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5e7d7120310sm393572eaf.6.2024.10.04.21.54.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 21:54:39 -0700 (PDT) From: Robert Guthrie To: gdb-patches@sourceware.org Cc: Robert Guthrie Subject: [PATCH] gdb: reference gold --gdb-index in documentation Date: Fri, 4 Oct 2024 23:50:52 -0500 Message-ID: <20241005045224.20415-3-forkbombidable@gmail.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, 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.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 Hello, I recently learned about the --gdb-index flag on the GNU linker. This has been quite an improvement for my workflow with GDB. I've asked some developers I respect if they knew about this, and none of them did. There doesn't appear to be any reference to this whatsoever in the GDB documentation. I think it is appropriate to mention, given its usefulness and GDB's close relationship to gold. Apologies if this patch is sub par as-is. I haven't contributed to GNU documentation before, so there may be some conventions I am not aware of that I did not follow. Thank you --- gdb/doc/gdb.texinfo | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index cc1b69c6978..3ef3f7d4747 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -22862,6 +22862,18 @@ Print the number of cache hits and misses since the launch of @value{GDBN}. @end table +@subsection Building the index with the GNU @command{gold} linker + +The GNU @command{gold} linker can write the index at link time into the resulting ELF +file, by passing the @command{--gdb-index} flag to @command{gold}. + +This is especially helpful if you intend to build a program and immediately +run it under @value{GDBN}. You may find that it is faster overall for +the linker to write the index while it has the relevant information in +memory anyways, rather than re-reloading the data from disk with +@command{gdb-add-index}, or debugging the program without an index at +all, especially for large programs. + @node Debug Names @section Extensions to @samp{.debug_names} @cindex index files