* gdbtk.c (gdbtk_init): Check for a DISPLAY env variable and
authorFred Fish <fnf@specifix.com>
Fri, 23 Aug 1996 07:57:10 +0000 (07:57 +0000)
committerFred Fish <fnf@specifix.com>
Fri, 23 Aug 1996 07:57:10 +0000 (07:57 +0000)
gracefully degrade to using command line interface if none is
found.

gdb/ChangeLog
gdb/gdbtk.c

index 888fead5af3b23ee068079ef23963d9298917231..3c3c92ab6765fe7327503b9fd15eacb41a45e418 100644 (file)
@@ -1,3 +1,9 @@
+Fri Aug 23 00:44:57 1996  Fred Fish  <fnf@ninemoons.com>
+
+       * gdbtk.c (gdbtk_init): Check for a DISPLAY env variable and
+       gracefully degrade to using command line interface if none is
+       found.
+
 Wed Aug 21 16:31:27 1996  Fred Fish  <fnf@rtl.cygnus.com>
 
        * valprint.c (print_longest): Test for CC_HAS_LONG_LONG as well as
index 1237ef56d6ecf82caeb645541df0930794eaf7a6..a51f6d986fad7e58cead7ea2a411dd9647d3a2d5 100644 (file)
@@ -1240,6 +1240,13 @@ gdbtk_init ()
   struct sigaction action;
   static sigset_t nullsigmask = {0};
 
+  /* 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. */
+
+  if (getenv ("DISPLAY") == NULL)
+    return;
+
   old_chain = make_cleanup (cleanup_init, 0);
 
   /* First init tcl and tk. */
This page took 0.029781 seconds and 4 git commands to generate.