This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFC 5/8] Style locations when setting a breakpoint
- From: Tom Tromey <tom at tromey dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tom at tromey dot com>
- Date: Thu, 6 Sep 2018 15:13:00 -0600
- Subject: [RFC 5/8] Style locations when setting a breakpoint
- References: <20180906211303.11029-1-tom@tromey.com>
say_where does not use ui-out, so function and file names printed by
it were not styled. This patch changes say_where to use the low-level
style code directly.
---
gdb/breakpoint.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 4e7dac51574..62824351ed6 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -68,6 +68,7 @@
#include "format.h"
#include "thread-fsm.h"
#include "tid-parse.h"
+#include "cli/cli-style.h"
/* readline include files */
#include "readline/readline.h"
@@ -12203,9 +12204,14 @@ say_where (struct breakpoint *b)
/* If there is a single location, we can print the location
more nicely. */
if (b->loc->next == NULL)
- printf_filtered (": file %s, line %d.",
- symtab_to_filename_for_display (b->loc->symtab),
- b->loc->line_number);
+ {
+ puts_filtered (": file ");
+ set_output_style (gdb_stdout, file_name_style.style ());
+ puts_filtered (symtab_to_filename_for_display (b->loc->symtab));
+ set_output_style (gdb_stdout, ui_file_style ());
+ printf_filtered (", line %d.",
+ b->loc->line_number);
+ }
else
/* This is not ideal, but each location may have a
different file name, and this at least reflects the
--
2.13.6