]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb/debuginfod: Add .debug_line downloading users/amerey/download-gdb-index
authorAaron Merey <amerey@redhat.com>
Tue, 21 Jan 2025 21:09:47 +0000 (16:09 -0500)
committerAaron Merey <amerey@redhat.com>
Fri, 24 Jan 2025 14:57:38 +0000 (09:57 -0500)
commit89c07e295b6485e997e7969052aa2ecf7c811409
treed4b1c159f76df421c65b622bbfdc0dbad92e1a67
parent8ce1af0a1d8ecdefcd97f006a2f584dd6fd36ea6
gdb/debuginfod: Add .debug_line downloading

ELF/DWARF section downloading allows gdb to download .gdb_index files in
order to defer full debuginfo downloads.  However .gdb_index does not
contain any information regarding source filenames.  When a gdb command
includes a filename argument (ex. 'break main.c:50'), this results in
the mass downloading of all deferred debuginfo so that gdb can search the
debuginfo for matching source filenames.  This can result in unnecessary
downloads.

To improve this, have gdb instead download each debuginfo's .debug_line
(and .debug_line_str if using DWARF5) when executing these commands.
Download full debuginfo only when its .debug_line contains a matching
filename.

Since the combined size of .debug_line and .debug_line_str is only about
1% the size of the corresponding debuginfo, significant time can be saved
by checking these sections before choosing to download an entire debuginfo.

This patch also redirects stdout and stderr of the debuginfod server
used by testsuite/gdb.debuginfod tests to a server_log standard output
file.  While adding tests for this patch I ran into an issue where the
test server would block when logging to stderr, presumably because the
stderr buffer filled up and wasn't being read from.  Redirecting the
log to a file fixes this and also makes the server log more accessible
when debugging test failures.
gdb/cli-out.c
gdb/completer.c
gdb/dwarf2/line-header.c
gdb/dwarf2/line-header.h
gdb/dwarf2/read-gdb-index.c
gdb/dwarf2/read.c
gdb/dwarf2/read.h
gdb/mi/mi-out.c
gdb/testsuite/gdb.debuginfod/section.exp
gdb/ui-out.c
gdb/ui-out.h