gdb: reference gold --gdb-index in documentation
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gdb_build--master-arm |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-arm |
success
|
Test passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 |
success
|
Test passed
|
Commit Message
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(+)
Comments
> From: Robert Guthrie <forkbombidable@gmail.com>
> Cc: Robert Guthrie <forkbombidable@gmail.com>
> Date: Fri, 4 Oct 2024 23:50:52 -0500
>
> 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.
Thanks, installed in your name.
@@ -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