This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb/gdb-7.9-branch] Fix MinGW TUI build
- From: Eli Zaretskii <eliz at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 22 Jan 2015 18:32:56 -0000
- Subject: [binutils-gdb/gdb-7.9-branch] Fix MinGW TUI build
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=31d4e82aa6cd53b05bc41222ba2ab42f6d6dee8b
commit 31d4e82aa6cd53b05bc41222ba2ab42f6d6dee8b
Author: Eli Zaretskii <eliz@gnu.org>
Date: Thu Jan 22 20:23:12 2015 +0200
Fix MinGW TUI build
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.
(cherry picked from commit 6b8a872ff1038e2b8618ea33bb1113b78f39976d)
Diff:
---
gdb/ChangeLog | 8 ++++++++
gdb/tui/tui.c | 11 ++++++++++-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 3d1233d..88710f5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
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 Eli Zaretskii <eliz@gnu.org>
+
* Makefile.in (HFILES_NO_SRCDIR): Remove ada-varobj.h.
(ALLDEPFILES): Remove irix5-nat.c. These two are part of the
reason that "make TAGS" is broken.
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index 00e505d..92463df 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -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 ();