From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25980 invoked by alias); 9 Oct 2016 04:31:55 -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 25952 invoked by uid 89); 9 Oct 2016 04:31:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=H*r:112, State X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 09 Oct 2016 04:31:49 +0000 Received: by simark.ca (Postfix, from userid 112) id E0BD61E981; Sun, 9 Oct 2016 00:31:47 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 6CE341E0F5; Sun, 9 Oct 2016 00:31:47 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 09 Oct 2016 04:31:00 -0000 From: Simon Marchi To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [RFA 09/22] Remove make_cleanup_restore_current_ui In-Reply-To: <1474949330-4307-10-git-send-email-tom@tromey.com> References: <1474949330-4307-1-git-send-email-tom@tromey.com> <1474949330-4307-10-git-send-email-tom@tromey.com> Message-ID: <2f79a489b9090701f15fc04e0017c236@simark.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.2.0 X-IsSubscribed: yes X-SW-Source: 2016-10/txt/msg00192.txt.bz2 On 2016-09-27 00:08, Tom Tromey wrote: > +/* State for SWITCH_THRU_ALL_UIS. */ > +class switch_thru_all_uis > { > +public: > + > + switch_thru_all_uis () : iter (nullptr), save_ui (¤t_ui) > + { > + iter = ui_list; > + } Hi Tom, I just found there is a little bug here. current_ui is not set for the first iteration, so it runs with whatever was in there before. If you look at the previous implementation, current_ui is assigned in the _cond function, which is executed before the first iteration. In your version, it is assigned in the next() method, which isn't. I noticed this because it fails gdb.mi/user-selected-context-sync.exp. Simon