tui: Fix newterm call for older ncurses
authorSimon Marchi <simon.marchi@ericsson.com>
Tue, 4 Nov 2014 13:27:06 +0000 (08:27 -0500)
committerSimon Marchi <simon.marchi@ericsson.com>
Tue, 4 Nov 2014 19:15:53 +0000 (14:15 -0500)
Older versions of ncurses' newterm can't take NULL for their ofp and ifp
parameters. Newer versions can, and they fall back on stdout/stdin if
that is the case.

This patch explicitly passes stdout/stdin to the call to newterm to
avoid segfaulting with older ncurses.

gdb/Changelog:

2014-11-04  Simon Marchi  <simon.marchi@ericsson.com>

* tui/tui.c (tui_enable): Pass stdout and stdin to newterm.

gdb/ChangeLog
gdb/tui/tui.c

index 1aa39b1fe12063666dbcfa7467570deb68416a4f..e51a13733495972a3d07eddfcecc900cc474a526 100644 (file)
@@ -1,3 +1,7 @@
+2014-11-04  Simon Marchi  <simon.marchi@ericsson.com>
+
+       * tui/tui.c (tui_enable): Pass stdout and stdin to newterm.
+
 2014-11-04  Pedro Alves  <palves@redhat.com>
 
        * breakpoint.c (breakpoint_thread_match): Delete function.
index cb85fb02200e6947caf0eed4a0bec96f5ad4ad60..12ddab36d07e1ca4a72f26bcd08d21ebdf739bc6 100644 (file)
@@ -424,7 +424,7 @@ tui_enable (void)
       if (!ui_file_isatty (gdb_stdout))
        error (_("Cannot enable the TUI when output is not a terminal"));
 
-      s = newterm (NULL, NULL, NULL);
+      s = newterm (NULL, stdout, stdin);
       if (s == NULL)
        {
          error (_("Cannot enable the TUI: error opening terminal [TERM=%s]"),
This page took 0.031664 seconds and 4 git commands to generate.