Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] tui: Fix newterm call for older ncurses
@ 2014-11-04 13:31 Simon Marchi
  2014-11-04 19:08 ` Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Marchi @ 2014-11-04 13:31 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tui: Fix newterm call for older ncurses
  2014-11-04 13:31 [PATCH] tui: Fix newterm call for older ncurses Simon Marchi
@ 2014-11-04 19:08 ` Pedro Alves
  2014-11-04 19:17   ` Simon Marchi
  0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2014-11-04 19:08 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches

On 11/04/2014 01:31 PM, Simon Marchi wrote:
> 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

"explicitly"

> avoid segfaulting with older ncurses.
> 
> Reference: https://sourceware.org/ml/gdb-patches/2014-11/msg00055.html
> 

OK.

> gdb/Changelog:
> 
> 2014-11-04  Simon Marchi  <simon.marchi@ericsson.com>
> 
> 	* tui/tui.c (tui_enable): Pass pass stdout and stdin to newterm.

Double "pass".

Thanks,
Pedro Alves


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tui: Fix newterm call for older ncurses
  2014-11-04 19:08 ` Pedro Alves
@ 2014-11-04 19:17   ` Simon Marchi
  0 siblings, 0 replies; 3+ messages in thread
From: Simon Marchi @ 2014-11-04 19:17 UTC (permalink / raw)
  To: Pedro Alves, gdb-patches

On 2014-11-04 02:08 PM, Pedro Alves wrote:
> On 11/04/2014 01:31 PM, Simon Marchi wrote:
>> 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
> 
> "explicitly"
> 
>> avoid segfaulting with older ncurses.
>>
>> Reference: https://sourceware.org/ml/gdb-patches/2014-11/msg00055.html
>>
> 
> OK.
> 
>> gdb/Changelog:
>>
>> 2014-11-04  Simon Marchi  <simon.marchi@ericsson.com>
>>
>> 	* tui/tui.c (tui_enable): Pass pass stdout and stdin to newterm.
> 
> Double "pass".
> 
> Thanks,
> Pedro Alves

Pushed with the fixes to the commit message and ChangeLog, thanks.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-11-04 19:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-04 13:31 [PATCH] tui: Fix newterm call for older ncurses Simon Marchi
2014-11-04 19:08 ` Pedro Alves
2014-11-04 19:17   ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox