Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Remove use of deprecated_init_ui_hook from quit_confirm.
@ 2013-09-06 12:29 Andrew Burgess
  2013-09-06 13:25 ` Eli Zaretskii
  2013-09-06 13:34 ` Pedro Alves
  0 siblings, 2 replies; 7+ messages in thread
From: Andrew Burgess @ 2013-09-06 12:29 UTC (permalink / raw)
  To: gdb-patches

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

 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.

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?

Thanks,
Andrew

gdb/ChangeLog

2013-09-06  Andrew Burgess  <aburgess@broadcom.com>

	* top.c (quit_confirm): Remove use of deprecated_init_ui_hook.

diff --git a/gdb/top.c b/gdb/top.c
index b3e7d37..d9128a3 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1355,18 +1355,9 @@ quit_confirm (void)
   stb = mem_fileopen ();
   old_chain = make_cleanup_ui_file_delete (stb);
 
-  /* This is something of a hack.  But there's no reliable way to see
-     if a GUI is running.  The `use_windows' variable doesn't cut
-     it.  */
-  if (deprecated_init_ui_hook)
-    fprintf_filtered (stb, _("A debugging session is active.\n"
-			     "Do you still want to close the debugger?"));
-  else
-    {
-      fprintf_filtered (stb, _("A debugging session is active.\n\n"));
-      iterate_over_inferiors (print_inferior_quit_action, stb);
-      fprintf_filtered (stb, _("\nQuit anyway? "));
-    }
+  fprintf_filtered (stb, _("A debugging session is active.\n\n"));
+  iterate_over_inferiors (print_inferior_quit_action, stb);
+  fprintf_filtered (stb, _("\nQuit anyway? "));
 
   str = ui_file_xstrdup (stb, NULL);
   make_cleanup (xfree, str);



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-09-09 12:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-06 12:29 [PATCH] Remove use of deprecated_init_ui_hook from quit_confirm Andrew Burgess
2013-09-06 13:25 ` Eli Zaretskii
2013-09-06 13:44   ` Pedro Alves
2013-09-06 13:50     ` Eli Zaretskii
2013-09-06 14:12       ` Pedro Alves
2013-09-06 13:34 ` Pedro Alves
2013-09-09 12:15   ` Andrew Burgess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox