diff options
Diffstat (limited to 'gdb/maint-test-options.c')
-rw-r--r-- | gdb/maint-test-options.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gdb/maint-test-options.c b/gdb/maint-test-options.c index 9d76817..25f609b 100644 --- a/gdb/maint-test-options.c +++ b/gdb/maint-test-options.c @@ -1,6 +1,6 @@ /* Maintenance commands for testing the options framework. - Copyright (C) 2019-2024 Free Software Foundation, Inc. + Copyright (C) 2019-2025 Free Software Foundation, Inc. This file is part of GDB. @@ -137,6 +137,7 @@ struct test_options_opts int pint_unl_opt = 0; std::string string_opt; std::string filename_opt; + ui_file_style::color color_opt { ui_file_style::MAGENTA }; test_options_opts () = default; @@ -149,7 +150,7 @@ struct test_options_opts gdb_printf (file, _("-flag %d -xx1 %d -xx2 %d -bool %d " "-enum %s -uint-unl %s -pint-unl %s -string '%s' " - "-filename '%s' -- %s\n"), + "-filename '%s' -color %s -- %s\n"), flag_opt, xx1_opt, xx2_opt, @@ -163,6 +164,7 @@ struct test_options_opts : plongest (pint_unl_opt)), string_opt.c_str (), filename_opt.c_str (), + color_opt.to_string ().c_str (), args); } }; @@ -245,6 +247,14 @@ static const gdb::option::option_def test_options_option_defs[] = { nullptr, /* show_cmd_cb */ N_("A filename option."), }, + + /* A color option. */ + gdb::option::color_option_def<test_options_opts> { + "color", + [] (test_options_opts *opts) { return &opts->color_opt; }, + nullptr, /* show_cmd_cb */ + N_("A color option."), + }, }; /* Create an option_def_group for the test_options_opts options, with |