public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Remove use of deprecated_init_ui_hook
@ 2013-09-18 13:45 Andrew Burgess
       [not found] ` <523B92DD.5060408@redhat.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Burgess @ 2013-09-18 13:45 UTC (permalink / raw)
  To: insight

We currently use deprecated_init_ui_hook in order to
get hold of argv0 that started up gdb (this is used
in a call to Tcl_FindExecutable).

This patch to gdb:
  https://sourceware.org/ml/gdb-patches/2013-09/msg00225.html
adds a new function get_gdb_program_name () that allows
direct access to argv0.

The patch below switches to use the new function, and
removes the use of deprecated_init_ui_hook.

OK to apply?

Thanks,
Andrew

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

	* generic/gdbtk.c: Add include of "main.h".
	(gdbtk_init_1): Remove.
	(argv0): Remove.
	(_initialize_gdbtk): No longer set deprecated_init_ui_hook.
	(gdbtk_init): Use get_gdb_program_name function from main.h.

diff -u -p -r1.56 gdbtk.c
--- ./gdb/gdbtk/generic/gdbtk.c	23 Jul 2013 16:40:47 -0000	1.56
+++ ./gdb/gdbtk/generic/gdbtk.c	18 Sep 2013 13:38:51 -0000
@@ -31,6 +31,7 @@
 #include "top.h"
 #include "annotate.h"
 #include "exceptions.h"
+#include "main.h"
 
 #if defined(_WIN32) || defined(__CYGWIN__)
 #define WIN32_LEAN_AND_MEAN
@@ -88,8 +89,6 @@ extern int Tktable_Init (Tcl_Interp * in
 
 void gdbtk_init (void);
 
-static void gdbtk_init_1 (char *argv0);
-
 void gdbtk_interactive (void);
 
 static void cleanup_init (void *ignore);
@@ -122,8 +121,6 @@ int running_now;
 static char *gdbtk_source_filename = NULL;
 
 int gdbtk_disable_fputs = 1;
-
-static const char *argv0; 
 \f
 #ifndef _WIN32
 
@@ -372,7 +369,7 @@ gdbtk_init (void)
   old_chain = make_cleanup (cleanup_init, 0);
 
   /* First init tcl and tk. */
-  Tcl_FindExecutable (argv0);
+  Tcl_FindExecutable (get_gdb_program_name ());
   gdbtk_interp = Tcl_CreateInterp ();
 
 #ifdef TCL_MEM_DEBUG
@@ -664,13 +661,6 @@ gdbtk_find_main";
     }
 }
 
-static void
-gdbtk_init_1 (char *arg0)
-{
-  argv0 = arg0;
-  deprecated_init_ui_hook = NULL;
-}
-
 /* gdbtk_test is used in main.c to validate the -tclcommand option to
    gdb, which sources in a file of tcl code after idle during the
    startup procedure. */
@@ -690,13 +680,11 @@ gdbtk_test (char *filename)
 void
 _initialize_gdbtk (void)
 {
+#ifdef __CYGWIN__
   /* Current_interpreter not set yet, so we must check
      if "interpreter_p" is set to "insight" to know if
      insight is GOING to run. */
-  if (strcmp (interpreter_p, "insight") == 0)
-    deprecated_init_ui_hook = gdbtk_init_1;
-#ifdef __CYGWIN__
-  else
+  if (strcmp (interpreter_p, "insight") != 0)
     {
       DWORD ft = GetFileType (GetStdHandle (STD_INPUT_HANDLE));
 

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

* Re: [PATCH] Remove use of deprecated_init_ui_hook
       [not found] ` <523B92DD.5060408@redhat.com>
@ 2013-09-20 11:50   ` Andrew Burgess
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Burgess @ 2013-09-20 11:50 UTC (permalink / raw)
  To: insight

On 20/09/2013 1:12 AM, Keith Seitz wrote:
> On 09/18/2013 06:45 AM, Andrew Burgess wrote:
>> The patch below switches to use the new function, and
>> removes the use of deprecated_init_ui_hook.
>>
>> OK to apply?
> 
> Yes, this looks good. Thank you!

Committed.

Thanks,
Andrew


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

end of thread, other threads:[~2013-09-20 11:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-18 13:45 [PATCH] Remove use of deprecated_init_ui_hook Andrew Burgess
     [not found] ` <523B92DD.5060408@redhat.com>
2013-09-20 11:50   ` Andrew Burgess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).