summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2005-02-21 03:59:23 +0000
committerAndrew Cagney <cagney@redhat.com>2005-02-21 03:59:23 +0000
commit0f8da524114cc4f726002933fbb72f9ccdca0084 (patch)
tree08b3e055fd86081653d1ceb76104e4d35ae1d764
parent10d76dba8f799193fa5f6dfa579bb4096a897c52 (diff)
downloadgdb-0f8da524114cc4f726002933fbb72f9ccdca0084.tar.gz
2005-02-20 Andrew Cagney <cagney@gnu.org>
* mi/mi-main.c (captured_mi_execute_command): Use mi_cmd_interpreter_exec.
-rw-r--r--gdb/ChangeLog3
-rw-r--r--gdb/mi/mi-main.c54
2 files changed, 33 insertions, 24 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4ec29aeffde..29cff9e9098 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,8 @@
2005-02-20 Andrew Cagney <cagney@gnu.org>
+ * mi/mi-main.c (captured_mi_execute_command): Use
+ mi_cmd_interpreter_exec.
+
* cli/cli-decode.c (add_setshow_optional_filename_cmd): New
function.
* cli/cli-setshow.c (deprecated_show_value_hack)
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index cbfd2fed445..27080df6904 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -1103,30 +1103,36 @@ captured_mi_execute_command (struct ui_out *uiout, void *data)
break;
case CLI_COMMAND:
- /* A CLI command was read from the input stream */
- /* This will be removed as soon as we have a complete set of
- mi commands */
- /* echo the command on the console. */
- fprintf_unfiltered (gdb_stdlog, "%s\n", context->command);
- mi_execute_cli_command (context->command, 0, NULL);
-
- /* If we changed interpreters, DON'T print out anything. */
- if (current_interp_named_p (INTERP_MI)
- || current_interp_named_p (INTERP_MI1)
- || current_interp_named_p (INTERP_MI2)
- || current_interp_named_p (INTERP_MI3))
- {
- /* print the result */
- /* FIXME: Check for errors here. */
- fputs_unfiltered (context->token, raw_stdout);
- fputs_unfiltered ("^done", raw_stdout);
- mi_out_put (uiout, raw_stdout);
- mi_out_rewind (uiout);
- fputs_unfiltered ("\n", raw_stdout);
- args->action = EXECUTE_COMMAND_DISPLAY_PROMPT;
- args->rc = MI_CMD_DONE;
- }
- break;
+ {
+ char *argv[2];
+ /* A CLI command was read from the input stream. */
+ /* This "feature" will be removed as soon as we have a
+ complete set of mi commands. */
+ /* Echo the command on the console. */
+ fprintf_unfiltered (gdb_stdlog, "%s\n", context->command);
+ /* Call the "console" interpreter. */
+ argv[0] = "console";
+ argv[1] = context->command;
+ mi_cmd_interpreter_exec ("-interpreter-exec", argv, 2);
+
+ /* If we changed interpreters, DON'T print out anything. */
+ if (current_interp_named_p (INTERP_MI)
+ || current_interp_named_p (INTERP_MI1)
+ || current_interp_named_p (INTERP_MI2)
+ || current_interp_named_p (INTERP_MI3))
+ {
+ /* print the result */
+ /* FIXME: Check for errors here. */
+ fputs_unfiltered (context->token, raw_stdout);
+ fputs_unfiltered ("^done", raw_stdout);
+ mi_out_put (uiout, raw_stdout);
+ mi_out_rewind (uiout);
+ fputs_unfiltered ("\n", raw_stdout);
+ args->action = EXECUTE_COMMAND_DISPLAY_PROMPT;
+ args->rc = MI_CMD_DONE;
+ }
+ break;
+ }
}