From: Vladimir Prus <vladimir@codesourcery.com>
To: Nick Roberts <nickrob@snap.net.nz>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH:gdb/mi] Update a specified list of variable objects
Date: Mon, 28 Sep 2009 16:33:00 -0000 [thread overview]
Message-ID: <200909282032.55055.vladimir@codesourcery.com> (raw)
In-Reply-To: <19128.5244.844945.680565@totara.tehura.co.nz>
On Tuesday 22 September 2009 Nick Roberts wrote:
> > I've tried to address this point below. It's even in unified diff format!
Thanks!
>
> Actually it's probably better to use isdigit like below
In fact, it's probably even easier than than. Note this code from
mi_cmd_var_create:
if (strcmp (name, "-") == 0)
{
xfree (name);
name = varobj_gen_name ();
}
else if (!isalpha (*name))
error (_("mi_cmd_var_create: name of object must begin with a letter"));
with this in mind,
> + print_values = PRINT_NO_VALUES;
> + else if (argc == 2 && isdigit (*argv[0]))
> + {
> + optind = 1;
> + print_values = mi_parse_values_option (argv[0]);
> + }
can be written like this:
else if (argc == 2 && (isdigit (*argv[0]) || *argv[0] == '-'))
{
optind = 1;
print_values = mi_parse_values_option (argv[0]);
}
> else
> - name = (argv[1]);
> + {
> + while (1)
> + {
> + int opt = mi_getopt ("mi_cmd_var_update",
> + argc, argv, opts, &optind, &optarg);
And this code can be dropped. What do you think?
- Volodya
next prev parent reply other threads:[~2009-09-28 16:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-21 12:09 Nick Roberts
2009-09-21 12:39 ` Vladimir Prus
2009-09-21 23:39 ` Nick Roberts
2009-09-22 0:04 ` Nick Roberts
2009-09-28 16:33 ` Vladimir Prus [this message]
2009-09-29 23:36 ` Nick Roberts
2009-09-21 16:58 ` Tom Tromey
2009-09-21 23:39 ` Nick Roberts
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200909282032.55055.vladimir@codesourcery.com \
--to=vladimir@codesourcery.com \
--cc=gdb-patches@sources.redhat.com \
--cc=nickrob@snap.net.nz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox