public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simon.marchi@polymtl.ca>, gdb-patches@sourceware.org
Cc: Antoine Tremblay <antoine.tremblay@ericsson.com>
Subject: Re: [PATCH v3 1/2] Emit inferior, thread and frame selection events to all UIs
Date: Mon, 03 Oct 2016 16:47:00 -0000	[thread overview]
Message-ID: <906fc6d1-01f2-c81b-2ff9-ef11b787ec9e@redhat.com> (raw)
In-Reply-To: <20160924201331.23605-1-simon.marchi@polymtl.ca>

Hi Simon,

This looks good to me now, module a couple minor issues pointed out
below.  Fix these and you're good to go.

On 09/24/2016 09:13 PM, Simon Marchi wrote:
> @@ -1885,7 +1901,19 @@ void
>  cmd_func (struct cmd_list_element *cmd, char *args, int from_tty)
>  {
>    if (cmd_func_p (cmd))
> -    (*cmd->func) (cmd, args, from_tty);
> +    {
> +      struct cleanup *cleanups = make_cleanup (null_cleanup, NULL);
> +
> +      if (cmd->suppress_notification != NULL)
> +	{
> +	  cleanups = make_cleanup_restore_integer (cmd->suppress_notification);

This will incorrectly leave the null_cleanup not run.
You should not overwrite "cleanups".  Should be just:

  +	  make_cleanup_restore_integer (cmd->suppress_notification);


> +	  *cmd->suppress_notification = 1;
> +	}
> +
> +      (*cmd->func) (cmd, args, from_tty);
> +
> +      do_cleanups (cleanups);



> +  else /* MI_COMMAND */
> +    {
> +      if (strcmp (command->command, "interpreter-exec") == 0
> +	  && command->argc > 1)
> +

This empty line here made me pause and think that the code
looks suspicious.  Better would be to wrap the then/else blocks
in {}s, since they're multi-line.

> +	/* "thread" and "inferior" again, but through -interpreter-exec.  */
> +	return (strncmp (command->argv[1], "thread ", 7) == 0
> +		|| strncmp (command->argv[1], "inferior ", 9) == 0);
> +
> +      else
> +	/* -thread-select already sends it.  */
> +	return strcmp (command->command, "thread-select") == 0;
> +    }




> +@item =thread-selected,id="@var{id}"[,frame="@var{frame}"]
> +Informs that the selected thread or frame were changed.  This notification
> +is not emitted as result of the @code{-thread-select} or
> +@code{-stack-select-frame} commands, but is emitted whenever an MI command
> +that is not documented to change the selected thread and frame actually
> +changes them.  In particular, invoking, directly or indirectly
> +(via user-defined command), the CLI @code{thread} or @code{frame} commands,
> +will generate this notification.  Changing the thread of frame from another
> +user interface (see @ref{Interpreters}) will also generate this notification.
> +

Typo: s/thread of frame/thread or frame/

Thanks,
Pedro Alves

  parent reply	other threads:[~2016-10-03 16:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-24 21:45 Simon Marchi
2016-09-24 20:13 ` [PATCH v3 2/2] Add test for user context selection sync Simon Marchi
2016-10-03 17:10   ` Pedro Alves
2016-10-03 17:48     ` Simon Marchi
2016-09-25 12:41 ` [PATCH v3 1/2] Emit inferior, thread and frame selection events to all UIs Eli Zaretskii
2016-09-26  2:25   ` Simon Marchi
2016-10-03 16:47 ` Pedro Alves [this message]
2016-10-03 17:40   ` Simon Marchi
2016-10-03 21:03     ` Simon Marchi
2016-12-08 12:02 ` Thomas Schwinge
2016-12-08 15:25   ` Simon Marchi
2016-12-09  6:22     ` Thomas Schwinge

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=906fc6d1-01f2-c81b-2ff9-ef11b787ec9e@redhat.com \
    --to=palves@redhat.com \
    --cc=antoine.tremblay@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).