Convert dprintf to vtable ops
[binutils-gdb.git] / gdb / ui-out.h
index 46dfe28c1e146e81aed92ba43853175a4409b18f..9e6ff9a29bf0c773c7f7558003b54fbba2159e1c 100644 (file)
@@ -1,6 +1,6 @@
 /* Output generating routines for GDB.
 
-   Copyright (C) 1999-2021 Free Software Foundation, Inc.
+   Copyright (C) 1999-2022 Free Software Foundation, Inc.
 
    Contributed by Cygnus Solutions.
    Written by Fernando Nasser for Cygnus.
@@ -53,12 +53,9 @@ enum ui_out_flag
 {
   ui_source_list = (1 << 0),
   fix_multi_location_breakpoint_output = (1 << 1),
-  /* For CLI output, this flag is set if unfiltered output is desired.
-     This should only be used by low-level formatting functions.  */
-  unfiltered_output = (1 << 2),
   /* This indicates that %pF should be disallowed in a printf format
      string.  */
-  disallow_ui_out_field = (1 << 3)
+  disallow_ui_out_field = (1 << 2)
 };
 
 DEF_ENUM_FLAGS_TYPE (ui_out_flag, ui_out_flags);
@@ -192,7 +189,10 @@ class ui_out
   void field_string (const char *fldname, const char *string,
                     const ui_file_style &style = ui_file_style ());
   void field_string (const char *fldname, const std::string &string,
-                    const ui_file_style &style = ui_file_style ());
+                    const ui_file_style &style = ui_file_style ())
+  {
+    field_string (fldname, string.c_str (), style);
+  }
   void field_stream (const char *fldname, string_file &stream,
                     const ui_file_style &style = ui_file_style ());
   void field_skip (const char *fldname);
@@ -204,7 +204,7 @@ class ui_out
 
   void spaces (int numspaces);
   void text (const char *string);
-  void text (const std::string &string);
+  void text (const std::string &string) { text (string.c_str ()); }
 
   /* Output a printf-style formatted string.  In addition to the usual
      printf format specs, this supports a few GDB-specific
@@ -254,7 +254,7 @@ class ui_out
   void vmessage (const ui_file_style &in_style,
                 const char *format, va_list args) ATTRIBUTE_PRINTF (3, 0);
 
-  void wrap_hint (const char *identstring);
+  void wrap_hint (int indent);
 
   void flush ();
 
@@ -298,18 +298,18 @@ class ui_out
     progress_meter (const progress_meter &) = delete;
     progress_meter &operator= (const progress_meter &) = delete;
 
+    /* Emit some progress for this progress meter.  HOWMUCH may range
+       from 0.0 to 1.0.  */
+    void progress (double howmuch)
+    {
+      m_uiout->do_progress_notify (howmuch);
+    }
+
   private:
 
     struct ui_out *m_uiout;
   };
 
-  /* Emit some progress corresponding to the most recently created
-     progress meter.  HOWMUCH may range from 0.0 to 1.0.  */
-  void progress (double howmuch)
-  {
-    do_progress_notify (howmuch);
-  }
-
  protected:
 
   virtual void do_table_begin (int nbrofcols, int nr_rows, const char *tblid)
@@ -340,7 +340,7 @@ class ui_out
   virtual void do_message (const ui_file_style &style,
                           const char *format, va_list args)
     ATTRIBUTE_PRINTF (3,0) = 0;
-  virtual void do_wrap_hint (const char *identstring) = 0;
+  virtual void do_wrap_hint (int indent) = 0;
   virtual void do_flush () = 0;
   virtual void do_redirect (struct ui_file *outstream) = 0;