diff options
author | Tom Tromey <tom@tromey.com> | 2021-12-28 14:10:11 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-12-29 11:08:04 -0700 |
commit | 7514a661283b9725ceeb4385be67b6b5d7702b2c (patch) | |
tree | ec1a988096fef8b15609413267729f3a0b7c7194 /gdb/remote.c | |
parent | de4686ffaff8bade61657078990f392b3aa14ff4 (diff) | |
download | gdb-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/remote.c')
-rw-r--r-- | gdb/remote.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index 46cd352..78573d9 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -1065,8 +1065,6 @@ static int stub_unpack_int (const char *buff, int fieldlength); struct packet_config; -static void show_packet_config_cmd (struct packet_config *config); - static void show_remote_protocol_packet_cmd (struct ui_file *file, int from_tty, struct cmd_list_element *c, @@ -1913,7 +1911,7 @@ static enum packet_support packet_config_support (struct packet_config *config); static enum packet_support packet_support (int packet); static void -show_packet_config_cmd (struct packet_config *config) +show_packet_config_cmd (ui_file *file, struct packet_config *config) { const char *support = "internal-error"; @@ -1932,14 +1930,16 @@ show_packet_config_cmd (struct packet_config *config) switch (config->detect) { case AUTO_BOOLEAN_AUTO: - printf_filtered (_("Support for the `%s' packet " - "is auto-detected, currently %s.\n"), - config->name, support); + fprintf_filtered (file, + _("Support for the `%s' packet " + "is auto-detected, currently %s.\n"), + config->name, support); break; case AUTO_BOOLEAN_TRUE: case AUTO_BOOLEAN_FALSE: - printf_filtered (_("Support for the `%s' packet is currently %s.\n"), - config->name, support); + fprintf_filtered (file, + _("Support for the `%s' packet is currently %s.\n"), + config->name, support); break; } } @@ -2275,7 +2275,7 @@ show_remote_protocol_packet_cmd (struct ui_file *file, int from_tty, { if (c == packet->show_cmd) { - show_packet_config_cmd (packet); + show_packet_config_cmd (file, packet); return; } } @@ -2319,7 +2319,7 @@ show_remote_protocol_Z_packet_cmd (struct ui_file *file, int from_tty, for (i = 0; i < NR_Z_PACKET_TYPES; i++) { - show_packet_config_cmd (&remote_protocol_packets[PACKET_Z0 + i]); + show_packet_config_cmd (file, &remote_protocol_packets[PACKET_Z0 + i]); } } |