aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi/mi-parse.c
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2010-02-24 07:51:46 +0000
committerVladimir Prus <vladimir@codesourcery.com>2010-02-24 07:51:46 +0000
commita79b8f6ea8c26650ad9b6f29e3df46f86f4f3530 (patch)
treed5b62817438cabc5c97eed521f7366b4b52a0aab /gdb/mi/mi-parse.c
parent115d30f9b6746bc41746961a4f4bab5183c6eb80 (diff)
downloadgdb-a79b8f6ea8c26650ad9b6f29e3df46f86f4f3530.zip
gdb-a79b8f6ea8c26650ad9b6f29e3df46f86f4f3530.tar.gz
gdb-a79b8f6ea8c26650ad9b6f29e3df46f86f4f3530.tar.bz2
Multiexec MI
* breakpoint.c (clear_syscall_counts): Take struct inferior*. * inferior.c (add_inferior_silent): Notify inferior_added observer. (delete_inferior_1): Notify inferior_removed observer. (exit_inferior_1): Pass inferior, not pid, to observer. (inferior_appeared): Likewise. (add_inferior_with_spaces): New. (add_inferior_command): Use the above. * inferior.h (delete_inferior_1, add_inferior_with_spaces): Declare. * inflow.c (inflow_inferior_exit): Likewise. * jit.c (jit_inferior_exit_hook): Likewise. * mi/mi-cmds.c (mi_cmds): Register add-inferior and remove-inferior. * mi/mi-cmds.h (mi_cmd_add_inferior, mi_cmd_remove_inferior): New. * mi/mi-interp.c (mi_inferior_added, mi_inferior_removed): New. (report_initial_inferior): New. (mi_inferior_removed): Register the above. Make sure inferior_added observer is called on the first inferior. (mi_new_thread, mi_thread_exit): Thread group is now identified by inferior number, not pid. (mi_solib_loaded, mi_solib_unloaded): Report which inferiors are affected. * mi/mi-main.c (current_context): New. (proceed_thread_callback): Use typed closure. Proceed everything if pid is 0. Most implementation split into (proceed_thread): ... this. (run_one_inferior): New. (mi_cmd_exec_continue, mi_cmd_exec_interrupt, mi_cmd_exec_run): Adjust for multiexec behaviour. (mi_cmd_add_inferior, mi_cmd_remove_inferior): New. (mi_cmd_execute): Handle the 'thread-group' option here. Do some extra checks. * mi-parse.c (mi_parse): Handle the --all and --thread-group options. * mi-parse.h (struct mi_parse): New fields all and thread_group.
Diffstat (limited to 'gdb/mi/mi-parse.c')
-rw-r--r--gdb/mi/mi-parse.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/gdb/mi/mi-parse.c b/gdb/mi/mi-parse.c
index 4ff70ef..8548b67 100644
--- a/gdb/mi/mi-parse.c
+++ b/gdb/mi/mi-parse.c
@@ -151,6 +151,8 @@ mi_parse (char *cmd)
char *chp;
struct mi_parse *parse = XMALLOC (struct mi_parse);
memset (parse, 0, sizeof (*parse));
+ parse->all = 0;
+ parse->thread_group = -1;
parse->thread = -1;
parse->frame = -1;
@@ -210,19 +212,42 @@ mi_parse (char *cmd)
for (;;)
{
char *start = chp;
+ size_t as = sizeof ("--all ") - 1;
+ size_t tgs = sizeof ("--thread-group ") - 1;
size_t ts = sizeof ("--thread ") - 1;
size_t fs = sizeof ("--frame ") - 1;
+ if (strncmp (chp, "--all ", as) == 0)
+ {
+ parse->all = 1;
+ chp += as;
+ }
+ /* See if --all is the last token in the input. */
+ if (strcmp (chp, "--all") == 0)
+ {
+ parse->all = 1;
+ chp += strlen (chp);
+ }
+ if (strncmp (chp, "--thread-group ", tgs) == 0)
+ {
+ if (parse->thread_group != -1)
+ error (_("Duplicate '--thread-group' option"));
+ chp += tgs;
+ if (*chp != 'i')
+ error (_("Invalid thread group id"));
+ chp += 1;
+ parse->thread_group = strtol (chp, &chp, 10);
+ }
if (strncmp (chp, "--thread ", ts) == 0)
{
if (parse->thread != -1)
- error ("Duplicate '--thread' option");
+ error (_("Duplicate '--thread' option"));
chp += ts;
parse->thread = strtol (chp, &chp, 10);
}
else if (strncmp (chp, "--frame ", fs) == 0)
{
if (parse->frame != -1)
- error ("Duplicate '--frame' option");
+ error (_("Duplicate '--frame' option"));
chp += fs;
parse->frame = strtol (chp, &chp, 10);
}
@@ -230,7 +255,7 @@ mi_parse (char *cmd)
break;
if (*chp != '\0' && !isspace (*chp))
- error ("Invalid value for the '%s' option",
+ error (_("Invalid value for the '%s' option"),
start[2] == 't' ? "--thread" : "--frame");
while (isspace (*chp))
chp++;