(gdbtk_init): Add gdbtk_cleanup as a final cleanup. Uncomment
call to ide_initialize_paths. If we can't initialize the event
system, set GDBTK_IDE to 0 in the Tcl interpreter. Create the
ide_window_register and the ide_window commands. Initialize tk,
itcl, and tix after initializing the IDE.
-Fri Aug 8 15:19:14 1997 Ian Lance Taylor <ian@cygnus.com>
+Fri Aug 8 15:59:24 1997 Ian Lance Taylor <ian@cygnus.com>
+
+ * gdbtk.c (gdbtk_cleanup): New static function.
+ (gdbtk_init): Add gdbtk_cleanup as a final cleanup. Uncomment
+ call to ide_initialize_paths. If we can't initialize the event
+ system, set GDBTK_IDE to 0 in the Tcl interpreter. Create the
+ ide_window_register and the ide_window commands. Initialize tk,
+ itcl, and tix after initializing the IDE.
* configure.in (tixdir): Update for cygwin32 case for Tcl 8.0.
* configure: Rebuild.
* configure.in (tixdir): Update for cygwin32 case for Tcl 8.0.
* configure: Rebuild.
+/* gdbtk_init installs this function as a final cleanup. */
+
+static void
+gdbtk_cleanup (dummy)
+ PTR dummy;
+{
+ Tcl_Finalize ();
+}
+
+/* Initialize gdbtk. */
+
static void
gdbtk_init ( argv0 )
char *argv0;
static void
gdbtk_init ( argv0 )
char *argv0;
if (Tcl_Init(interp) != TCL_OK)
error ("Tcl_Init failed: %s", interp->result);
if (Tcl_Init(interp) != TCL_OK)
error ("Tcl_Init failed: %s", interp->result);
- if (Tk_Init(interp) != TCL_OK)
- error ("Tk_Init failed: %s", interp->result);
-
- if (Itcl_Init(interp) == TCL_ERROR)
- error ("Itcl_Init failed: %s", interp->result);
-
- if (Tix_Init(interp) != TCL_OK)
- error ("Tix_Init failed: %s", interp->result);
+ make_final_cleanup (gdbtk_cleanup, NULL);
- /* Initialize the Paths variable.
+ /* Initialize the Paths variable. */
if (ide_initialize_paths (interp, "gdb") != TCL_OK)
if (ide_initialize_paths (interp, "gdb") != TCL_OK)
- return (TCL_ERROR);
- */
+ error ("ide_initialize_paths failed: %s", interp->result);
+
/* Find the directory where we expect to find idemanager. We ignore
errors since it doesn't really matter if this fails. */
libexecdir = Tcl_GetVar2 (interp, "Paths", "libexecdir", TCL_GLOBAL_ONLY);
/* Find the directory where we expect to find idemanager. We ignore
errors since it doesn't really matter if this fails. */
libexecdir = Tcl_GetVar2 (interp, "Paths", "libexecdir", TCL_GLOBAL_ONLY);
Tcl_AppendResult (interp, "can't initialize event system: ", errmsg,
(char *) NULL);
fprintf(stderr, "WARNING: ide_event_init_client failed: %s\n", interp->result);
Tcl_AppendResult (interp, "can't initialize event system: ", errmsg,
(char *) NULL);
fprintf(stderr, "WARNING: ide_event_init_client failed: %s\n", interp->result);
+
+ Tcl_SetVar (interp, "GDBTK_IDE", "0", 0);
if (ide_create_property_command (interp, h) != TCL_OK)
error ("ide_create_property_command failed: %s", interp->result);
if (ide_create_property_command (interp, h) != TCL_OK)
error ("ide_create_property_command failed: %s", interp->result);
+ if (ide_create_window_register_command (interp, h) != TCL_OK)
+ error ("ide_create_window_register_command failed: %s",
+ interp->result);
+
+ if (ide_create_window_command (interp, h) != TCL_OK)
+ error ("ide_create_window_command failed: %s", interp->result);
+
/*
if (ide_initialize (interp, "gdb") != TCL_OK)
error ("ide_initialize failed: %s", interp->result);
*/
/*
if (ide_initialize (interp, "gdb") != TCL_OK)
error ("ide_initialize failed: %s", interp->result);
*/
+
+ Tcl_SetVar (interp, "GDBTK_IDE", "1", 0);
- Tcl_SetVar (interp, "GDBTK_IDE", "1", 0);
#else
Tcl_SetVar (interp, "GDBTK_IDE", "0", 0);
#endif /* IDE */
#else
Tcl_SetVar (interp, "GDBTK_IDE", "0", 0);
#endif /* IDE */
+ /* We don't want to open the X connection until we've done all the
+ IDE initialization. Otherwise, goofy looking unfinished windows
+ pop up when ILU drops into the TCL event loop. */
+
+ if (Tk_Init(interp) != TCL_OK)
+ error ("Tk_Init failed: %s", interp->result);
+
+ if (Itcl_Init(interp) == TCL_ERROR)
+ error ("Itcl_Init failed: %s", interp->result);
+
+ if (Tix_Init(interp) != TCL_OK)
+ error ("Tix_Init failed: %s", interp->result);
+
Tcl_CreateCommand (interp, "gdb_cmd", call_wrapper, gdb_cmd, NULL);
Tcl_CreateCommand (interp, "gdb_loc", call_wrapper, gdb_loc, NULL);
Tcl_CreateCommand (interp, "gdb_path_conv", call_wrapper, gdb_path_conv, NULL);
Tcl_CreateCommand (interp, "gdb_cmd", call_wrapper, gdb_cmd, NULL);
Tcl_CreateCommand (interp, "gdb_loc", call_wrapper, gdb_loc, NULL);
Tcl_CreateCommand (interp, "gdb_path_conv", call_wrapper, gdb_path_conv, NULL);