aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-uiout.h
diff options
context:
space:
mode:
authorAaron Merey <amerey@redhat.com>2024-01-12 14:38:45 -0500
committerAaron Merey <amerey@redhat.com>2024-01-19 00:18:00 -0500
commit519d634396592c5698add4a327468e6e6920576e (patch)
tree695c241945e77efdfae59af2a33922425cb8f290 /gdb/python/py-uiout.h
parent64db3e4d881d347704139c89d90048082774c9cc (diff)
downloadgdb-519d634396592c5698add4a327468e6e6920576e.zip
gdb-519d634396592c5698add4a327468e6e6920576e.tar.gz
gdb-519d634396592c5698add4a327468e6e6920576e.tar.bz2
gdb: Buffer output streams during events that might download debuginfo
Introduce new ui_file buffering_file to temporarily collect output written to gdb_std* output streams during print_thread, print_frame_info and print_stop_event. This ensures that output during these functions is not interrupted by debuginfod progress messages. With the addition of deferred debuginfo downloading it is possible for download progress messages to print during these events. Without any intervention we can end up with poorly formatted output: (gdb) backtrace [...] #8 0x00007fbe8af7d7cf in pygi_invoke_c_callable (Downloading separate debug info for /lib64/libpython3.11.so.1.0 function_cache=0x561221b224d0, state=<optimized out>... To fix this we buffer writes to gdb_std* output streams while allowing debuginfod progress messages to skip the buffers and print to the underlying output streams immediately. Buffered output is then written to the output streams. This ensures that progress messages print first, followed by uninterrupted frame/thread/stop info: (gdb) backtrace [...] Downloading separate debug info for /lib64/libpython3.11.so.1.0 #8 0x00007fbe8af7d7cf in pygi_invoke_c_callable (function_cache=0x561221b224d0, state=<optimized out>... Co-Authored-By: Andrew Burgess <aburgess@redhat.com> Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb/python/py-uiout.h')
-rw-r--r--gdb/python/py-uiout.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/python/py-uiout.h b/gdb/python/py-uiout.h
index e80e272..a2fc90e 100644
--- a/gdb/python/py-uiout.h
+++ b/gdb/python/py-uiout.h
@@ -56,6 +56,9 @@ public:
return std::move (current ().obj);
}
+ ui_file *current_stream () const override
+ { return nullptr; }
+
protected:
void do_progress_end () override { }