]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix MinGW TUI build
authorEli Zaretskii <eliz@gnu.org>
Thu, 22 Jan 2015 18:23:12 +0000 (20:23 +0200)
committerEli Zaretskii <eliz@gnu.org>
Thu, 22 Jan 2015 18:24:57 +0000 (20:24 +0200)
gdb/
2015-01-22  Eli Zaretskii  <eliz@gnu.org>

* gdb/tui/tui.c (tui_enable) [__MINGW32__]: If the call to 'newterm'
fails with the 1st arg NULL, try again with "unknown".  Don't test
the "cup" capability: it isn't supported by the Windows port of
ncurses, but the Windows console driver is still capable of
supporting TUI.

gdb/ChangeLog
gdb/tui/tui.c

index fecedeb6251f1a4151e68995d829193d8a334033..a6ba992d68a32fb9476673fc57ded994924b96ff 100644 (file)
@@ -1,3 +1,11 @@
+2015-01-22  Eli Zaretskii  <eliz@gnu.org>
+
+       * gdb/tui/tui.c (tui_enable) [__MINGW32__]: If the call to 'newterm'
+       fails with the 1st arg NULL, try again with "unknown".  Don't test
+       the "cup" capability: it isn't supported by the Windows port of
+       ncurses, but the Windows console driver is still capable of
+       supporting TUI.
+
 2015-01-22  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * compile/compile.c (_initialize_compile): Use -fPIE for compile_args.
index 00e505df9c30bef29c3e693cf2850c29c6e1e3f6..92463df3e5a257cf0cb5ad3b72b4299407b5ad13 100644 (file)
@@ -425,6 +425,12 @@ tui_enable (void)
        error (_("Cannot enable the TUI when output is not a terminal"));
 
       s = newterm (NULL, stdout, stdin);
+#ifdef __MINGW32__
+      /* The MinGW port of ncurses requires $TERM to be unset in order
+        to activate the Windows console driver.  */
+      if (s == NULL)
+       s = newterm ("unknown", stdout, stdin);
+#endif
       if (s == NULL)
        {
          error (_("Cannot enable the TUI: error opening terminal [TERM=%s]"),
@@ -432,7 +438,9 @@ tui_enable (void)
        }
       w = stdscr;
 
-      /* Check required terminal capabilities.  */
+      /* Check required terminal capabilities.  The MinGW port of
+        ncurses does have them, but doesn't expose them through "cup".  */
+#ifndef __MINGW32__
       cap = tigetstr ("cup");
       if (cap == NULL || cap == (char *) -1 || *cap == '\0')
        {
@@ -442,6 +450,7 @@ tui_enable (void)
                   "terminal doesn't support cursor addressing [TERM=%s]"),
                 gdb_getenv_term ());
        }
+#endif
 
       cbreak ();
       noecho ();