diff options
Diffstat (limited to 'gdb/cli/cli-style.c')
-rw-r--r-- | gdb/cli/cli-style.c | 56 |
1 files changed, 50 insertions, 6 deletions
diff --git a/gdb/cli/cli-style.c b/gdb/cli/cli-style.c index 2fd00e9cc3e..3fd85f4aa86 100644 --- a/gdb/cli/cli-style.c +++ b/gdb/cli/cli-style.c @@ -38,6 +38,11 @@ bool cli_styling = true; bool source_styling = true; +/* True if disassembler styling is enabled. Note that this is only + consulted when cli_styling is true. */ + +bool disassembler_styling = true; + /* Name of colors; must correspond to ui_file_style::basic_color. */ static const char * const cli_colors[] = { "none", @@ -182,9 +187,9 @@ do_show (const char *what, struct ui_file *file, const char *value) { cli_style_option *cso = (cli_style_option *) cmd->context (); - fputs_filtered (_("The "), file); + gdb_puts (_("The "), file); fprintf_styled (file, cso->style (), _("\"%s\" style"), cso->name ()); - fprintf_filtered (file, _(" %s is: %s\n"), what, value); + gdb_printf (file, _(" %s is: %s\n"), what, value); } /* See cli-style.h. */ @@ -274,6 +279,14 @@ cli_style_option::add_setshow_commands (enum command_class theclass, static cmd_list_element *style_set_list; static cmd_list_element *style_show_list; +/* The command list for 'set style disassembler'. */ + +static cmd_list_element *style_disasm_set_list; + +/* The command list for 'show style disassembler'. */ + +static cmd_list_element *style_disasm_show_list; + static void set_style_enabled (const char *args, int from_tty, struct cmd_list_element *c) { @@ -286,9 +299,9 @@ show_style_enabled (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) { if (cli_styling) - fprintf_filtered (file, _("CLI output styling is enabled.\n")); + gdb_printf (file, _("CLI output styling is enabled.\n")); else - fprintf_filtered (file, _("CLI output styling is disabled.\n")); + gdb_printf (file, _("CLI output styling is disabled.\n")); } static void @@ -296,9 +309,21 @@ show_style_sources (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) { if (source_styling) - fprintf_filtered (file, _("Source code styling is enabled.\n")); + gdb_printf (file, _("Source code styling is enabled.\n")); + else + gdb_printf (file, _("Source code styling is disabled.\n")); +} + +/* Implement 'show style disassembler'. */ + +static void +show_style_disassembler (struct ui_file *file, int from_tty, + struct cmd_list_element *c, const char *value) +{ + if (disassembler_styling) + gdb_printf (file, _("Disassembler output styling is enabled.\n")); else - fprintf_filtered (file, _("Source code styling is disabled.\n")); + gdb_printf (file, _("Disassembler output styling is disabled.\n")); } void _initialize_cli_style (); @@ -337,6 +362,25 @@ available if the appropriate extension is available at runtime." ), set_style_enabled, show_style_sources, &style_set_list, &style_show_list); + add_setshow_prefix_cmd ("disassembler", no_class, + _("\ +Style-specific settings for the disassembler.\n\ +Configure various disassembler style-related variables."), + _("\ +Style-specific settings for the disassembler.\n\ +Configure various disassembler style-related variables."), + &style_disasm_set_list, &style_disasm_show_list, + &style_set_list, &style_show_list); + + add_setshow_boolean_cmd ("enabled", no_class, &disassembler_styling, _("\ +Set whether disassembler output styling is enabled."), _("\ +Show whether disassembler output styling is enabled."), _("\ +If enabled, disassembler output is styled. Disassembler highlighting\n\ +requires the Python Pygments library, if this library is not available\n\ +then disassembler highlighting will not be possible." + ), set_style_enabled, show_style_disassembler, + &style_disasm_set_list, &style_disasm_show_list); + file_name_style.add_setshow_commands (no_class, _("\ Filename display styling.\n\ Configure filename colors and display intensity."), |