This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Remove use of deprecated_init_ui_hook from quit_confirm.
- From: Pedro Alves <palves at redhat dot com>
- To: Andrew Burgess <aburgess at broadcom dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Fri, 06 Sep 2013 14:34:34 +0100
- Subject: Re: [PATCH] Remove use of deprecated_init_ui_hook from quit_confirm.
- Authentication-results: sourceware.org; auth=none
- References: <5229CAA4 dot 4090709 at broadcom dot com>
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.
--
Pedro Alves