From 887ae0cf2be5cb10d68b14f16df8faf666f4e43b Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 14 Sep 2024 15:07:17 -0600 Subject: Add line-number styling This patch adds separate styling for line numbers. That is, whenever gdb prints a source line number, it uses this style. v2 includes a change to ensure that %ps works in query. Reviewed-By: Eli Zaretskii Reviewed-by: Keith Seitz --- gdb/utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gdb/utils.c') diff --git a/gdb/utils.c b/gdb/utils.c index c503ff7..a1bf9e4 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -819,7 +819,9 @@ defaulted_query (const char *ctlstr, const char defchar, va_list args) } /* Format the question outside of the loop, to avoid reusing args. */ - std::string question = string_vprintf (ctlstr, args); + string_file tem (gdb_stdout->can_emit_style_escape ()); + gdb_vprintf (&tem, ctlstr, args); + std::string question = tem.release (); std::string prompt = string_printf (_("%s%s(%s or %s) %s"), annotation_level > 1 ? "\n\032\032pre-query\n" : "", -- cgit v1.1