This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Can't activate the TUI is `set logging' is on.


 (top-gdb) set logging on
 Copying output to gdb.txt.

<now do c-x,c-a to switch to the TUI>
 (top-gdb) TUI mode not allowed

This the new check:

365     tui_enable (void)
366     {
367       if (!tui_allowed_p ())
368         error (_("TUI mode not allowed"));

The TUI is not allowed because:

74      int
75      tui_allowed_p (void)
76      {
77        /* Only if TUI is the top level interpreter.  Also don't try to
78           setup curses (and print funny control characters) if we're not
79           outputting to a terminal.  */
80        return tui_is_toplevel && ui_file_isatty (gdb_stdout);
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
81      }

... when logging is enabled, gdb_stdout is a tee_file, and tee_file_isatty
currently always returns false.

This patch below fixes it.  I've applied it.

Logging doesn't actually work with the TUI even after this.  I'll
fix that in a bit.

-- 
Pedro Alves

2010-04-17  Pedro Alves  <pedro@codesourcery.com>

	gdb/
	* ui-file.c (tee_file_isatty): Return whether `tee->one' is a tty,
	instead of always false.

---
 gdb/ui-file.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: src/gdb/ui-file.c
===================================================================
--- src.orig/gdb/ui-file.c	2010-04-18 00:21:36.000000000 +0100
+++ src/gdb/ui-file.c	2010-04-18 00:22:57.000000000 +0100
@@ -648,5 +648,6 @@ tee_file_isatty (struct ui_file *file)
   if (tee->magic != &tee_file_magic)
     internal_error (__FILE__, __LINE__,
 		    _("tee_file_isatty: bad magic number"));
-  return (0);
+
+  return ui_file_isatty (tee->one);
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]