Remove puts_debug

I noticed that puts_debug isn't used in the tree.  git log tells me
that the last use was removed in 2015:

    commit 40e0b27177
    Author: Pedro Alves <palves@redhat.com>
    Date:   Mon Aug 24 15:40:26 2015 +0100

	Delete the remaining ROM monitor targets

... and this commit mentions that the code being removed here probably
hadn't worked for 6 years prior to that.

Based on this, I'm removing puts_debug.  I don't think it's useful.
Tested by rebuilding.
This commit is contained in:
Tom Tromey 2021-12-20 09:40:14 -07:00
parent dde238e063
commit b0715493df
2 changed files with 0 additions and 87 deletions

View file

@ -2041,91 +2041,6 @@ fputc_filtered (int c, struct ui_file *stream)
return c;
}
/* puts_debug is like fputs_unfiltered, except it prints special
characters in printable fashion. */
void
puts_debug (char *prefix, char *string, char *suffix)
{
int ch;
/* Print prefix and suffix after each line. */
static int new_line = 1;
static int return_p = 0;
static const char *prev_prefix = "";
static const char *prev_suffix = "";
if (*string == '\n')
return_p = 0;
/* If the prefix is changing, print the previous suffix, a new line,
and the new prefix. */
if ((return_p || (strcmp (prev_prefix, prefix) != 0)) && !new_line)
{
fputs_unfiltered (prev_suffix, gdb_stdlog);
fputs_unfiltered ("\n", gdb_stdlog);
fputs_unfiltered (prefix, gdb_stdlog);
}
/* Print prefix if we printed a newline during the previous call. */
if (new_line)
{
new_line = 0;
fputs_unfiltered (prefix, gdb_stdlog);
}
prev_prefix = prefix;
prev_suffix = suffix;
/* Output characters in a printable format. */
while ((ch = *string++) != '\0')
{
switch (ch)
{
default:
if (gdb_isprint (ch))
fputc_unfiltered (ch, gdb_stdlog);
else
fprintf_unfiltered (gdb_stdlog, "\\x%02x", ch & 0xff);
break;
case '\\':
fputs_unfiltered ("\\\\", gdb_stdlog);
break;
case '\b':
fputs_unfiltered ("\\b", gdb_stdlog);
break;
case '\f':
fputs_unfiltered ("\\f", gdb_stdlog);
break;
case '\n':
new_line = 1;
fputs_unfiltered ("\\n", gdb_stdlog);
break;
case '\r':
fputs_unfiltered ("\\r", gdb_stdlog);
break;
case '\t':
fputs_unfiltered ("\\t", gdb_stdlog);
break;
case '\v':
fputs_unfiltered ("\\v", gdb_stdlog);
break;
}
return_p = ch == '\r';
}
/* Print suffix if we printed a newline. */
if (new_line)
{
fputs_unfiltered (suffix, gdb_stdlog);
fputs_unfiltered ("\n", gdb_stdlog);
}
}
/* Print a variable number of ARGS using format FORMAT. If this
information is going to put the amount written (since the last call
to REINITIALIZE_MORE_FILTER or the last page break) over the page size,

View file

@ -447,8 +447,6 @@ extern void puts_unfiltered (const char *);
extern void puts_filtered_tabular (char *string, int width, int right);
extern void puts_debug (char *prefix, char *string, char *suffix);
extern void vprintf_filtered (const char *, va_list) ATTRIBUTE_PRINTF (1, 0);
extern void vfprintf_filtered (struct ui_file *, const char *, va_list)