gdb/show_args_command: print to the ui_file argument

Message ID 20230503110712.1540513-1-lancelot.six@amd.com
State New
Headers
Series gdb/show_args_command: print to the ui_file argument |

Commit Message

Lancelot SIX May 3, 2023, 11:07 a.m. UTC
  The show_args_command uses gdb_printf without specifying the ui_file.
This means that it prints to gdb_stdout instead of the stream given as
an argument to the function.

This commit fixes this.
---
 gdb/infcmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: a07223191bdda5e85a500e3b8206ee8fe8bcdfed
  

Comments

Tom Tromey May 3, 2023, 2:50 p.m. UTC | #1
>>>>> Lancelot SIX via Gdb-patches <gdb-patches@sourceware.org> writes:

> The show_args_command uses gdb_printf without specifying the ui_file.
> This means that it prints to gdb_stdout instead of the stream given as
> an argument to the function.

> This commit fixes this.

Thanks, this is ok.
Reviewed-By: Tom Tromey <tom@tromey.com>

Tom
  
Lancelot SIX May 3, 2023, 3:31 p.m. UTC | #2
Thanks.

I have just pushed this patch.

Lancelot.

On 03/05/2023 15:50, Tom Tromey wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
> 
> 
>>>>>> Lancelot SIX via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
>> The show_args_command uses gdb_printf without specifying the ui_file.
>> This means that it prints to gdb_stdout instead of the stream given as
>> an argument to the function.
> 
>> This commit fixes this.
> 
> Thanks, this is ok.
> Reviewed-By: Tom Tromey <tom@tromey.com>
> 
> Tom
  

Patch

diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index b8134665f3f..e42927858ba 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -144,7 +144,7 @@  show_args_command (struct ui_file *file, int from_tty,
 {
   /* Ignore the passed in value, pull the argument directly from the
      inferior.  However, these should always be the same.  */
-  gdb_printf (_("\
+  gdb_printf (file, _("\
 Argument list to give program being debugged when it is started is \"%s\".\n"),
 	      current_inferior ()->args ().c_str ());
 }