public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Audit uses of unfiltered output to gdb_stdout
@ 2022-01-06 17:28 Tom Tromey
  2022-01-06 17:28 ` [PATCH 1/4] Send some error output to gdb_stderr Tom Tromey
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Tom Tromey @ 2022-01-06 17:28 UTC (permalink / raw)
  To: gdb-patches

My belief is that some gdb output must be unfiltered -- in particular,
I think infrun is probably not set up to handle a quit thrown from a
paging prompt that was caused by some thread-event user notification.

However, many such calls aren't actually needed, or, if they are
needed, should be sent to either gdb_stderr or gdb_stdlog.

I went through all the text output in gdb, looking for unfiltered
output to gdb_stdout.  This series is the result.

After this, I think all _unfiltered calls that don't explicitly pass a
ui_file (that is, calls like printf_unfiltered and not
fprintf_unfiltered) should remain as unfiltered.  But, all calls that
*do* pass a ui_file are either (1) sending to gdb_stdout and come from
a location that can comfortably be switched to _filtered; or (2) are
sending to some other stream, where filtering is irrelevant.

One final oddity is complete_command.  This is explicitly unfiltered
due to its use by Emacs.  I considered (and even wrote a patch for)
changing the "server" prefix to disable filtering; but in the end I
wasn't sure whether this would break some client.  It seemed horribly
possible to me that some client out there could look for the pager
prompt to limit the number of completions.

This series is the last step before the pager rewrite can be sent.
I've broken things down into sub-series to make review a little less
daunting.  (Note that the wrap_here, Darwin output, and
timestamped_file patches also must land before the pager.)

Regression tested on x86-64 Fedora 34.

Tom



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

* [PATCH 1/4] Send some error output to gdb_stderr
  2022-01-06 17:28 [PATCH 0/4] Audit uses of unfiltered output to gdb_stdout Tom Tromey
@ 2022-01-06 17:28 ` Tom Tromey
  2022-01-06 17:28 ` [PATCH 2/4] Sent timing stats to gdb_stdlog Tom Tromey
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Tom Tromey @ 2022-01-06 17:28 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes some code to send some error messages to gdb_stderr
rather than gdb_stdout.
---
 gdb/breakpoint.c | 7 ++++---
 gdb/event-top.c  | 2 +-
 gdb/inf-loop.c   | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index c7d75731621..259069fe86d 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -13550,9 +13550,10 @@ update_breakpoint_locations (struct breakpoint *b,
       /* Ranged breakpoints have only one start location and one end
 	 location.  */
       b->enable_state = bp_disabled;
-      printf_unfiltered (_("Could not reset ranged breakpoint %d: "
-			   "multiple locations found\n"),
-			 b->number);
+      fprintf_unfiltered (gdb_stderr,
+			  _("Could not reset ranged breakpoint %d: "
+			    "multiple locations found\n"),
+			  b->number);
       return;
     }
 
diff --git a/gdb/event-top.c b/gdb/event-top.c
index 51c6ee803cd..28a1924f9dc 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -494,7 +494,7 @@ stdin_event_handler (int error, gdb_client_data client_data)
       if (main_ui == ui)
 	{
 	  /* If stdin died, we may as well kill gdb.  */
-	  printf_unfiltered (_("error detected on stdin\n"));
+	  fprintf_unfiltered (gdb_stderr, _("error detected on stdin\n"));
 	  quit_command ((char *) 0, 0);
 	}
       else
diff --git a/gdb/inf-loop.c b/gdb/inf-loop.c
index f1298cf3192..2002c4b8966 100644
--- a/gdb/inf-loop.c
+++ b/gdb/inf-loop.c
@@ -85,7 +85,7 @@ inferior_event_handler (enum inferior_event_type event_type)
       break;
 
     default:
-      printf_unfiltered (_("Event type not recognized.\n"));
+      fprintf_unfiltered (gdb_stderr, _("Event type not recognized.\n"));
       break;
     }
 }
-- 
2.31.1


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

* [PATCH 2/4] Sent timing stats to gdb_stdlog
  2022-01-06 17:28 [PATCH 0/4] Audit uses of unfiltered output to gdb_stdout Tom Tromey
  2022-01-06 17:28 ` [PATCH 1/4] Send some error output to gdb_stderr Tom Tromey
@ 2022-01-06 17:28 ` Tom Tromey
  2022-01-06 17:28 ` [PATCH 3/4] Reduce explicit use of gdb_stdout Tom Tromey
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Tom Tromey @ 2022-01-06 17:28 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This changes the time / space / symtab per-command statistics code to
send its output to gdb_stdlog rather than gdb_stdout.  This seems
slightly more correct to me.
---
 gdb/maint.c | 47 +++++++++++++++++++++++++----------------------
 1 file changed, 25 insertions(+), 22 deletions(-)

diff --git a/gdb/maint.c b/gdb/maint.c
index 3584974c9e1..7e84b60fea0 100644
--- a/gdb/maint.c
+++ b/gdb/maint.c
@@ -990,11 +990,12 @@ scoped_command_stats::~scoped_command_stats ()
       /* Subtract time spend in prompt_for_continue from walltime.  */
       wall_time -= get_prompt_for_continue_wait_time ();
 
-      printf_unfiltered (!m_msg_type
-			 ? _("Startup time: %.6f (cpu), %.6f (wall)\n")
-			 : _("Command execution time: %.6f (cpu), %.6f (wall)\n"),
-			 duration<double> (cmd_time).count (),
-			 duration<double> (wall_time).count ());
+      fprintf_unfiltered (gdb_stdlog,
+			  !m_msg_type
+			  ? _("Startup time: %.6f (cpu), %.6f (wall)\n")
+			  : _("Command execution time: %.6f (cpu), %.6f (wall)\n"),
+			  duration<double> (cmd_time).count (),
+			  duration<double> (wall_time).count ());
     }
 
   if (m_space_enabled && per_command_space)
@@ -1005,12 +1006,13 @@ scoped_command_stats::~scoped_command_stats ()
       long space_now = lim - lim_at_start;
       long space_diff = space_now - m_start_space;
 
-      printf_unfiltered (!m_msg_type
-			 ? _("Space used: %ld (%s%ld during startup)\n")
-			 : _("Space used: %ld (%s%ld for this command)\n"),
-			 space_now,
-			 (space_diff >= 0 ? "+" : ""),
-			 space_diff);
+      fprintf_unfiltered (gdb_stdlog,
+			  !m_msg_type
+			  ? _("Space used: %ld (%s%ld during startup)\n")
+			  : _("Space used: %ld (%s%ld for this command)\n"),
+			  space_now,
+			  (space_diff >= 0 ? "+" : ""),
+			  space_diff);
 #endif
     }
 
@@ -1019,16 +1021,17 @@ scoped_command_stats::~scoped_command_stats ()
       int nr_symtabs, nr_compunit_symtabs, nr_blocks;
 
       count_symtabs_and_blocks (&nr_symtabs, &nr_compunit_symtabs, &nr_blocks);
-      printf_unfiltered (_("#symtabs: %d (+%d),"
-			   " #compunits: %d (+%d),"
-			   " #blocks: %d (+%d)\n"),
-			 nr_symtabs,
-			 nr_symtabs - m_start_nr_symtabs,
-			 nr_compunit_symtabs,
-			 (nr_compunit_symtabs
-			  - m_start_nr_compunit_symtabs),
-			 nr_blocks,
-			 nr_blocks - m_start_nr_blocks);
+      fprintf_unfiltered (gdb_stdlog,
+			  _("#symtabs: %d (+%d),"
+			    " #compunits: %d (+%d),"
+			    " #blocks: %d (+%d)\n"),
+			  nr_symtabs,
+			  nr_symtabs - m_start_nr_symtabs,
+			  nr_compunit_symtabs,
+			  (nr_compunit_symtabs
+			   - m_start_nr_compunit_symtabs),
+			  nr_blocks,
+			  nr_blocks - m_start_nr_blocks);
     }
 }
 
@@ -1095,7 +1098,7 @@ scoped_command_stats::print_time (const char *msg)
   char out[100];
   strftime (out, sizeof (out), "%F %H:%M:%S", &tm);
 
-  printf_unfiltered ("%s.%03d - %s\n", out, (int) millis, msg);
+  fprintf_unfiltered (gdb_stdlog, "%s.%03d - %s\n", out, (int) millis, msg);
 }
 
 /* Handle unknown "mt set per-command" arguments.
-- 
2.31.1


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

* [PATCH 3/4] Reduce explicit use of gdb_stdout
  2022-01-06 17:28 [PATCH 0/4] Audit uses of unfiltered output to gdb_stdout Tom Tromey
  2022-01-06 17:28 ` [PATCH 1/4] Send some error output to gdb_stderr Tom Tromey
  2022-01-06 17:28 ` [PATCH 2/4] Sent timing stats to gdb_stdlog Tom Tromey
@ 2022-01-06 17:28 ` Tom Tromey
  2022-01-08 16:57   ` Tom Tromey
  2022-01-06 17:28 ` [PATCH 4/4] Always print the "host libthread-db" message to stdout Tom Tromey
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 10+ messages in thread
From: Tom Tromey @ 2022-01-06 17:28 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

For auditing purposes -- that is, to make it easier to believe that
the forthcoming pager rewrite is correct -- it is best if the
necessary uses of unfiltered output use the stream-less forms like
printf_unfiltered, rather than fprintf_unfiltered.  To this end, this
patch removes the spots where gdb_stdout is unnecessarily passed as a
parameter.  I went ahead and converted all the _filtered calls I could
find, as well, because I think that's a bit clearer.
---
 gdb/breakpoint.c                      |  7 ++--
 gdb/event-top.c                       |  2 +-
 gdb/fbsd-nat.c                        | 13 ++++---
 gdb/gcore.c                           | 15 ++++----
 gdb/guile/scm-param.c                 |  2 +-
 gdb/infcmd.c                          |  2 +-
 gdb/linux-fork.c                      |  2 +-
 gdb/m2-lang.c                         |  2 +-
 gdb/macrocmd.c                        | 49 +++++++++++++--------------
 gdb/netbsd-nat.c                      | 13 ++++---
 gdb/printcmd.c                        | 10 +++---
 gdb/psymtab.c                         | 30 +++++++---------
 gdb/python/py-param.c                 |  2 +-
 gdb/stack.c                           | 25 ++++++--------
 gdb/symfile.c                         |  8 ++---
 gdb/top.c                             |  2 +-
 gdb/tracepoint.c                      |  4 +--
 gdb/typeprint.c                       |  2 +-
 gdb/unittests/command-def-selftests.c | 36 +++++++++-----------
 gdb/utils.c                           | 10 +++---
 20 files changed, 109 insertions(+), 127 deletions(-)

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 259069fe86d..deda8672a66 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -8625,10 +8625,9 @@ handle_automatic_hardware_breakpoints (bp_location *bl)
 	      bl->loc_type = new_type;
 	      if (!said)
 		{
-		  fprintf_filtered (gdb_stdout,
-				    _("Note: automatically using "
-				      "hardware breakpoints for "
-				      "read-only addresses.\n"));
+		  printf_filtered (_("Note: automatically using "
+				     "hardware breakpoints for "
+				     "read-only addresses.\n"));
 		  said = true;
 		}
 	    }
diff --git a/gdb/event-top.c b/gdb/event-top.c
index 28a1924f9dc..c596fb0d235 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -427,7 +427,7 @@ display_gdb_prompt (const char *new_prompt)
       /* Don't use a _filtered function here.  It causes the assumed
 	 character position to be off, since the newline we read from
 	 the user is not accounted for.  */
-      fprintf_unfiltered (gdb_stdout, "%s", actual_gdb_prompt.c_str ());
+      printf_unfiltered ("%s", actual_gdb_prompt.c_str ());
       gdb_flush (gdb_stdout);
     }
 }
diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c
index ae5af02693e..f3d5e47e485 100644
--- a/gdb/fbsd-nat.c
+++ b/gdb/fbsd-nat.c
@@ -104,13 +104,12 @@ fbsd_nat_target::find_memory_regions (find_memory_region_ftype func,
       size = kve->kve_end - kve->kve_start;
       if (info_verbose)
 	{
-	  fprintf_filtered (gdb_stdout, 
-			    "Save segment, %ld bytes at %s (%c%c%c)\n",
-			    (long) size,
-			    paddress (target_gdbarch (), kve->kve_start),
-			    kve->kve_protection & KVME_PROT_READ ? 'r' : '-',
-			    kve->kve_protection & KVME_PROT_WRITE ? 'w' : '-',
-			    kve->kve_protection & KVME_PROT_EXEC ? 'x' : '-');
+	  printf_filtered ("Save segment, %ld bytes at %s (%c%c%c)\n",
+			   (long) size,
+			   paddress (target_gdbarch (), kve->kve_start),
+			   kve->kve_protection & KVME_PROT_READ ? 'r' : '-',
+			   kve->kve_protection & KVME_PROT_WRITE ? 'w' : '-',
+			   kve->kve_protection & KVME_PROT_EXEC ? 'x' : '-');
 	}
 
       /* Invoke the callback function to create the corefile segment.
diff --git a/gdb/gcore.c b/gdb/gcore.c
index 63ebbb79e84..5e3aa68307b 100644
--- a/gdb/gcore.c
+++ b/gdb/gcore.c
@@ -140,9 +140,8 @@ gcore_command (const char *args, int from_tty)
     }
 
   if (info_verbose)
-    fprintf_filtered (gdb_stdout,
-		      "Opening corefile '%s' for output.\n",
-		      corefilename.get ());
+    printf_filtered ("Opening corefile '%s' for output.\n",
+		     corefilename.get ());
 
   if (target_supports_dumpcore ())
     target_dumpcore (corefilename.get ());
@@ -161,7 +160,7 @@ gcore_command (const char *args, int from_tty)
       unlink_file.keep ();
     }
 
-  fprintf_filtered (gdb_stdout, "Saved corefile %s\n", corefilename.get ());
+  printf_filtered ("Saved corefile %s\n", corefilename.get ());
 }
 
 static enum bfd_architecture
@@ -385,8 +384,8 @@ gcore_create_callback (CORE_ADDR vaddr, unsigned long size, int read,
     {
       if (info_verbose)
 	{
-	  fprintf_filtered (gdb_stdout, "Ignore segment, %s bytes at %s\n",
-			    plongest (size), paddress (target_gdbarch (), vaddr));
+	  printf_filtered ("Ignore segment, %s bytes at %s\n",
+			   plongest (size), paddress (target_gdbarch (), vaddr));
 	}
 
       return 0;
@@ -445,8 +444,8 @@ gcore_create_callback (CORE_ADDR vaddr, unsigned long size, int read,
 
   if (info_verbose)
     {
-      fprintf_filtered (gdb_stdout, "Save segment, %s bytes at %s\n",
-			plongest (size), paddress (target_gdbarch (), vaddr));
+      printf_filtered ("Save segment, %s bytes at %s\n",
+		       plongest (size), paddress (target_gdbarch (), vaddr));
     }
 
   bfd_set_section_size (osec, size);
diff --git a/gdb/guile/scm-param.c b/gdb/guile/scm-param.c
index 125b0e4766b..2bbd46396fc 100644
--- a/gdb/guile/scm-param.c
+++ b/gdb/guile/scm-param.c
@@ -320,7 +320,7 @@ pascm_set_func (const char *args, int from_tty, struct cmd_list_element *c)
 
   /* GDB is usually silent when a parameter is set.  */
   if (*msg.get () != '\0')
-    fprintf_filtered (gdb_stdout, "%s\n", msg.get ());
+    printf_filtered ("%s\n", msg.get ());
 }
 
 /* A callback function that is registered against the respective
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 8bf58018bdd..b819397c2a6 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -1103,7 +1103,7 @@ jump_command (const char *arg, int from_tty)
   if (from_tty)
     {
       printf_filtered (_("Continuing at "));
-      fputs_filtered (paddress (gdbarch, addr), gdb_stdout);
+      puts_filtered (paddress (gdbarch, addr));
       printf_filtered (".\n");
     }
 
diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c
index c26900c75e8..4baab3c80c7 100644
--- a/gdb/linux-fork.c
+++ b/gdb/linux-fork.c
@@ -580,7 +580,7 @@ info_checkpoints_command (const char *arg, int from_tty)
       if (fi.num == 0)
 	printf_filtered (_(" (main process)"));
       printf_filtered (_(" at "));
-      fputs_filtered (paddress (gdbarch, pc), gdb_stdout);
+      puts_filtered (paddress (gdbarch, pc));
 
       symtab_and_line sal = find_pc_line (pc, 0);
       if (sal.symtab)
diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c
index 1b53aff3f0d..7673426b7a8 100644
--- a/gdb/m2-lang.c
+++ b/gdb/m2-lang.c
@@ -165,7 +165,7 @@ m2_language::printstr (struct ui_file *stream, struct type *elttype,
 
   if (length == 0)
     {
-      fputs_filtered ("\"\"", gdb_stdout);
+      puts_filtered ("\"\"");
       return;
     }
 
diff --git a/gdb/macrocmd.c b/gdb/macrocmd.c
index 5f40a60909a..07714644fca 100644
--- a/gdb/macrocmd.c
+++ b/gdb/macrocmd.c
@@ -63,9 +63,9 @@ macro_expand_command (const char *exp, int from_tty)
     {
       gdb::unique_xmalloc_ptr<char> expanded = macro_expand (exp, *ms);
 
-      fputs_filtered ("expands to: ", gdb_stdout);
-      fputs_filtered (expanded.get (), gdb_stdout);
-      fputs_filtered ("\n", gdb_stdout);
+      puts_filtered ("expands to: ");
+      puts_filtered (expanded.get ());
+      puts_filtered ("\n");
     }
   else
     macro_inform_no_debuginfo ();
@@ -91,9 +91,9 @@ macro_expand_once_command (const char *exp, int from_tty)
     {
       gdb::unique_xmalloc_ptr<char> expanded = macro_expand_once (exp, *ms);
 
-      fputs_filtered ("expands to: ", gdb_stdout);
-      fputs_filtered (expanded.get (), gdb_stdout);
-      fputs_filtered ("\n", gdb_stdout);
+      puts_filtered ("expands to: ");
+      puts_filtered (expanded.get ());
+      puts_filtered ("\n");
     }
   else
     macro_inform_no_debuginfo ();
@@ -137,32 +137,32 @@ print_macro_definition (const char *name,
 			struct macro_source_file *file,
 			int line)
 {
-  fprintf_filtered (gdb_stdout, "Defined at ");
+  printf_filtered ("Defined at ");
   show_pp_source_pos (gdb_stdout, file, line);
 
   if (line != 0)
-    fprintf_filtered (gdb_stdout, "#define %s", name);
+    printf_filtered ("#define %s", name);
   else
-    fprintf_filtered (gdb_stdout, "-D%s", name);
+    printf_filtered ("-D%s", name);
 
   if (d->kind == macro_function_like)
     {
       int i;
 
-      fputs_filtered ("(", gdb_stdout);
+      puts_filtered ("(");
       for (i = 0; i < d->argc; i++)
 	{
-	  fputs_filtered (d->argv[i], gdb_stdout);
+	  puts_filtered (d->argv[i]);
 	  if (i + 1 < d->argc)
-	    fputs_filtered (", ", gdb_stdout);
+	    puts_filtered (", ");
 	}
-      fputs_filtered (")", gdb_stdout);
+      puts_filtered (")");
     }
 
   if (line != 0)
-    fprintf_filtered (gdb_stdout, " %s\n", d->replacement);
+    printf_filtered (" %s\n", d->replacement);
   else
-    fprintf_filtered (gdb_stdout, "=%s\n", d->replacement);
+    printf_filtered ("=%s\n", d->replacement);
 }
 
 /* The implementation of the `info macro' command.  */
@@ -229,10 +229,9 @@ info_macro_command (const char *args, int from_tty)
 	}
       else
 	{
-	  fprintf_filtered (gdb_stdout,
-			    "The symbol `%s' has no definition as a C/C++"
-			    " preprocessor macro\n"
-			    "at ", name);
+	  printf_filtered ("The symbol `%s' has no definition as a C/C++"
+			   " preprocessor macro\n"
+			   "at ", name);
 	  show_pp_source_pos (gdb_stdout, ms->file, ms->line);
 	}
     }
@@ -424,18 +423,18 @@ static void
 print_one_macro (const char *name, const struct macro_definition *macro,
 		 struct macro_source_file *source, int line)
 {
-  fprintf_filtered (gdb_stdout, "macro define %s", name);
+  printf_filtered ("macro define %s", name);
   if (macro->kind == macro_function_like)
     {
       int i;
 
-      fprintf_filtered (gdb_stdout, "(");
+      printf_filtered ("(");
       for (i = 0; i < macro->argc; ++i)
-	fprintf_filtered (gdb_stdout, "%s%s", (i > 0) ? ", " : "",
-			  macro->argv[i]);
-      fprintf_filtered (gdb_stdout, ")");
+	printf_filtered ("%s%s", (i > 0) ? ", " : "",
+			 macro->argv[i]);
+      printf_filtered (")");
     }
-  fprintf_filtered (gdb_stdout, " %s\n", macro->replacement);
+  printf_filtered (" %s\n", macro->replacement);
 }
 
 
diff --git a/gdb/netbsd-nat.c b/gdb/netbsd-nat.c
index 1463305acc8..9e9014283cd 100644
--- a/gdb/netbsd-nat.c
+++ b/gdb/netbsd-nat.c
@@ -247,13 +247,12 @@ nbsd_nat_target::find_memory_regions (find_memory_region_ftype func,
       size_t size = kve->kve_end - kve->kve_start;
       if (info_verbose)
 	{
-	  fprintf_filtered (gdb_stdout,
-			    "Save segment, %ld bytes at %s (%c%c%c)\n",
-			    (long) size,
-			    paddress (target_gdbarch (), kve->kve_start),
-			    kve->kve_protection & KVME_PROT_READ ? 'r' : '-',
-			    kve->kve_protection & KVME_PROT_WRITE ? 'w' : '-',
-			    kve->kve_protection & KVME_PROT_EXEC ? 'x' : '-');
+	  printf_filtered ("Save segment, %ld bytes at %s (%c%c%c)\n",
+			   (long) size,
+			   paddress (target_gdbarch (), kve->kve_start),
+			   kve->kve_protection & KVME_PROT_READ ? 'r' : '-',
+			   kve->kve_protection & KVME_PROT_WRITE ? 'w' : '-',
+			   kve->kve_protection & KVME_PROT_EXEC ? 'x' : '-');
 	}
 
       /* Invoke the callback function to create the corefile segment.
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 509f62c21c7..fdbe72be83c 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -1155,7 +1155,7 @@ do_examine (struct format_data fmt, struct gdbarch *gdbarch, CORE_ADDR addr)
 	}
 
       if (format == 'i')
-	fputs_filtered (pc_prefix (next_address), gdb_stdout);
+	puts_filtered (pc_prefix (next_address));
       print_address (next_gdbarch, next_address, gdb_stdout);
       printf_filtered (":");
       for (i = maxelts;
@@ -1683,7 +1683,7 @@ info_address_command (const char *exp, int from_tty)
     }
 
   printf_filtered ("Symbol \"");
-  fputs_filtered (sym->print_name (), gdb_stdout);
+  puts_filtered (sym->print_name ());
   printf_filtered ("\" is ");
   val = SYMBOL_VALUE (sym);
   if (SYMBOL_OBJFILE_OWNED (sym))
@@ -2184,9 +2184,9 @@ do_one_display (struct display *d)
 	}
       catch (const gdb_exception_error &ex)
 	{
-	  fprintf_filtered (gdb_stdout, _("%p[<error: %s>%p]\n"),
-			    metadata_style.style ().ptr (), ex.what (),
-			    nullptr);
+	  printf_filtered (_("%p[<error: %s>%p]\n"),
+			   metadata_style.style ().ptr (), ex.what (),
+			   nullptr);
 	}
     }
   else
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index 7e2da485ba5..5303e86e719 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -1420,9 +1420,9 @@ partial_symtab::expand_dependencies (struct objfile *objfile)
 	  /* Inform about additional files to be read in.  */
 	  if (info_verbose)
 	    {
-	      fputs_filtered (" ", gdb_stdout);
+	      puts_filtered (" ");
 	      wrap_here ("");
-	      fputs_filtered ("and ", gdb_stdout);
+	      puts_filtered ("and ");
 	      wrap_here ("");
 	      printf_filtered ("%s...", dependencies[i]->filename);
 	      wrap_here ("");	/* Flush output */
@@ -1695,13 +1695,11 @@ maintenance_info_psymtabs (const char *regexp, int from_tty)
 				     psymtab->fullname
 				     ? psymtab->fullname : "(null)");
 		    printf_filtered ("    text addresses ");
-		    fputs_filtered (paddress (gdbarch,
-					      psymtab->text_low (objfile)),
-				    gdb_stdout);
+		    puts_filtered (paddress (gdbarch,
+					     psymtab->text_low (objfile)));
 		    printf_filtered (" -- ");
-		    fputs_filtered (paddress (gdbarch,
-					      psymtab->text_high (objfile)),
-				    gdb_stdout);
+		    puts_filtered (paddress (gdbarch,
+					     psymtab->text_high (objfile)));
 		    printf_filtered ("\n");
 		    printf_filtered ("    psymtabs_addrmap_supported %s\n",
 				     (psymtab->psymtabs_addrmap_supported
@@ -1792,11 +1790,9 @@ maintenance_check_psymtabs (const char *ignore, int from_tty)
 		  printf_filtered ("Psymtab ");
 		  puts_filtered (ps->filename);
 		  printf_filtered (" covers bad range ");
-		  fputs_filtered (paddress (gdbarch, ps->text_low (objfile)),
-				  gdb_stdout);
+		  puts_filtered (paddress (gdbarch, ps->text_low (objfile)));
 		  printf_filtered (" - ");
-		  fputs_filtered (paddress (gdbarch, ps->text_high (objfile)),
-				  gdb_stdout);
+		  puts_filtered (paddress (gdbarch, ps->text_high (objfile)));
 		  printf_filtered ("\n");
 		  continue;
 		}
@@ -1848,15 +1844,13 @@ maintenance_check_psymtabs (const char *ignore, int from_tty)
 		  printf_filtered ("Psymtab ");
 		  puts_filtered (ps->filename);
 		  printf_filtered (" covers ");
-		  fputs_filtered (paddress (gdbarch, ps->text_low (objfile)),
-				  gdb_stdout);
+		  puts_filtered (paddress (gdbarch, ps->text_low (objfile)));
 		  printf_filtered (" - ");
-		  fputs_filtered (paddress (gdbarch, ps->text_high (objfile)),
-				  gdb_stdout);
+		  puts_filtered (paddress (gdbarch, ps->text_high (objfile)));
 		  printf_filtered (" but symtab covers only ");
-		  fputs_filtered (paddress (gdbarch, BLOCK_START (b)), gdb_stdout);
+		  puts_filtered (paddress (gdbarch, BLOCK_START (b)));
 		  printf_filtered (" - ");
-		  fputs_filtered (paddress (gdbarch, BLOCK_END (b)), gdb_stdout);
+		  puts_filtered (paddress (gdbarch, BLOCK_END (b)));
 		  printf_filtered ("\n");
 		}
 	    }
diff --git a/gdb/python/py-param.c b/gdb/python/py-param.c
index 592ecbb41f9..a25dad315c9 100644
--- a/gdb/python/py-param.c
+++ b/gdb/python/py-param.c
@@ -414,7 +414,7 @@ get_set_value (const char *args, int from_tty,
 
   const char *str = set_doc_string.get ();
   if (str != nullptr && str[0] != '\0')
-    fprintf_filtered (gdb_stdout, "%s\n", str);
+    printf_filtered ("%s\n", str);
 }
 
 /* A callback function that is registered against the respective
diff --git a/gdb/stack.c b/gdb/stack.c
index 8239c76de20..23474c8c829 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -1548,11 +1548,11 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
     {
       printf_filtered (_("Stack frame at "));
     }
-  fputs_filtered (paddress (gdbarch, get_frame_base (fi)), gdb_stdout);
+  puts_filtered (paddress (gdbarch, get_frame_base (fi)));
   printf_filtered (":\n");
   printf_filtered (" %s = ", pc_regname);
   if (frame_pc_p)
-    fputs_filtered (paddress (gdbarch, get_frame_pc (fi)), gdb_stdout);
+    puts_filtered (paddress (gdbarch, get_frame_pc (fi)));
   else
     fputs_styled ("<unavailable>", metadata_style.style (), gdb_stdout);
 
@@ -1560,7 +1560,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
   if (funname)
     {
       printf_filtered (" in ");
-      fputs_filtered (funname, gdb_stdout);
+      puts_filtered (funname);
     }
   wrap_here ("   ");
   if (sal.symtab)
@@ -1602,7 +1602,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
     }
 
   if (caller_pc_p)
-    fputs_filtered (paddress (gdbarch, caller_pc), gdb_stdout);
+    puts_filtered (paddress (gdbarch, caller_pc));
   printf_filtered ("\n");
 
   if (calling_frame_info == NULL)
@@ -1622,8 +1622,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
   else
     {
       printf_filtered (" called by frame at ");
-      fputs_filtered (paddress (gdbarch, get_frame_base (calling_frame_info)),
-		      gdb_stdout);
+      puts_filtered (paddress (gdbarch, get_frame_base (calling_frame_info)));
     }
   if (get_next_frame (fi) && calling_frame_info)
     puts_filtered (",");
@@ -1631,8 +1630,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
   if (get_next_frame (fi))
     {
       printf_filtered (" caller of frame at ");
-      fputs_filtered (paddress (gdbarch, get_frame_base (get_next_frame (fi))),
-		      gdb_stdout);
+      puts_filtered (paddress (gdbarch, get_frame_base (get_next_frame (fi))));
     }
   if (get_next_frame (fi) || calling_frame_info)
     puts_filtered ("\n");
@@ -1652,7 +1650,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
     else
       {
 	printf_filtered (" Arglist at ");
-	fputs_filtered (paddress (gdbarch, arg_list), gdb_stdout);
+	puts_filtered (paddress (gdbarch, arg_list));
 	printf_filtered (",");
 
 	if (!gdbarch_frame_num_args_p (gdbarch))
@@ -1685,7 +1683,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
     else
       {
 	printf_filtered (" Locals at ");
-	fputs_filtered (paddress (gdbarch, arg_list), gdb_stdout);
+	puts_filtered (paddress (gdbarch, arg_list));
 	printf_filtered (",");
       }
   }
@@ -1720,14 +1718,13 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
 		  (value_contents_all (value).data (), sp_size, byte_order);
 
 		printf_filtered (" Previous frame's sp is ");
-		fputs_filtered (paddress (gdbarch, sp), gdb_stdout);
+		puts_filtered (paddress (gdbarch, sp));
 		printf_filtered ("\n");
 	      }
 	    else if (VALUE_LVAL (value) == lval_memory)
 	      {
 		printf_filtered (" Previous frame's sp at ");
-		fputs_filtered (paddress (gdbarch, value_address (value)),
-				gdb_stdout);
+		puts_filtered (paddress (gdbarch, value_address (value)));
 		printf_filtered ("\n");
 	      }
 	    else if (VALUE_LVAL (value) == lval_register)
@@ -1770,7 +1767,7 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
 	      wrap_here (" ");
 	      printf_filtered (" %s at ",
 			       gdbarch_register_name (gdbarch, i));
-	      fputs_filtered (paddress (gdbarch, addr), gdb_stdout);
+	      puts_filtered (paddress (gdbarch, addr));
 	      count++;
 	    }
 	}
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 0449b919974..ebe0e9433bf 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -3210,13 +3210,13 @@ list_overlays_command (const char *args, int from_tty)
 	      name = bfd_section_name (osect->the_bfd_section);
 
 	      printf_filtered ("Section %s, loaded at ", name);
-	      fputs_filtered (paddress (gdbarch, lma), gdb_stdout);
+	      puts_filtered (paddress (gdbarch, lma));
 	      puts_filtered (" - ");
-	      fputs_filtered (paddress (gdbarch, lma + size), gdb_stdout);
+	      puts_filtered (paddress (gdbarch, lma + size));
 	      printf_filtered (", mapped at ");
-	      fputs_filtered (paddress (gdbarch, vma), gdb_stdout);
+	      puts_filtered (paddress (gdbarch, vma));
 	      puts_filtered (" - ");
-	      fputs_filtered (paddress (gdbarch, vma + size), gdb_stdout);
+	      puts_filtered (paddress (gdbarch, vma + size));
 	      puts_filtered ("\n");
 
 	      nmapped++;
diff --git a/gdb/top.c b/gdb/top.c
index 07695f88fd4..9164cad0a6a 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -873,7 +873,7 @@ gdb_readline_no_editing (const char *prompt)
       /* Don't use a _filtered function here.  It causes the assumed
 	 character position to be off, since the newline we read from
 	 the user is not accounted for.  */
-      fputs_unfiltered (prompt, gdb_stdout);
+      puts_unfiltered (prompt);
       gdb_flush (gdb_stdout);
     }
 
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index dc5e7f141cf..01b66926a3d 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -2566,8 +2566,8 @@ info_scope_command (const char *args_in, int from_tty)
 		  printf_filtered ("constant bytes: ");
 		  if (SYMBOL_TYPE (sym))
 		    for (j = 0; j < TYPE_LENGTH (SYMBOL_TYPE (sym)); j++)
-		      fprintf_filtered (gdb_stdout, " %02x",
-					(unsigned) SYMBOL_VALUE_BYTES (sym)[j]);
+		      printf_filtered (" %02x",
+				       (unsigned) SYMBOL_VALUE_BYTES (sym)[j]);
 		  break;
 		case LOC_STATIC:
 		  printf_filtered ("in static storage at address ");
diff --git a/gdb/typeprint.c b/gdb/typeprint.c
index 2428aa2244f..806be82359e 100644
--- a/gdb/typeprint.c
+++ b/gdb/typeprint.c
@@ -554,7 +554,7 @@ whatis_exp (const char *exp, int show)
   if (flags.print_offsets
       && (type->code () == TYPE_CODE_STRUCT
 	  || type->code () == TYPE_CODE_UNION))
-    fprintf_filtered (gdb_stdout, "/* offset      |    size */  ");
+    printf_filtered ("/* offset      |    size */  ");
 
   printf_filtered ("type = ");
 
diff --git a/gdb/unittests/command-def-selftests.c b/gdb/unittests/command-def-selftests.c
index dc146a37b2d..1eaa5714db1 100644
--- a/gdb/unittests/command-def-selftests.c
+++ b/gdb/unittests/command-def-selftests.c
@@ -37,9 +37,8 @@ static unsigned int nr_failed_invariants;
 static void
 broken_doc_invariant (const char *prefix, const char *name, const char *msg)
 {
-  fprintf_filtered (gdb_stdout,
-		    "help doc broken invariant: command '%s%s' help doc %s\n",
-		    prefix, name, msg);
+  printf_filtered ("help doc broken invariant: command '%s%s' help doc %s\n",
+		   prefix, name, msg);
   nr_failed_invariants++;
 }
 
@@ -130,13 +129,12 @@ traverse_command_structure (struct cmd_list_element **list,
   auto dupl = lists.find (list);
   if (dupl != lists.end ())
     {
-      fprintf_filtered (gdb_stdout,
-			"list %p duplicated,"
-			" reachable via prefix '%s' and '%s'."
-			"  Duplicated list first command is '%s'\n",
-			list,
-			prefix, dupl->second,
-			(*list)->name);
+      printf_filtered ("list %p duplicated,"
+		       " reachable via prefix '%s' and '%s'."
+		       "  Duplicated list first command is '%s'\n",
+		       list,
+		       prefix, dupl->second,
+		       (*list)->name);
       nr_duplicates++;
       return;
     }
@@ -165,17 +163,15 @@ traverse_command_structure (struct cmd_list_element **list,
 	  || (prefixcmd == nullptr && *list != cmdlist))
 	{
 	  if (c->prefix == nullptr)
-	    fprintf_filtered (gdb_stdout,
-			      "list %p reachable via prefix '%s'."
-			      "  command '%s' has null prefixcmd\n",
-			      list,
-			      prefix, c->name);
+	    printf_filtered ("list %p reachable via prefix '%s'."
+			     "  command '%s' has null prefixcmd\n",
+			     list,
+			     prefix, c->name);
 	  else
-	    fprintf_filtered (gdb_stdout,
-			      "list %p reachable via prefix '%s'."
-			      "  command '%s' has a different prefixcmd\n",
-			      list,
-			      prefix, c->name);
+	    printf_filtered ("list %p reachable via prefix '%s'."
+			     "  command '%s' has a different prefixcmd\n",
+			     list,
+			     prefix, c->name);
 	  nr_invalid_prefixcmd++;
 	}
     }
diff --git a/gdb/utils.c b/gdb/utils.c
index 3ee2b5444df..1f3ceb28bf1 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -1586,13 +1586,13 @@ puts_filtered_tabular (char *string, int width, int right)
   gdb_assert (chars_per_line > 0);
   if (chars_per_line == UINT_MAX)
     {
-      fputs_filtered (string, gdb_stdout);
-      fputs_filtered ("\n", gdb_stdout);
+      puts_filtered (string);
+      puts_filtered ("\n");
       return;
     }
 
   if (((chars_printed - 1) / width + 2) * width >= chars_per_line)
-    fputs_filtered ("\n", gdb_stdout);
+    puts_filtered ("\n");
 
   if (width >= chars_per_line)
     width = chars_per_line - 1;
@@ -1609,8 +1609,8 @@ puts_filtered_tabular (char *string, int width, int right)
   while (spaces--)
     spacebuf[spaces] = ' ';
 
-  fputs_filtered (spacebuf, gdb_stdout);
-  fputs_filtered (string, gdb_stdout);
+  puts_filtered (spacebuf);
+  puts_filtered (string);
 }
 
 
-- 
2.31.1


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

* [PATCH 4/4] Always print the "host libthread-db" message to stdout
  2022-01-06 17:28 [PATCH 0/4] Audit uses of unfiltered output to gdb_stdout Tom Tromey
                   ` (2 preceding siblings ...)
  2022-01-06 17:28 ` [PATCH 3/4] Reduce explicit use of gdb_stdout Tom Tromey
@ 2022-01-06 17:28 ` Tom Tromey
  2022-01-07 16:49 ` [PATCH 0/4] Audit uses of unfiltered output to gdb_stdout Pedro Alves
  2022-01-25 22:11 ` Tom Tromey
  5 siblings, 0 replies; 10+ messages in thread
From: Tom Tromey @ 2022-01-06 17:28 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

linux-thread-db.c has a bit of unusual code that unconditionally
prints a message, but decides whether to print to gdb_stdout or
gdb_stdlog based on a debug flag.  It seems better to me to simply
always print this; and this is the only spot in gdb where we
conditionally pass gdb_stdout to one of the f*_unfiltered functions.
---
 gdb/linux-thread-db.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index a0cfeb1685b..18d313bf9be 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -940,21 +940,14 @@ try_thread_db_load_1 (struct thread_db_info *info)
 
   if (!libthread_db_search_path.empty () || libthread_db_debug)
     {
-      struct ui_file *file;
       const char *library;
 
       library = dladdr_to_soname ((const void *) *info->td_ta_new_p);
       if (library == NULL)
 	library = LIBTHREAD_DB_SO;
 
-      /* If we'd print this to gdb_stdout when debug output is
-	 disabled, still print it to gdb_stdout if debug output is
-	 enabled.  User visible output should not depend on debug
-	 settings.  */
-      file = !libthread_db_search_path.empty () ? gdb_stdout : gdb_stdlog;
-      fprintf_unfiltered (file,
-			  _("Using host libthread_db library \"%ps\".\n"),
-			  styled_string (file_name_style.style (), library));
+      printf_unfiltered (_("Using host libthread_db library \"%ps\".\n"),
+			 styled_string (file_name_style.style (), library));
     }
 
   /* The thread library was detected.  Activate the thread_db target
-- 
2.31.1


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

* Re: [PATCH 0/4] Audit uses of unfiltered output to gdb_stdout
  2022-01-06 17:28 [PATCH 0/4] Audit uses of unfiltered output to gdb_stdout Tom Tromey
                   ` (3 preceding siblings ...)
  2022-01-06 17:28 ` [PATCH 4/4] Always print the "host libthread-db" message to stdout Tom Tromey
@ 2022-01-07 16:49 ` Pedro Alves
  2022-01-07 22:18   ` Tom Tromey
  2022-01-25 22:11 ` Tom Tromey
  5 siblings, 1 reply; 10+ messages in thread
From: Pedro Alves @ 2022-01-07 16:49 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches

On 2022-01-06 17:28, Tom Tromey wrote:
> My belief is that some gdb output must be unfiltered -- in particular,
> I think infrun is probably not set up to handle a quit thrown from a
> paging prompt that was caused by some thread-event user notification.

Right, pagination using infrun event handling is disabled, with:

void
fetch_inferior_event ()
{
...
  /* Temporarily disable pagination.  Otherwise, the user would be
     given an option to press 'q' to quit, which would cause an early
     exit and could leave GDB in a half-baked state.  */
  scoped_restore save_pagination
    = make_scoped_restore (&pagination_enabled, false);

even without the quit issue, a pagination during run control event handling would
pause the inferior until the pagination prompt is responded to, which I don't
think would be desirable, at least by default.  It's actually egregious if the inferior
is running in the background (c&) and you're typing things, and then suddenly
GDB prints a breakpoint or thread event or some such and that causes a pagination unrelated
to the command you are typing.  If feels to me that output produced while handling
an event is of the "!from_tty" kind in this case.

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

* Re: [PATCH 0/4] Audit uses of unfiltered output to gdb_stdout
  2022-01-07 16:49 ` [PATCH 0/4] Audit uses of unfiltered output to gdb_stdout Pedro Alves
@ 2022-01-07 22:18   ` Tom Tromey
  2022-01-08 23:19     ` Tom Tromey
  0 siblings, 1 reply; 10+ messages in thread
From: Tom Tromey @ 2022-01-07 22:18 UTC (permalink / raw)
  To: Pedro Alves; +Cc: Tom Tromey, gdb-patches

>>>>> "Pedro" == Pedro Alves <pedro@palves.net> writes:

Pedro> On 2022-01-06 17:28, Tom Tromey wrote:
>> My belief is that some gdb output must be unfiltered -- in particular,
>> I think infrun is probably not set up to handle a quit thrown from a
>> paging prompt that was caused by some thread-event user notification.

Pedro> Right, pagination using infrun event handling is disabled, with:

Wow, I didn't know this existed.

This makes the whole analysis phase a lot easier, and I think it means I
can remove printf_unfiltered entirely.  The only other spot that truly
needs this is complete_command, and that can be fixed with this same
scoped_restore.

Tom

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

* Re: [PATCH 3/4] Reduce explicit use of gdb_stdout
  2022-01-06 17:28 ` [PATCH 3/4] Reduce explicit use of gdb_stdout Tom Tromey
@ 2022-01-08 16:57   ` Tom Tromey
  0 siblings, 0 replies; 10+ messages in thread
From: Tom Tromey @ 2022-01-08 16:57 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

>>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:

Tom> For auditing purposes -- that is, to make it easier to believe that
Tom> the forthcoming pager rewrite is correct -- it is best if the
Tom> necessary uses of unfiltered output use the stream-less forms like
Tom> printf_unfiltered, rather than fprintf_unfiltered.

With the infrun revelation from Pedro, this patch isn't strictly
necessary any more.  However, I think it is still a decent cleanup, so I
plan to leave it in the series -- but I will change the commit message.

Tom

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

* Re: [PATCH 0/4] Audit uses of unfiltered output to gdb_stdout
  2022-01-07 22:18   ` Tom Tromey
@ 2022-01-08 23:19     ` Tom Tromey
  0 siblings, 0 replies; 10+ messages in thread
From: Tom Tromey @ 2022-01-08 23:19 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Pedro Alves, gdb-patches

Tom> This makes the whole analysis phase a lot easier, and I think it means I
Tom> can remove printf_unfiltered entirely.  The only other spot that truly
Tom> needs this is complete_command, and that can be fixed with this same
Tom> scoped_restore.

I looked at this a bit more, and in the end I think I'll probably keep
printf_unfiltered around.  It's easy to fix complete_command, and infrun
takes care of itself, but there's also display_gdb_prompt and
gdb_readline_no_editing.  And, annotate.c currently mostly uses
_filtered, that seems pretty weird to me, and I think it would be better
to switch that code to _unfiltered.  (annotate is weird because
presumably the user also disables pagination -- did this used to be
automatic?  Emacs seems to page for me -- but this particular output
seems like it ought to be invisible.)

Anyway the burden of keeping it around is pretty low.  And it's easy
enough to remove it in the end if we decide to go that route.

Tom

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

* Re: [PATCH 0/4] Audit uses of unfiltered output to gdb_stdout
  2022-01-06 17:28 [PATCH 0/4] Audit uses of unfiltered output to gdb_stdout Tom Tromey
                   ` (4 preceding siblings ...)
  2022-01-07 16:49 ` [PATCH 0/4] Audit uses of unfiltered output to gdb_stdout Pedro Alves
@ 2022-01-25 22:11 ` Tom Tromey
  5 siblings, 0 replies; 10+ messages in thread
From: Tom Tromey @ 2022-01-25 22:11 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

>>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:

Tom> My belief is that some gdb output must be unfiltered -- in particular,
Tom> I think infrun is probably not set up to handle a quit thrown from a
Tom> paging prompt that was caused by some thread-event user notification.

Tom> However, many such calls aren't actually needed, or, if they are
Tom> needed, should be sent to either gdb_stderr or gdb_stdlog.

Tom> I went through all the text output in gdb, looking for unfiltered
Tom> output to gdb_stdout.  This series is the result.

I'm checking this in now.

Tom

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

end of thread, other threads:[~2022-01-25 22:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-06 17:28 [PATCH 0/4] Audit uses of unfiltered output to gdb_stdout Tom Tromey
2022-01-06 17:28 ` [PATCH 1/4] Send some error output to gdb_stderr Tom Tromey
2022-01-06 17:28 ` [PATCH 2/4] Sent timing stats to gdb_stdlog Tom Tromey
2022-01-06 17:28 ` [PATCH 3/4] Reduce explicit use of gdb_stdout Tom Tromey
2022-01-08 16:57   ` Tom Tromey
2022-01-06 17:28 ` [PATCH 4/4] Always print the "host libthread-db" message to stdout Tom Tromey
2022-01-07 16:49 ` [PATCH 0/4] Audit uses of unfiltered output to gdb_stdout Pedro Alves
2022-01-07 22:18   ` Tom Tromey
2022-01-08 23:19     ` Tom Tromey
2022-01-25 22:11 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).