From c87e6d0015ae357774fa5a25e2dcfed2c1df097f Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 4 Nov 2014 08:27:06 -0500 Subject: [PATCH] tui: Fix newterm call for older ncurses 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 * tui/tui.c (tui_enable): Pass stdout and stdin to newterm. --- gdb/ChangeLog | 4 ++++ gdb/tui/tui.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1aa39b1fe12..e51a1373349 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2014-11-04 Simon Marchi + + * tui/tui.c (tui_enable): Pass stdout and stdin to newterm. + 2014-11-04 Pedro Alves * breakpoint.c (breakpoint_thread_match): Delete function. diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index cb85fb02200..12ddab36d07 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -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]"), -- 2.30.2