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/cli/cli-style.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gdb/cli/cli-style.c') diff --git a/gdb/cli/cli-style.c b/gdb/cli/cli-style.c index 5928998..36a8bd9 100644 --- a/gdb/cli/cli-style.c +++ b/gdb/cli/cli-style.c @@ -126,6 +126,10 @@ cli_style_option disasm_comment_style ("comment", ui_file_style::WHITE, /* See cli-style.h. */ +cli_style_option line_number_style ("line-number", ui_file_style::DIM); + +/* See cli-style.h. */ + cli_style_option::cli_style_option (const char *name, ui_file_style::basic_color fg, ui_file_style::intensity intensity) @@ -529,6 +533,14 @@ then this style has no effect."), &style_disasm_show_list, false); + line_number_style.add_setshow_commands (no_class, _("\ +Line number display styling.\n\ +Configure colors and display intensity for line numbers\n\ +The \"line-number\" style is used when GDB displays line numbers\n\ +coming from your source code."), + &style_set_list, &style_show_list, + false); + /* Setup 'disassembler address' style and 'disassembler symbol' style, these are aliases for 'address' and 'function' styles respectively. */ add_alias_cmd ("address", address_prefix_cmds.set, no_class, 0, -- cgit v1.1