GDB-ADD-INDEX(1)

๐Ÿ“ฆ
version 7.2.4 ยท 2 versions
, in arch rolling

๐Ÿ’… gdb-add-index โ€” like, the manual page but make it cute

okay so this is gdb-add-index from the GNU Development Tools collection, and honestly? it's a whole vibe. it's the little script that makes ROCGDB start up fast, and you're gonna love her. let's get into it ๐Ÿซถ


โœจ NAME โœจ

gdb-add-index โ€” adds index files so GDB starts up quicker. that's it. that's the whole job. iconic behavior only ๐Ÿ’…


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

gdb-add-index [-dwarf-5] filename

๐ŸŒธ DESCRIPTION ๐ŸŒธ

okay so picture this: when ROCGDB finds a symbol file, it literally has to scan all the symbols in that file to build its own internal symbol table. and like โ€” that's what makes most ROCGDB operations feel fast, but the tradeoff is there's this delay at the very beginning. for big programs? that delay can be so lengthy, bestie. genuinely painful. so ROCGDB gives you a way to build an index ahead of time, and that speeds up startup. main character energy: the index did that ๐Ÿ’–

wanna know if a file already has an index? run readelf -S filename โ€” the index lives in a section named .gdb_index (pre-DWARF 5) or .debug_names and .debug_str (DWARF 5). easy check, no cap.

heads up: indexes can only be produced on systems that use ELF binaries and DWARF debug information (i.e., sections named .debug_*). so if that's not your setup, this whole thing is a no ๐Ÿ’€

by default, gdb-add-index will add a pre-DWARF 5 .gdb_index section to filename. but if you pass -dwarf-5, then DWARF 5 sections get added instead. glow-up โœจ

filename must be writable. like, non-negotiable. it's writing into your file, so yeah ๐Ÿซถ

gdb-add-index uses ROCGDB, objcopy, and readelf found in the PATH environment variable. if you want different versions of these programs, you can specify them through the appropriate environment variables (see below ๐Ÿ‘‡).

and the exit status? gdb-add-index exits with status 0 if it succeeds in creating the index for filename, or greater than 0 if an error occurs. clean and simple, we love a binary outcome ๐ŸŽ€

there's more lore in the ROCGDB manual, in the node "Index Files" โ€” shell command:

info -f gdb -n "Index Files"

go read it, iykyk ๐Ÿ“–


โญ OPTIONS โญ

  • -dwarf-5 โ€” add DWARF 5 sections instead of the previous .debug_index section. new-gen sections, basically ๐Ÿ”ฅ

๐Ÿฆ‹ ENVIRONMENT ๐Ÿฆ‹

  • GDB โ€” full file name of the "gdb" program to use for index generation. if it's not set, the PATH will be searched for a "gdb" program.
  • OBJCOPY โ€” full file name of the "objcopy" program used to copy section information into the given file. if it's not set, the PATH will be searched for a "objcopy" program.
  • READELF โ€” full file name of the "readelf" program used to inspect properties of the given file. if it's not set, the PATH will be searched for a "readelf" program.

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

the full documentation for ROCGDB is maintained as a Texinfo manual. if the "info" and "gdb" programs and ROCGDB's Texinfo documentation are properly installed at your site, then this command:

info gdb

should give you access to the complete manual. slay ๐Ÿ’œ

also, Using GDB: A Guide to the GNU Source-Level Debugger, by Richard M. Stallman and Roland H. Pesch, July 1991. vintage. we respect the classics ๐Ÿ‘‘


Copyright ยฉ 1988-2024 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with the Invariant Sections being "Free Software" and "Free Software Needs Free Documentation", with the Front-Cover Texts being "A GNU Manual,", and with the Back-Cover Texts as in (a) below.

(a) The FSF's Back-Cover Text is: "You are free to copy and modify this GNU Manual. Buying copies from GNU Press supports the FSF in developing GNU and promoting software freedom."

AMD ROCm software is made available by Advanced Micro Devices, Inc. under the open source license identified in the top-level directory for the library in the repository on @url{https://github.com/ROCm/,Github.com} (Portions of AMD ROCm software are licensed under MITx11 and UIL/NCSA. For more information on the license, review the license.txt in the top-level directory for the library on @url{https://github.com/ROCm/,Github.com}). The additional terms and conditions below apply to your use of AMD ROCm technical documentation.

ยฉ2019-2024 Advanced Micro Devices, Inc. All rights reserved.

The information presented in this document is for informational purposes only and may contain technical inaccuracies, omissions, and typographical errors. The information contained herein is subject to change and may be rendered inaccurate for many reasons, including but not limited to product and roadmap changes, component and motherboard version changes, new model and/or product releases, product differences between differing manufacturers, software changes, BIOS flashes, firmware upgrades, or the like. Any computer system has risks of security vulnerabilities that cannot be completely prevented or mitigated. AMD assumes no obligation to update or otherwise correct or revise this information. However, AMD reserves the right to revise this information and to make changes from time to time to the content hereof without obligation of AMD to notify any person of such revisions or changes.

THIS INFORMATION IS PROVIDED "AS IS." AMD MAKES NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE CONTENTS HEREOF AND ASSUMES NO RESPONSIBILITY FOR ANY INACCURACIES, ERRORS, OR OMISSIONS THAT MAY APPEAR IN THIS INFORMATION. AMD SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR ANY PARTICULAR PURPOSE. IN NO EVENT WILL AMD BE LIABLE TO ANY PERSON FOR ANY RELIANCE, DIRECT, INDIRECT, SPECIAL, OR OTHER CONSEQUENTIAL DAMAGES ARISING FROM THE USE OF ANY INFORMATION CONTAINED HEREIN, EVEN IF AMD IS EXPRESSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

AMD, the AMD Arrow logo, AMD Instinctโ„ข, Radeonโ„ข, AMD ROCmโ„ข, and combinations thereof are trademarks of Advanced Micro Devices, Inc. Linuxยฎ is the registered trademark of Linus Torvalds in the U.S. and other countries. PCIeยฎ is a registered trademark of PCI-SIG Corporation. Other product names used in this publication are for identification purposes only and may be trademarks of their respective companies.


๐Ÿ’€ bestie that disclaimer was long but we got through it together, and that's what matters

and that's the whole page! this one's from gdb-16.3, dated 2026-05-31 โ€” go forth and index responsibly, you absolute icon ๐Ÿงšโ€โ™€๏ธ๐Ÿ“๐Ÿ’–

๐Ÿ“ฆ where this page comes from