diff options
author | Tom Tromey <tom@tromey.com> | 2018-09-05 12:12:19 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-12-28 12:49:50 -0700 |
commit | 80ae204359b707f2914132ed353d3cecbdb58b23 (patch) | |
tree | 2a4f186210a4bf37fb70da090546abc2401cb34f /gdb/testsuite | |
parent | ef1dfa3644f02efffa11d718fe5788c05177587b (diff) | |
download | gdb-80ae204359b707f2914132ed353d3cecbdb58b23.zip gdb-80ae204359b707f2914132ed353d3cecbdb58b23.tar.gz gdb-80ae204359b707f2914132ed353d3cecbdb58b23.tar.bz2 |
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 <tom@tromey.com>
* ui-out.h (enum class ui_out_style_kind) <VARIABLE>: 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 <tom@tromey.com>
* gdb.base/style.exp: Add test for variable names.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/style.exp | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 6b3ca5a..d27272d 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2018-12-28 Tom Tromey <tom@tromey.com> + * gdb.base/style.exp: Add test for variable names. + +2018-12-28 Tom Tromey <tom@tromey.com> + * gdb.base/style.exp: New file. * gdb.base/style.c: New file. diff --git a/gdb/testsuite/gdb.base/style.exp b/gdb/testsuite/gdb.base/style.exp index 20b7b8c..df66e99 100644 --- a/gdb/testsuite/gdb.base/style.exp +++ b/gdb/testsuite/gdb.base/style.exp @@ -34,8 +34,9 @@ save_vars { env(TERM) } { set main_expr "\033\\\[33mmain\033\\\[m" set file_expr "\033\\\[32m.*style\\.c\033\\\[m:\[0-9\]" + set arg_expr "\033\\\[36marg.\033\\\[m" gdb_test "frame" \ - "$main_expr.*$file_expr.*" + "$main_expr.*$arg_expr.*$arg_expr.*$file_expr.*" gdb_test "info breakpoints" "$main_expr at $file_expr.*" } |