diff options
author | Vladimir Prus <vladimir@codesourcery.com> | 2008-06-29 17:36:36 +0000 |
---|---|---|
committer | Vladimir Prus <vladimir@codesourcery.com> | 2008-06-29 17:36:36 +0000 |
commit | 1b98914a55f307890b8fa7cf095dffb08dd0ac2f (patch) | |
tree | f03ef6bc241e19ecbe1d9854161245e2c6ac34d0 /gdb/mi/mi-main.c | |
parent | f57718b4c3a59a16940b6b300a6b20237631686c (diff) | |
download | gdb-1b98914a55f307890b8fa7cf095dffb08dd0ac2f.zip gdb-1b98914a55f307890b8fa7cf095dffb08dd0ac2f.tar.gz gdb-1b98914a55f307890b8fa7cf095dffb08dd0ac2f.tar.bz2 |
* mi/mi-cmds.c (mi_cmds): Route -exec-run, -exec-until,
-target-download and -target-select via CLI, so that
the quoting rules are the same as they were (unfortunately)
in all prior gdb releases.
* mi/mi-cmds.h (mi_cmd_exec_run, mi_cmd_exec_until)
(mi_cmd_target_download, mi_cmd_target_select): Remove.
* mi/mi-main.c (mi_cmd_exec_run, mi_cmd_exec_until)
(mi_cmd_target_download, mi_cmd_target_select): Remove.
(mi_cmd_execute): Set current_token even for commands
routed via CLI.
Diffstat (limited to 'gdb/mi/mi-main.c')
-rw-r--r-- | gdb/mi/mi-main.c | 71 |
1 files changed, 4 insertions, 67 deletions
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 2417e74..1414434 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -107,13 +107,6 @@ mi_cmd_gdb_exit (char *command, char **argv, int argc) } void -mi_cmd_exec_run (char *command, char **argv, int argc) -{ - /* FIXME: Should call a libgdb function, not a cli wrapper. */ - return mi_execute_async_cli_command ("run", argv, argc); -} - -void mi_cmd_exec_next (char *command, char **argv, int argc) { /* FIXME: Should call a libgdb function, not a cli wrapper. */ @@ -149,13 +142,6 @@ mi_cmd_exec_finish (char *command, char **argv, int argc) } void -mi_cmd_exec_until (char *command, char **argv, int argc) -{ - /* FIXME: Should call a libgdb function, not a cli wrapper. */ - return mi_execute_async_cli_command ("until", argv, argc); -} - -void mi_cmd_exec_return (char *command, char **argv, int argc) { /* This command doesn't really execute the target, it just pops the @@ -594,56 +580,6 @@ mi_cmd_data_evaluate_expression (char *command, char **argv, int argc) do_cleanups (old_chain); } -void -mi_cmd_target_download (char *command, char **argv, int argc) -{ - char *run; - struct cleanup *old_cleanups = NULL; - - /* There may be at most one parameter -- the name of the - file to download. */ - run = xstrprintf ("load %s", argc ? *argv : ""); - old_cleanups = make_cleanup (xfree, run); - execute_command (run, 0); - - do_cleanups (old_cleanups); -} - -/* Connect to the remote target. */ -void -mi_cmd_target_select (char *command, char **argv, int argc) -{ - char *run = NULL; - struct cleanup *old_cleanups = NULL; - int i; - - if (argc == 0) - error ("no target type specified"); - - for (i = 0; i < argc; ++i) - { - if (i == 0) - run = concat ("target ", argv[0], NULL); - else - { - char *prev = run; - run = concat (run, " ", argv[i], NULL); - xfree (prev); - } - } - - old_cleanups = make_cleanup (xfree, run); - - /* target-select is always synchronous. Once the call has returned - we know that we are connected. */ - /* NOTE: At present all targets that are connected are also - (implicitly) talking to a halted target. In the future this may - change. */ - execute_command (run, 0); - - do_cleanups (old_cleanups); -} - /* DATA-MEMORY-READ: ADDR: start address of data to be dumped. @@ -1118,6 +1054,9 @@ mi_cmd_execute (struct mi_parse *parse) struct cleanup *cleanup; free_all_values (); + current_token = xstrdup (parse->token); + cleanup = make_cleanup (free_current_contents, ¤t_token); + if (parse->cmd->argv_func != NULL) { if (target_executing) @@ -1135,10 +1074,7 @@ mi_cmd_execute (struct mi_parse *parse) error_stream (stb); } } - current_token = xstrdup (parse->token); - cleanup = make_cleanup (free_current_contents, ¤t_token); parse->cmd->argv_func (parse->command, parse->argv, parse->argc); - do_cleanups (cleanup); } else if (parse->cmd->cli.cmd != 0) { @@ -1162,6 +1098,7 @@ mi_cmd_execute (struct mi_parse *parse) make_cleanup_ui_file_delete (stb); error_stream (stb); } + do_cleanups (cleanup); } /* FIXME: This is just a hack so we can get some extra commands going. |