aboutsummaryrefslogtreecommitdiff
path: root/gdb/ui-out.h
diff options
context:
space:
mode:
authorAaron Merey <amerey@redhat.com>2025-01-21 16:09:47 -0500
committerAaron Merey <amerey@redhat.com>2025-01-24 09:57:38 -0500
commit89c07e295b6485e997e7969052aa2ecf7c811409 (patch)
treed4b1c159f76df421c65b622bbfdc0dbad92e1a67 /gdb/ui-out.h
parent8ce1af0a1d8ecdefcd97f006a2f584dd6fd36ea6 (diff)
downloadgdb-users/amerey/download-gdb-index.zip
gdb-users/amerey/download-gdb-index.tar.gz
gdb-users/amerey/download-gdb-index.tar.bz2
gdb/debuginfod: Add .debug_line downloadingusers/amerey/download-gdb-index
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.
Diffstat (limited to 'gdb/ui-out.h')
-rw-r--r--gdb/ui-out.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/ui-out.h b/gdb/ui-out.h
index 5d03281..e290f83 100644
--- a/gdb/ui-out.h
+++ b/gdb/ui-out.h
@@ -300,6 +300,21 @@ class ui_out
BAR
};
+ /* Used to communicate the status of a newline prefix for the next progress
+ update message. */
+ enum prefix_state
+ {
+ /* Do not modify the next progress update message. */
+ NEWLINE_OFF,
+
+ /* The next progress update message should include a newline prefix. */
+ NEWLINE_NEEDED,
+
+ /* A newline prefix was included in a debuginfod progress update
+ message. */
+ NEWLINE_PRINTED
+ };
+
/* SHOULD_PRINT indicates whether something should be printed for a tty. */
progress_update ()
{
@@ -398,6 +413,11 @@ protected:
ui_out_level *current_level () const;
};
+typedef ui_out::progress_update::prefix_state prefix_state_t;
+
+/* Current state of the newline prefix. */
+extern prefix_state_t cur_prefix_state;
+
/* Start a new tuple or list on construction, and end it on
destruction. Normally this is used via the typedefs
ui_out_emit_tuple and ui_out_emit_list. */