From: Simon Marchi <simon.marchi@ericsson.com>
To: <gdb-patches@sourceware.org>
Cc: Simon Marchi <simon.marchi@ericsson.com>
Subject: [PATCH] tui: Fix newterm call for older ncurses
Date: Tue, 04 Nov 2014 13:31:00 -0000 [thread overview]
Message-ID: <1415107885-18095-1-git-send-email-simon.marchi@ericsson.com> (raw)
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 explicitely passes stdout/stdin to the call to newterm to
avoid segfaulting with older ncurses.
Reference: https://sourceware.org/ml/gdb-patches/2014-11/msg00055.html
gdb/Changelog:
2014-11-04 Simon Marchi <simon.marchi@ericsson.com>
* tui/tui.c (tui_enable): Pass pass stdout and stdin to newterm.
---
gdb/tui/tui.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index cb85fb0..12ddab3 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.1.1
next reply other threads:[~2014-11-04 13:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-04 13:31 Simon Marchi [this message]
2014-11-04 19:08 ` Pedro Alves
2014-11-04 19:17 ` Simon Marchi
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=1415107885-18095-1-git-send-email-simon.marchi@ericsson.com \
--to=simon.marchi@ericsson.com \
--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