From 80ae204359b707f2914132ed353d3cecbdb58b23 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 5 Sep 2018 12:12:19 -0600 Subject: Style variable names This adds style support for variable names. For the time being, this is only done in backtraces, not in ptype or print; those places do not use ui-out and so would need ad hoc changes. This also adds styling to the names printed for local variables in "backtrace full". This code does not use ui-out, so the styling is done using the low-level API. gdb/ChangeLog 2018-12-28 Tom Tromey * ui-out.h (enum class ui_out_style_kind) : New global. * stack.c (print_frame_arg): Style name. * printcmd.c (print_variable_and_value): Style variable name. * cli/cli-style.h (variable_name_style): Declare. * cli/cli-style.c (variable_name_style): New global. (_initialize_cli_style): Update. * cli-out.c (cli_ui_out::do_field_string): Update. gdb/testsuite/ChangeLog 2018-12-28 Tom Tromey * gdb.base/style.exp: Add test for variable names. --- gdb/cli-out.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gdb/cli-out.c') diff --git a/gdb/cli-out.c b/gdb/cli-out.c index 4b5fc17..e1005e1 100644 --- a/gdb/cli-out.c +++ b/gdb/cli-out.c @@ -173,6 +173,9 @@ cli_ui_out::do_field_string (int fldno, int width, ui_align align, case ui_out_style_kind::FUNCTION: fstyle = function_name_style.style (); break; + case ui_out_style_kind::VARIABLE: + fstyle = variable_name_style.style (); + break; default: gdb_assert_not_reached ("missing case"); } -- cgit v1.1