From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116357 invoked by alias); 26 May 2016 18:15:27 -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 116347 invoked by uid 89); 26 May 2016 18:15:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=picture, 160526 X-HELO: usplmg21.ericsson.net Received: from usplmg21.ericsson.net (HELO usplmg21.ericsson.net) (198.24.6.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 26 May 2016 18:15:16 +0000 Received: from EUSAAHC007.ericsson.se (Unknown_Domain [147.117.188.93]) by usplmg21.ericsson.net (Symantec Mail Security) with SMTP id AC.FE.03614.CFC37475; Thu, 26 May 2016 20:14:21 +0200 (CEST) Received: from [142.133.110.144] (147.117.188.8) by smtp-am.internal.ericsson.com (147.117.188.95) with Microsoft SMTP Server id 14.3.294.0; Thu, 26 May 2016 14:15:13 -0400 Subject: Re: [PATCH v3 08/34] Always run async signal handlers in the main UI To: Pedro Alves , References: <1462538104-19109-1-git-send-email-palves@redhat.com> <1462538104-19109-9-git-send-email-palves@redhat.com> <573E13D0.7010104@ericsson.com> From: Simon Marchi Message-ID: <57473D31.60400@ericsson.com> Date: Thu, 26 May 2016 18:15:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-05/txt/msg00469.txt.bz2 On 16-05-26 02:13 PM, Pedro Alves wrote: > On 05/19/2016 08:28 PM, Simon Marchi wrote: >> On 16-05-06 08:34 AM, Pedro Alves wrote: > >>> -/* The main UI. This is the UI that is bound to stdin/stdout/stderr. >>> - It always exists and is created automatically when GDB starts >>> - up. */ >>> +/* The main UI. */ >>> static struct ui main_ui_; >>> >>> +struct ui *main_ui = &main_ui_; >> >> I'd suggest making the pointer const, to show (and make sure) that the main ui >> never changes throughout the lifetime of the gdb instance: >> >> +struct ui * const main_ui = &main_ui_; > > Hmm, that wouldn't work, because later on the series, main_ui > becomes heap allocated: > > https://sourceware.org/ml/gdb-patches/2016-05/msg00125.html > > Guess we could instead have: > > struct ui *get_main_ui (void); > > To make it clearer that this is not supposed to be an lvalue. > > And likewise maybe: > > struct ui *get_current_ui (void); > void set_current_ui (struct ui *); > > Though unless I'm in for some other major rework of the series, > at this point I'd rather defer that to a follow up patch. > I've gone through renaming these objects throughout the whole > series a few times already, and it's quite painful. WDYT? No problem, I mentioned that without seeing the big picture, so you know better. Simon