aboutsummaryrefslogtreecommitdiff
path: root/gdb/source.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-12-28 14:10:11 -0700
committerTom Tromey <tom@tromey.com>2021-12-29 11:08:04 -0700
commit7514a661283b9725ceeb4385be67b6b5d7702b2c (patch)
treeec1a988096fef8b15609413267729f3a0b7c7194 /gdb/source.c
parentde4686ffaff8bade61657078990f392b3aa14ff4 (diff)
downloadgdb-7514a661283b9725ceeb4385be67b6b5d7702b2c.zip
gdb-7514a661283b9725ceeb4385be67b6b5d7702b2c.tar.gz
gdb-7514a661283b9725ceeb4385be67b6b5d7702b2c.tar.bz2
Consistently Use ui_file parameter to show callbacks
I happened to notice that one "show" callback was printing to gdb_stdout rather than to the passed-in ui_file parameter. I went through all such callbacks and fixed them to consistently use the ui_file. Regression tested on x86-64 Fedora 34.
Diffstat (limited to 'gdb/source.c')
-rw-r--r--gdb/source.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gdb/source.c b/gdb/source.c
index 44e90bf..f2f1160 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -400,11 +400,11 @@ set_directories_command (const char *args,
function. */
static void
-show_directories_1 (char *ignore, int from_tty)
+show_directories_1 (ui_file *file, char *ignore, int from_tty)
{
- puts_filtered ("Source directories searched: ");
- puts_filtered (source_path.c_str ());
- puts_filtered ("\n");
+ fputs_filtered ("Source directories searched: ", file);
+ fputs_filtered (source_path.c_str (), file);
+ fputs_filtered ("\n", file);
}
/* Handler for "show directories" command. */
@@ -413,7 +413,7 @@ static void
show_directories_command (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
- show_directories_1 (NULL, from_tty);
+ show_directories_1 (file, NULL, from_tty);
}
/* See source.h. */
@@ -485,7 +485,7 @@ directory_command (const char *dirname, int from_tty)
gdb::observers::command_param_changed.notify ("directories",
source_path.c_str ());
if (from_tty)
- show_directories_1 ((char *) 0, from_tty);
+ show_directories_1 (gdb_stdout, (char *) 0, from_tty);
}
}