aboutsummaryrefslogtreecommitdiff
path: root/gdb/ui-file.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-12-31 14:34:07 -0700
committerTom Tromey <tom@tromey.com>2022-03-29 12:46:24 -0600
commit9b7167182d1f6fef32c264587bbc00c7f9bd21f2 (patch)
tree23ffdf79803d8daf6a9d7777443f7869b30fa6a1 /gdb/ui-file.h
parentdcf1a2c8d2f5776796927d147f40214d23c818de (diff)
downloadfsf-binutils-gdb-9b7167182d1f6fef32c264587bbc00c7f9bd21f2.zip
fsf-binutils-gdb-9b7167182d1f6fef32c264587bbc00c7f9bd21f2.tar.gz
fsf-binutils-gdb-9b7167182d1f6fef32c264587bbc00c7f9bd21f2.tar.bz2
Add puts_unfiltered method to ui_file
When the pager is rewritten as a ui_file, gdb will still need a way to bypass the filtering. After examining a few approaches, I chose this patch, which adds a puts_unfiltered method to ui_file. For most implementations of ui_file, this will just delegate to puts. This patch also switches printf_unfiltered to use the new method.
Diffstat (limited to 'gdb/ui-file.h')
-rw-r--r--gdb/ui-file.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/ui-file.h b/gdb/ui-file.h
index 8d41f6f..7ae3937 100644
--- a/gdb/ui-file.h
+++ b/gdb/ui-file.h
@@ -124,6 +124,14 @@ public:
used to force out output from the wrap_buffer. */
void wrap_here (int indent);
+ /* Print STR, bypassing any paging that might be done by this
+ ui_file. Note that nearly no code should call this -- it's
+ intended for use by printf_filtered, but nothing else. */
+ virtual void puts_unfiltered (const char *str)
+ {
+ this->puts (str);
+ }
+
private:
/* Helper function for putstr and putstrn. Print the character C on
@@ -342,6 +350,12 @@ public:
return m_one->can_page () || m_two->can_page ();
}
+ void puts_unfiltered (const char *str) override
+ {
+ m_one->puts_unfiltered (str);
+ m_two->puts_unfiltered (str);
+ }
+
private:
/* The two underlying ui_files. */
ui_file *m_one;