diff options
author | Vladimir Prus <vladimir@codesourcery.com> | 2008-07-12 17:10:59 +0000 |
---|---|---|
committer | Vladimir Prus <vladimir@codesourcery.com> | 2008-07-12 17:10:59 +0000 |
commit | 77ebaa5ad37ca5888bf33444e85dd8140ffed695 (patch) | |
tree | ec53a5079de2dc4f43be7076d0333c6818dfbf87 /gdb/mi | |
parent | 1e92afda99a58f4427293937e49ef1ebe6bb3968 (diff) | |
download | gdb-77ebaa5ad37ca5888bf33444e85dd8140ffed695.zip gdb-77ebaa5ad37ca5888bf33444e85dd8140ffed695.tar.gz gdb-77ebaa5ad37ca5888bf33444e85dd8140ffed695.tar.bz2 |
Implement -exec-continue/-exec-interrupt --all.
* infcmd.c (continue_1): New, extracted from
(continue_command): ...here.
(interrupt_target_1): New, extracted from
(interrupt_target_command): ...here.
* inferior.h (continue_1, interrupt_target_1): New.
* mi/mi-main.c (mi_cmd_exec_continue)
(mi_cmd_exec_interrupt): Handle --all.
Diffstat (limited to 'gdb/mi')
-rw-r--r-- | gdb/mi/mi-main.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index f829a93..43f3a5f 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -163,8 +163,12 @@ mi_cmd_exec_return (char *command, char **argv, int argc) void mi_cmd_exec_continue (char *command, char **argv, int argc) { - /* FIXME: Should call a libgdb function, not a cli wrapper. */ - return mi_execute_async_cli_command ("continue", argv, argc); + if (argc == 0) + continue_1 (0); + else if (argc == 1 && strcmp (argv[0], "--all") == 0) + continue_1 (1); + else + error ("Usage: -exec-continue [--all]"); } /* Interrupt the execution of the target. Note how we must play around @@ -175,10 +179,22 @@ mi_cmd_exec_continue (char *command, char **argv, int argc) void mi_cmd_exec_interrupt (char *command, char **argv, int argc) { - if (!is_running (inferior_ptid)) - error ("mi_cmd_exec_interrupt: Inferior not running."); + if (argc == 0) + { + if (!is_running (inferior_ptid)) + error ("Current thread is not running."); - interrupt_target_command (NULL, 0); + interrupt_target_1 (0); + } + else if (argc == 1 && strcmp (argv[0], "--all") == 0) + { + if (!any_running ()) + error ("Inferior not running."); + + interrupt_target_1 (1); + } + else + error ("Usage: -exec-interrupt [--all]"); } void |