summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2019-06-07 12:23:48 -0600
committerTom Tromey <tromey@adacore.com>2019-06-07 12:27:52 -0600
commit8ffa2c8b1a75b6c98b744afe39e137edd29b98b9 (patch)
tree7d0ed4a2b27441346dae1ff22bffab6caed0c261
parentad89c4348a82c78beb4b590c50fdb8bf48919c24 (diff)
downloadbinutils-gdb-8ffa2c8b1a75b6c98b744afe39e137edd29b98b9.tar.gz
Switch more styled output to use %ps
-rw-r--r--gdb/breakpoint.c20
-rw-r--r--gdb/macrocmd.c6
-rw-r--r--gdb/printcmd.c5
3 files changed, 15 insertions, 16 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index c5d3ccab1eb..14ff32a68a0 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -12112,23 +12112,21 @@ say_where (struct breakpoint *b)
else
{
if (opts.addressprint || b->loc->symtab == NULL)
- {
- printf_filtered (" at ");
- fputs_styled (paddress (b->loc->gdbarch, b->loc->address),
- address_style.style (),
- gdb_stdout);
- }
+ printf_filtered (" at %ps",
+ styled_string (address_style.style (),
+ paddress (b->loc->gdbarch,
+ b->loc->address)).ptr ());
if (b->loc->symtab != NULL)
{
/* If there is a single location, we can print the location
more nicely. */
if (b->loc->next == NULL)
{
- puts_filtered (": file ");
- fputs_styled (symtab_to_filename_for_display (b->loc->symtab),
- file_name_style.style (),
- gdb_stdout);
- printf_filtered (", line %d.",
+ const char *filename
+ = symtab_to_filename_for_display (b->loc->symtab);
+ printf_filtered (": file %ps, line %d.",
+ styled_string (file_name_style.style (),
+ filename).ptr (),
b->loc->line_number);
}
else
diff --git a/gdb/macrocmd.c b/gdb/macrocmd.c
index 0f81c3d5da4..0f1f239c5a5 100644
--- a/gdb/macrocmd.c
+++ b/gdb/macrocmd.c
@@ -120,8 +120,10 @@ show_pp_source_pos (struct ui_file *stream,
int line)
{
std::string fullname = macro_source_fullname (file);
- fputs_styled (fullname.c_str (), file_name_style.style (), stream);
- fprintf_filtered (stream, ":%d\n", line);
+ fprintf_filtered (stream, "%ps:%d\n",
+ styled_string (file_name_style.style (),
+ fullname.c_str ()).ptr (),
+ line);
while (file->included_by)
{
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 0509360581e..0aa9ac07819 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -2189,9 +2189,8 @@ print_variable_and_value (const char *name, struct symbol *var,
if (!name)
name = SYMBOL_PRINT_NAME (var);
- fputs_filtered (n_spaces (2 * indent), stream);
- fputs_styled (name, variable_name_style.style (), stream);
- fputs_filtered (" = ", stream);
+ fprintf_filtered (stream, "%s%ps = ", n_spaces (2 * indent),
+ styled_string (variable_name_style.style (), name).ptr ());
try
{