diff options
author | Tom Tromey <tom@tromey.com> | 2021-12-20 09:40:14 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-12-20 09:43:04 -0700 |
commit | b0715493df19e5223251c5be0efc7f180aa0a5ff (patch) | |
tree | 74f76540d79a7f34a69096b96d0310412e529ae9 /gdb/utils.c | |
parent | dde238e063376f96d52ff27f11b31a447ddbdfea (diff) | |
download | gdb-b0715493df19e5223251c5be0efc7f180aa0a5ff.zip gdb-b0715493df19e5223251c5be0efc7f180aa0a5ff.tar.gz gdb-b0715493df19e5223251c5be0efc7f180aa0a5ff.tar.bz2 |
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 40e0b27177e747600d3ec186458fe0e482a1cf77
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.
Diffstat (limited to 'gdb/utils.c')
-rw-r--r-- | gdb/utils.c | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/gdb/utils.c b/gdb/utils.c index ea0f65c..7d27f9b 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -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, |