GDB-ADD-INDEX(1)

NAME
gdb-add-index - Add index files to speed up GDB

SYNOPSIS
gdb-add-index [-h | --help] [-v | --version] [--dwarf-5] filename

DESCRIPTION
When ROCGDB finds a symbol file, it scans the symbols in the file in order to construct an internal symbol table. This lets most ROCGDB operations work quickly--at the cost of a delay early on. For large programs, this delay can be quite lengthy, so ROCGDB provides a way to build an index, which speeds up startup.

To determine whether a file contains such an index, use the command "readelf -S filename": the index is stored in a section named ".gdb_index" (pre-DWARF 5) or ".debug_names" and ".debug_str" (DWARF 5). Indexes can only be produced on systems which use ELF binaries and DWARF debug information (i.e., sections named ".debug_*").

By default gdb-add-index will add a pre-DWARF 5 ".gdb_index" section to filename. With --dwarf-5 the DWARF 5 section ".debug_names" is added instead.

filename must be writable.

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

gdb-add-index exits with status 0 if it succeeds in creating the index for filename or greater than 0 if an error occurs.

See more in the ROCGDB manual in node "Index Files" -- shell command "info -f gdb -n "Index Files"".

OPTIONS

--dwarf-5
    Add DWARF 5 sections instead of previous ".gdb_index" section.

--help
-h  List all options, with brief explanations.

--version
-v  Print version information and then exit.

ENVIRONMENT

GDB Full file name of the "gdb" program to use for index generation. If not set, the PATH will be searched for a "gdb" program.

OBJCOPY
    Full file name of the "objcopy" program to use to copy section information into the given file. If not set, the PATH will be searched for a "objcopy" program.

READELF
    Full file name of the "readelf" program to use to inspect properties of the given file. If 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, the command

        info gdb

should give you access to the complete manual.

Using GDB: A Guide to the GNU Source-Level Debugger, Richard M. Stallman and Roland H. Pesch, July 1991.

COPYRIGHT
Copyright © 1988-2026 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."

Legal Disclaimer and Copyright Information

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-2026 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.