From patchwork Thu Jan 15 16:07:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Zaretskii X-Patchwork-Id: 4706 Received: (qmail 26571 invoked by alias); 15 Jan 2015 16:07:40 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 26480 invoked by uid 89); 15 Jan 2015 16:07:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mtaout20.012.net.il Received: from mtaout20.012.net.il (HELO mtaout20.012.net.il) (80.179.55.166) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 15 Jan 2015 16:07:33 +0000 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NI8009007CPSK00@a-mtaout20.012.net.il> for gdb-patches@sourceware.org; Thu, 15 Jan 2015 18:06:56 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NI8009B87FKPC30@a-mtaout20.012.net.il> for gdb-patches@sourceware.org; Thu, 15 Jan 2015 18:06:56 +0200 (IST) Date: Thu, 15 Jan 2015 18:07:11 +0200 From: Eli Zaretskii Subject: Building the 7.8.90 pretest on MinGW In-reply-to: To: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83vbk82fkg.fsf@gnu.org> References: X-IsSubscribed: yes 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=] 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 * 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 ();