aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi/mi-parse.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2010-05-17 20:49:39 +0000
committerMichael Snyder <msnyder@vmware.com>2010-05-17 20:49:39 +0000
commit102040f0d08b06980adf402c17b2f039fee7d23c (patch)
treeef6558f84010ba8af6ee46b4cfddc6d5d24b5752 /gdb/mi/mi-parse.c
parentcdb27c12f30352674694895e06f615fd28ebdbec (diff)
downloadgdb-102040f0d08b06980adf402c17b2f039fee7d23c.zip
gdb-102040f0d08b06980adf402c17b2f039fee7d23c.tar.gz
gdb-102040f0d08b06980adf402c17b2f039fee7d23c.tar.bz2
2010-05-17 Michael Snyder <msnyder@vmware.com>
* mi/mi-cmd-break.c: White space. * mi/mi-cmd-env.c: White space. * mi/mi-cmds.c: White space. * mi/mi-cmd-stack.c: White space. * mi/mi-cmd-var.c: White space. * mi/mi-console.c: White space. * mi/mi-getopt.c: White space. * mi/mi-interp.c: White space. * mi/mi-main.c: White space. * mi/mi-out.c: White space. * mi/mi-parse.c: White space.
Diffstat (limited to 'gdb/mi/mi-parse.c')
-rw-r--r--gdb/mi/mi-parse.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/mi/mi-parse.c b/gdb/mi/mi-parse.c
index c3f5eeb..a5a4e75 100644
--- a/gdb/mi/mi-parse.c
+++ b/gdb/mi/mi-parse.c
@@ -35,6 +35,7 @@ static int
mi_parse_escape (char **string_ptr)
{
int c = *(*string_ptr)++;
+
switch (c)
{
case '\n':
@@ -54,6 +55,7 @@ mi_parse_escape (char **string_ptr)
{
int i = host_hex_value (c);
int count = 0;
+
while (++count < 3)
{
c = (**string_ptr);
@@ -106,10 +108,12 @@ mi_parse_argv (char *args, struct mi_parse *parse)
char *chp = args;
int argc = 0;
char **argv = xmalloc ((argc + 1) * sizeof (char *));
+
argv[argc] = NULL;
while (1)
{
char *arg;
+
/* skip leading white space */
while (isspace (*chp))
chp++;
@@ -125,6 +129,7 @@ mi_parse_argv (char *args, struct mi_parse *parse)
/* A quoted string. */
int len;
char *start = chp + 1;
+
/* Determine the buffer size. */
chp = start;
len = 0;
@@ -182,6 +187,7 @@ mi_parse_argv (char *args, struct mi_parse *parse)
characters into a buffer. */
int len;
char *start = chp;
+
while (*chp != '\0' && !isspace (*chp))
{
chp++;
@@ -223,6 +229,7 @@ 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;
@@ -253,6 +260,7 @@ mi_parse (char *cmd)
/* Extract the command. */
{
char *tmp = chp + 1; /* discard ``-'' */
+
for (; *chp && !isspace (*chp); chp++)
;
parse->command = xmalloc ((chp - tmp + 1) * sizeof (char *));
@@ -289,6 +297,7 @@ mi_parse (char *cmd)
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;