Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: gdb-patches@sourceware.org
Subject: Building the 7.8.90 pretest on MinGW
Date: Thu, 15 Jan 2015 16:07:00 -0000	[thread overview]
Message-ID: <83vbk82fkg.fsf@gnu.org> (raw)
In-Reply-To: <announce.20150113122445.36DDE48E8A@joel.gnat.com>

I've built the pretest using MinGW32.  I found 2 issues: one with
gnulib's time.h (reported to the gnulib list), the other with the
recent changes in tui/.  Specifically, starting "gdb -tui" fails with
this error message:

     Cannot enable the TUI: error opening terminal [TERM=<unset>]

This happens because the recent additions to tui.c make assumptions
about the curses library that don't hold for the MinGW port of
ncurses, e.g. that $TERM must be set.

The patch below fixes this for me.  OK to install it (master and
branch)?

2015-01-15  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/tui/tui.c~0	2015-01-13 14:14:48 +0200
+++ gdb/tui/tui.c	2015-01-15 10:52:01 +0200
@@ -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 ();


       reply	other threads:[~2015-01-15 16:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <announce.20150113122445.36DDE48E8A@joel.gnat.com>
2015-01-15 16:07 ` Eli Zaretskii [this message]
2015-01-15 19:49   ` Doug Evans
2015-01-19 17:48     ` Eli Zaretskii
2015-01-22 11:05       ` Pedro Alves
2015-01-22 16:09         ` Eli Zaretskii
2015-01-22 17:04           ` Pedro Alves
2015-01-22 17:27             ` Eli Zaretskii
2015-01-22 17:46               ` Pedro Alves
2015-01-22 18:30           ` Eli Zaretskii
2015-01-16  8:49   ` Eli Zaretskii
2015-01-20 18:27     ` Joel Brobecker
2015-01-20 18:36       ` Eli Zaretskii
2015-01-20 19:08         ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83vbk82fkg.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox