Only have one API for unfiltered output

At the end of this series, the use of unfiltered output will be very
restricted -- only places that definitely need it will use it.  To
this end, I thought it would be good to reduce the number of
_unfiltered APIs that are exposed.  This patch changes gdb so that
only printf_unfiltered exists.  (After this patch, the f* variants
still exist as well, but those will be removed later.)
This commit is contained in:
Tom Tromey 2022-01-01 12:18:47 -07:00
parent 830df12588
commit dcf1a2c8d2
4 changed files with 3 additions and 27 deletions

View file

@ -673,11 +673,7 @@ handle_line_of_input (struct buffer *cmd_line_buffer,
cmd_line_buffer->used_size = 0; cmd_line_buffer->used_size = 0;
if (from_tty && annotation_level > 1) if (from_tty && annotation_level > 1)
{ printf_unfiltered (("\n\032\032post-%s\n"), annotation_suffix);
printf_unfiltered (("\n\032\032post-"));
puts_unfiltered (annotation_suffix);
printf_unfiltered (("\n"));
}
#define SERVER_COMMAND_PREFIX "server " #define SERVER_COMMAND_PREFIX "server "
server_command = startswith (cmd, SERVER_COMMAND_PREFIX); server_command = startswith (cmd, SERVER_COMMAND_PREFIX);

View file

@ -866,7 +866,7 @@ gdb_readline_no_editing (const char *prompt)
/* Don't use a _filtered function here. It causes the assumed /* Don't use a _filtered function here. It causes the assumed
character position to be off, since the newline we read from character position to be off, since the newline we read from
the user is not accounted for. */ the user is not accounted for. */
puts_unfiltered (prompt); printf_unfiltered ("%s", prompt);
gdb_flush (gdb_stdout); gdb_flush (gdb_stdout);
} }
@ -1365,11 +1365,7 @@ command_line_input (const char *prompt_arg, const char *annotation_suffix)
++source_line_number; ++source_line_number;
if (from_tty && annotation_level > 1) if (from_tty && annotation_level > 1)
{ printf_unfiltered ("\n\032\032pre-%s\n", annotation_suffix);
puts_unfiltered ("\n\032\032pre-");
puts_unfiltered (annotation_suffix);
puts_unfiltered ("\n");
}
/* Don't use fancy stuff if not talking to stdin. */ /* Don't use fancy stuff if not talking to stdin. */
if (deprecated_readline_hook if (deprecated_readline_hook

View file

@ -1868,12 +1868,6 @@ fputs_highlighted (const char *str, const compiled_regex &highlight,
fputs_filtered (str, stream); fputs_filtered (str, stream);
} }
int
putchar_unfiltered (int c)
{
return fputc_unfiltered (c, gdb_stdout);
}
/* Write character C to gdb_stdout using GDB's paging mechanism and return C. /* Write character C to gdb_stdout using GDB's paging mechanism and return C.
May return nonlocally. */ May return nonlocally. */
@ -2046,12 +2040,6 @@ puts_filtered (const char *string)
fputs_filtered (string, gdb_stdout); fputs_filtered (string, gdb_stdout);
} }
void
puts_unfiltered (const char *string)
{
fputs_unfiltered (string, gdb_stdout);
}
/* Return a pointer to N spaces and a null. The pointer is good /* Return a pointer to N spaces and a null. The pointer is good
until the next call to here. */ until the next call to here. */
const char * const char *

View file

@ -243,12 +243,8 @@ extern int fputc_unfiltered (int c, struct ui_file *);
extern int putchar_filtered (int c); extern int putchar_filtered (int c);
extern int putchar_unfiltered (int c);
extern void puts_filtered (const char *); extern void puts_filtered (const char *);
extern void puts_unfiltered (const char *);
extern void puts_filtered_tabular (char *string, int width, int right); extern void puts_filtered_tabular (char *string, int width, int right);
extern void vprintf_filtered (const char *, va_list) ATTRIBUTE_PRINTF (1, 0); extern void vprintf_filtered (const char *, va_list) ATTRIBUTE_PRINTF (1, 0);