From: Pedro Alves <pedro@codesourcery.com>
To: Vladimir Prus <vladimir@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: Multiexec MI
Date: Mon, 22 Feb 2010 12:16:00 -0000 [thread overview]
Message-ID: <201002221216.24109.pedro@codesourcery.com> (raw)
In-Reply-To: <201002192315.40134.vladimir@codesourcery.com>
On Friday 19 February 2010 20:15:40, Vladimir Prus wrote:
> On Monday 08 February 2010 22:20:13 Pedro Alves wrote:
>
> > > - old_chain = make_cleanup_restore_current_thread ();
> > > - iterate_over_threads (interrupt_thread_callback, &pid);
> > > - do_cleanups (old_chain);
> > > + struct inferior *inf = find_inferior_id (current_context->thread_group);
> > > + iterate_over_threads (interrupt_thread_callback, &(inf->pid));
> >
> > Redundant ()'s.
>
> I think the version with () is more readable.
Well, `without' is the defacto standard. See,
with ()'s
>egrep "&\(([a-zA-Z0-9_]+(\->|\.))+[a-zA-Z0-9_]*" * -rn | wc -l
45
without:
>egrep "&([a-zA-Z0-9_]+(\->|\.))+[a-zA-Z0-9_]*" * -rn | wc -l
1419
Makes me wanna whack those 45 instances for consistency. ;-)
>
> > > if (parse->thread != -1)
> > > {
> > > struct thread_info *tp = find_thread_id (parse->thread);
> > > @@ -1767,6 +1908,8 @@ mi_cmd_execute (struct mi_parse *parse)
> > > error (_("Invalid frame id: %d"), frame);
> > > }
> > >
> > > + current_context = parse;
> > > +
> >
> > Hmm, aren't the `struct mi_parse' objects leaking
> > for every MI command? I can't see where they're released in
> > mi_execute_command ?
>
> Close to the end of that function, I see:
>
> mi_parse_free (command);
>
> Is it not there for you?
Ah, there it is. Thanks.
( it leaks if bpstat_do_actions throws, though ;-) )
>
> > In the latter strncmp above:
> >
> > + if (strncmp (chp, "--all", as) == 0)
> >
> > AS is always larger than strlen("--all"), so the
> > strncmp's check on AS is useless and confusing here.
> > I think you wanted:
> >
> > if (strcmp (chp, "--all") == 0)
> > {
> > parse->all = 1;
> > chp += strlen (chp);
> > }
>
> I've adjusted sizes. I prefer to keep two ifs with the same structure.
But now it accepts --allfoofoofoo, and isn't checking that --all
is the last token in the input as is described, when my suggestion
did not have such issues. The current code reads:
/* See if this --all as the last token in the input.
Both the string and count are smaller by 1. */
if (strncmp (chp, "--all", as - 1) == 0)
{
parse->all = 1;
chp += (as - 1);
}
(also, typo: s/--all as the last/--all is the last/)
I also spotted:
> - -exec-run
> + -exec-run [--all | --thread-group N ]
^ -- inconsistent -- ^
> +@deftypefun void inferior_removed (struct inferior *@var{inf})
> +The inferior @var{inf} has been removed from the list of inferiors.
> +This method is called immediate before freeing @var{inf}.
^^^^^^^^^
s/immediate/immediately
Otherwise, still looks okay to me. Thanks.
--
Pedro Alves
next prev parent reply other threads:[~2010-02-22 12:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-13 20:29 Vladimir Prus
2010-01-13 21:04 ` Eli Zaretskii
2010-02-19 19:54 ` Vladimir Prus
2010-02-19 21:06 ` Eli Zaretskii
2010-02-20 10:55 ` Vladimir Prus
2010-02-20 13:39 ` Eli Zaretskii
2010-02-08 19:20 ` Pedro Alves
2010-02-08 19:28 ` Pedro Alves
2010-02-20 11:59 ` Vladimir Prus
2010-02-19 20:16 ` Vladimir Prus
2010-02-22 12:16 ` Pedro Alves [this message]
2010-02-24 7:53 ` Vladimir Prus
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=201002221216.24109.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=vladimir@codesourcery.com \
/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