From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 119156 invoked by alias); 3 Oct 2016 16:47:58 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 118874 invoked by uid 89); 3 Oct 2016 16:47:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=events, Marchi, marchi, indirectly X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 03 Oct 2016 16:47:57 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D27433D96B; Mon, 3 Oct 2016 16:47:55 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u93GlrCq006365; Mon, 3 Oct 2016 12:47:54 -0400 Subject: Re: [PATCH v3 1/2] Emit inferior, thread and frame selection events to all UIs To: Simon Marchi , gdb-patches@sourceware.org References: <20160924201331.23605-1-simon.marchi@polymtl.ca> Cc: Antoine Tremblay From: Pedro Alves Message-ID: <906fc6d1-01f2-c81b-2ff9-ef11b787ec9e@redhat.com> Date: Mon, 03 Oct 2016 16:47:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160924201331.23605-1-simon.marchi@polymtl.ca> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-10/txt/msg00016.txt.bz2 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