Use bool in tui_before_prompt
[deliverable/binutils-gdb.git] / gdb / tui / tui-out.c
index 6d4e2363f353b17b4ccda2549d560fc974cb74d9..95543ff06a21ba8b0369f3a17314c91b3355994a 100644 (file)
@@ -1,6 +1,6 @@
 /* Output generating routines for GDB CLI.
 
-   Copyright (C) 1999-2018 Free Software Foundation, Inc.
+   Copyright (C) 1999-2019 Free Software Foundation, Inc.
 
    Contributed by Cygnus Solutions.
    Written by Fernando Nasser for Cygnus.
@@ -28,8 +28,8 @@
 /* Output an int field.  */
 
 void
-tui_ui_out::do_field_int (int fldno, int width, ui_align alignment,
-                         const char *fldname, int value)
+tui_ui_out::do_field_signed (int fldno, int width, ui_align alignment,
+                            const char *fldname, LONGEST value)
 {
   if (suppress_output ())
     return;
@@ -43,7 +43,7 @@ tui_ui_out::do_field_int (int fldno, int width, ui_align alignment,
     }
   m_start_of_line++;
 
-  cli_ui_out::do_field_int (fldno, width, alignment, fldname, value);
+  cli_ui_out::do_field_signed (fldno, width, alignment, fldname, value);
 }
 
 /* Other cli_field_* end up here so alignment and field separators are
@@ -51,37 +51,34 @@ tui_ui_out::do_field_int (int fldno, int width, ui_align alignment,
 
 void
 tui_ui_out::do_field_string (int fldno, int width, ui_align align,
-                            const char *fldname, const char *string)
+                            const char *fldname, const char *string,
+                            const ui_file_style &style)
 {
   if (suppress_output ())
     return;
 
+  m_start_of_line++;
+
   if (fldname && m_line > 0 && strcmp (fldname, "fullname") == 0)
     {
-      m_start_of_line++;
-      if (m_line > 0)
-        {
-          tui_show_source (string, m_line);
-        }
+      tui_show_source ();
       return;
     }
-  
-  m_start_of_line++;
 
-  cli_ui_out::do_field_string (fldno, width, align, fldname, string);
+  cli_ui_out::do_field_string (fldno, width, align, fldname, string, style);
 }
 
 void
 tui_ui_out::do_field_fmt (int fldno, int width, ui_align align,
-                         const char *fldname, const char *format,
-                         va_list args)
+                         const char *fldname, const ui_file_style &style,
+                         const char *format, va_list args)
 {
   if (suppress_output ())
     return;
 
   m_start_of_line++;
 
-  cli_ui_out::do_field_fmt (fldno, width, align, fldname, format, args);
+  cli_ui_out::do_field_fmt (fldno, width, align, fldname, style, format, args);
 }
 
 void
@@ -93,11 +90,16 @@ tui_ui_out::do_text (const char *string)
   m_start_of_line++;
   if (m_line > 0)
     {
+      /* Printing a source line, so suppress regular output -- the
+        line was shown on the TUI's source window by tui_show_source
+        above instead.  */
       if (strchr (string, '\n') != 0)
-        {
-          m_line = -1;
-          m_start_of_line = 0;
-        }
+       {
+         /* We've reached the end of the line, so go back to letting
+            text output go to the console.  */
+         m_line = 0;
+         m_start_of_line = 0;
+       }
       return;
     }
   if (strchr (string, '\n'))
@@ -107,9 +109,7 @@ tui_ui_out::do_text (const char *string)
 }
 
 tui_ui_out::tui_ui_out (ui_file *stream)
-: cli_ui_out (stream, 0),
-  m_line (0),
-  m_start_of_line (-1)
+  : cli_ui_out (stream, 0)
 {
 }
 
This page took 0.024721 seconds and 4 git commands to generate.