diff options
author | Tom Tromey <tom@tromey.com> | 2022-01-02 11:36:44 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2022-03-29 12:46:24 -0600 |
commit | 0426ad513f93bb1c5805988e60d6f87fbe738860 (patch) | |
tree | 6ad0f94f9b2a907623df38db9dd7727fe80f5d51 /gdb/printcmd.c | |
parent | 19a7b8ab871b92dee32a0ebffe274388d3426564 (diff) | |
download | gdb-0426ad513f93bb1c5805988e60d6f87fbe738860.zip gdb-0426ad513f93bb1c5805988e60d6f87fbe738860.tar.gz gdb-0426ad513f93bb1c5805988e60d6f87fbe738860.tar.bz2 |
Unify gdb puts functions
Now that filtered and unfiltered output can be treated identically, we
can unify the puts family of functions. This is done under the name
"gdb_puts". Most of this patch was written by script.
Diffstat (limited to 'gdb/printcmd.c')
-rw-r--r-- | gdb/printcmd.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 00a37b2..d142408 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -562,11 +562,11 @@ print_address_symbolic (struct gdbarch *gdbarch, CORE_ADDR addr, &offset, &filename, &line, &unmapped)) return 0; - fputs_filtered (leadin, stream); + gdb_puts (leadin, stream); if (unmapped) - fputs_filtered ("<*", stream); + gdb_puts ("<*", stream); else - fputs_filtered ("<", stream); + gdb_puts ("<", stream); fputs_styled (name.c_str (), function_name_style.style (), stream); if (offset != 0) fprintf_filtered (stream, "%+d", offset); @@ -575,15 +575,15 @@ print_address_symbolic (struct gdbarch *gdbarch, CORE_ADDR addr, line # of this addr, if we have it; else line # of the nearest symbol. */ if (print_symbol_filename && !filename.empty ()) { - fputs_filtered (line == -1 ? " in " : " at ", stream); + gdb_puts (line == -1 ? " in " : " at ", stream); fputs_styled (filename.c_str (), file_name_style.style (), stream); if (line != -1) fprintf_filtered (stream, ":%d", line); } if (unmapped) - fputs_filtered ("*>", stream); + gdb_puts ("*>", stream); else - fputs_filtered (">", stream); + gdb_puts (">", stream); return 1; } @@ -1150,7 +1150,7 @@ do_examine (struct format_data fmt, struct gdbarch *gdbarch, CORE_ADDR addr) } if (format == 'i') - puts_filtered (pc_prefix (next_address)); + gdb_puts (pc_prefix (next_address)); print_address (next_gdbarch, next_address, gdb_stdout); printf_filtered (":"); for (i = maxelts; @@ -1678,7 +1678,7 @@ info_address_command (const char *exp, int from_tty) } printf_filtered ("Symbol \""); - puts_filtered (sym->print_name ()); + gdb_puts (sym->print_name ()); printf_filtered ("\" is "); val = SYMBOL_VALUE (sym); if (sym->is_objfile_owned ()) @@ -2156,7 +2156,7 @@ do_one_display (struct display *d) annotate_display_expression (); - puts_filtered (d->exp_string.c_str ()); + gdb_puts (d->exp_string.c_str ()); annotate_display_expression_end (); if (d->format.count != 1 || d->format.format == 'i') @@ -2195,7 +2195,7 @@ do_one_display (struct display *d) annotate_display_expression (); - puts_filtered (d->exp_string.c_str ()); + gdb_puts (d->exp_string.c_str ()); annotate_display_expression_end (); printf_filtered (" = "); @@ -2282,7 +2282,7 @@ Num Enb Expression\n")); d->format.format); else if (d->format.format) printf_filtered ("/%c ", d->format.format); - puts_filtered (d->exp_string.c_str ()); + gdb_puts (d->exp_string.c_str ()); if (d->block && !contained_in (get_selected_block (0), d->block, true)) printf_filtered (_(" (cannot be evaluated in the current context)")); printf_filtered ("\n"); @@ -2624,7 +2624,7 @@ printf_floating (struct ui_file *stream, const char *format, /* Convert the value to a string and print it. */ std::string str = target_float_to_string (value_contents (value).data (), fmt_type, format); - fputs_filtered (str.c_str (), stream); + gdb_puts (str.c_str (), stream); } /* Subroutine of ui_printf to simplify it. @@ -2862,7 +2862,7 @@ ui_printf (const char *arg, struct ui_file *stream) /* Print a portion of the format string that has no directives. Note that this will not include any ordinary %-specs, but it might include "%%". That is - why we use printf_filtered and not puts_filtered here. + why we use printf_filtered and not gdb_puts here. Also, we pass a dummy argument because some platforms have modified GCC to include -Wformat-security by default, which will warn here if there is no |