From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31567 invoked by alias); 9 Sep 2013 12:15:51 -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 31555 invoked by uid 89); 9 Sep 2013 12:15:50 -0000 Received: from mms2.broadcom.com (HELO mms2.broadcom.com) (216.31.210.18) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2013 12:15:50 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RDNS_NONE autolearn=no version=3.3.2 X-HELO: mms2.broadcom.com Received: from [10.9.208.53] by mms2.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.5)); Mon, 09 Sep 2013 05:09:15 -0700 X-Server-Uuid: 4500596E-606A-40F9-852D-14843D8201B2 Received: from IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) by IRVEXCHCAS06.corp.ad.broadcom.com (10.9.208.53) with Microsoft SMTP Server (TLS) id 14.1.438.0; Mon, 9 Sep 2013 05:15:35 -0700 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) with Microsoft SMTP Server id 14.1.438.0; Mon, 9 Sep 2013 05:15:35 -0700 Received: from [10.177.73.74] (unknown [10.177.73.74]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 1D77C1A4C; Mon, 9 Sep 2013 05:15:34 -0700 (PDT) Message-ID: <522DBBE6.4070101@broadcom.com> Date: Mon, 09 Sep 2013 12:15:00 -0000 From: "Andrew Burgess" User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: gdb-patches@sourceware.org cc: "Pedro Alves" , "Eli Zaretskii" Subject: Re: [PATCH] Remove use of deprecated_init_ui_hook from quit_confirm. References: <5229CAA4.4090709@broadcom.com> <5229D9EA.1050306@redhat.com> In-Reply-To: <5229D9EA.1050306@redhat.com> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00279.txt.bz2 On 06/09/2013 2:34 PM, Pedro Alves wrote: > On 09/06/2013 01:29 PM, Andrew Burgess wrote: >> There are only two places that deprecated_init_ui_hook is set >> (to !NULL) that I can find: >> >> 1. In gdbtk, deprecated_init_ui_hook is used to grab a copy of >> argv0, but is then immediately set back to NULL, and > > Then, was that setting back to NULL a recent change that had > that side effect and nobody noticed? > > Hmm, it's been that way for 10 years: > > https://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/gdbtk/generic/gdbtk.c?rev=1.36&content-type=text/x-cvsweb-markup&cvsroot=src > https://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/gdbtk/generic/gdbtk.c.diff?r1=1.35&r2=1.36&cvsroot=src&f=h > > Before, it used to be only cleared if not displaying a GUI, like: > > static void > gdbtk_init (char *argv0) > { > ... > /* If there is no DISPLAY environment variable, Tk_Init below will fail, > causing gdb to abort. If instead we simply return here, gdb will > gracefully degrade to using the command line interface. */ > > #ifndef _WIN32 > if (getenv ("DISPLAY") == NULL) > { > init_ui_hook = NULL; > return; > } > #endif > > Guess if nobody complained thus far, people are fine with the > alternative text... > >> 2. In windows-nat.c, deprecated_init_ui_hook is used to solve >> an order of initialisation problem when creating a command >> alias, in this case deprecated_init_ui_hook is left set. >> >> In top.c:quit_confirm we check deprecated_init_ui_hook to detect if >> there's a GUI running. For (1) above this will not kick in, but > > >> for (2) it does.... however... I don't see why this is a good thing, >> as I understand it the windows-nat.c code is not a GUI frontend for >> gdb, but is just "running-gdb-on-windows-hosts". I find it hard to >> believe that the shorter, less informative, quit message is really >> desired... but maybe I've missed something. > > Right. That very much just looks like an unintentional side effect... > >> The following patch removes the use of deprecated_init_ui_hook >> from quit_confirm, the only change I expect from this is that the >> quit message on windows hosts will fall into line with other hosts. >> >> OK to apply? >> > > Looks fine to me. > Given that Pedro kindly addressed the issue raised by Eli (in another mail), I've committed this patch. Thanks all, Andrew