diff options
author | Tom Tromey <tom@tromey.com> | 2021-12-26 23:23:57 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-12-29 10:54:29 -0700 |
commit | de4686ffaff8bade61657078990f392b3aa14ff4 (patch) | |
tree | 660d9296c37c4b66ea4a14baae2d680a1c18ead5 /gdb/mi | |
parent | ca78fadba919f2df2913ae893e0d8c587bb105a2 (diff) | |
download | gdb-de4686ffaff8bade61657078990f392b3aa14ff4.zip gdb-de4686ffaff8bade61657078990f392b3aa14ff4.tar.gz gdb-de4686ffaff8bade61657078990f392b3aa14ff4.tar.bz2 |
Use gdb_stdlog for MI debugging
When MI debugging is enabled, the logging output should be sent to
gdb_stdlog. This is part of PR gdb/7233.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=7233
Diffstat (limited to 'gdb/mi')
-rw-r--r-- | gdb/mi/mi-cmds.h | 3 | ||||
-rw-r--r-- | gdb/mi/mi-main.c | 8 |
2 files changed, 4 insertions, 7 deletions
diff --git a/gdb/mi/mi-cmds.h b/gdb/mi/mi-cmds.h index 5945f03..c9358a6 100644 --- a/gdb/mi/mi-cmds.h +++ b/gdb/mi/mi-cmds.h @@ -192,9 +192,6 @@ private: extern mi_command *mi_cmd_lookup (const char *command); -/* Debug flag */ -extern int mi_debug_p; - extern void mi_execute_command (const char *cmd, int from_tty); #endif /* MI_MI_CMDS_H */ diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 710eef7..1f210c1 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -68,7 +68,8 @@ enum FROM_TTY = 0 }; -int mi_debug_p; +/* Debug flag */ +static int mi_debug_p; /* This is used to pass the current command timestamp down to continuation routines. */ @@ -1785,8 +1786,7 @@ captured_mi_execute_command (struct ui_out *uiout, struct mi_parse *context) case MI_COMMAND: /* A MI command was read from the input stream. */ if (mi_debug_p) - /* FIXME: gdb_???? */ - fprintf_unfiltered (mi->raw_stdout, + fprintf_unfiltered (gdb_stdlog, " token=`%s' command=`%s' args=`%s'\n", context->token, context->command, context->args); @@ -2091,7 +2091,7 @@ mi_execute_cli_command (const char *cmd, bool args_p, const char *args) gdb_assert (args == nullptr); if (mi_debug_p) - fprintf_unfiltered (gdb_stdout, "cli=%s run=%s\n", + fprintf_unfiltered (gdb_stdlog, "cli=%s run=%s\n", cmd, run.c_str ()); execute_command (run.c_str (), 0 /* from_tty */ ); |