aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli/cli-style.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/cli/cli-style.c')
-rw-r--r--gdb/cli/cli-style.c107
1 files changed, 98 insertions, 9 deletions
diff --git a/gdb/cli/cli-style.c b/gdb/cli/cli-style.c
index 3fd85f4..abf6855 100644
--- a/gdb/cli/cli-style.c
+++ b/gdb/cli/cli-style.c
@@ -110,6 +110,23 @@ cli_style_option version_style ("version", ui_file_style::MAGENTA,
/* See cli-style.h. */
+cli_style_option disasm_mnemonic_style ("mnemonic", ui_file_style::GREEN);
+
+/* See cli-style.h. */
+
+cli_style_option disasm_register_style ("register", ui_file_style::RED);
+
+/* See cli-style.h. */
+
+cli_style_option disasm_immediate_style ("immediate", ui_file_style::BLUE);
+
+/* See cli-style.h. */
+
+cli_style_option disasm_comment_style ("comment", ui_file_style::WHITE,
+ 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)
@@ -224,15 +241,16 @@ cli_style_option::do_show_intensity (struct ui_file *file, int from_tty,
/* See cli-style.h. */
-void
+set_show_commands
cli_style_option::add_setshow_commands (enum command_class theclass,
const char *prefix_doc,
struct cmd_list_element **set_list,
struct cmd_list_element **show_list,
bool skip_intensity)
{
- add_setshow_prefix_cmd (m_name, theclass, prefix_doc, prefix_doc,
- &m_set_list, &m_show_list, set_list, show_list);
+ set_show_commands prefix_cmds
+ = add_setshow_prefix_cmd (m_name, theclass, prefix_doc, prefix_doc,
+ &m_set_list, &m_show_list, set_list, show_list);
set_show_commands commands;
@@ -274,6 +292,8 @@ cli_style_option::add_setshow_commands (enum command_class theclass,
commands.set->set_context (this);
commands.show->set_context (this);
}
+
+ return prefix_cmds;
}
static cmd_list_element *style_set_list;
@@ -387,11 +407,13 @@ Configure filename colors and display intensity."),
&style_set_list, &style_show_list,
false);
- function_name_style.add_setshow_commands (no_class, _("\
+ set_show_commands function_prefix_cmds
+ = function_name_style.add_setshow_commands (no_class, _("\
Function name display styling.\n\
Configure function name colors and display intensity"),
- &style_set_list, &style_show_list,
- false);
+ &style_set_list,
+ &style_show_list,
+ false);
variable_name_style.add_setshow_commands (no_class, _("\
Variable name display styling.\n\
@@ -399,11 +421,12 @@ Configure variable name colors and display intensity"),
&style_set_list, &style_show_list,
false);
- address_style.add_setshow_commands (no_class, _("\
+ set_show_commands address_prefix_cmds
+ = address_style.add_setshow_commands (no_class, _("\
Address display styling.\n\
Configure address colors and display intensity"),
- &style_set_list, &style_show_list,
- false);
+ &style_set_list, &style_show_list,
+ false);
title_style.add_setshow_commands (no_class, _("\
Title display styling.\n\
@@ -451,4 +474,70 @@ Version string display styling.\n\
Configure colors used to display the GDB version string."),
&style_set_list, &style_show_list,
false);
+
+ disasm_mnemonic_style.add_setshow_commands (no_class, _("\
+Disassembler mnemonic display styling.\n\
+Configure the colors and display intensity for instruction mnemonics\n\
+in the disassembler output. The \"disassembler mnemonic\" style is\n\
+used to display instruction mnemonics as well as any assembler\n\
+directives, e.g. \".byte\", \".word\", etc.\n\
+\n\
+This style will only be used for targets that support libopcodes based\n\
+disassembler styling. When Python Pygments based styling is used\n\
+then this style has no effect."),
+ &style_disasm_set_list,
+ &style_disasm_show_list,
+ false);
+
+ disasm_register_style.add_setshow_commands (no_class, _("\
+Disassembler register display styling.\n\
+Configure the colors and display intensity for registers in the\n\
+disassembler output.\n\
+\n\
+This style will only be used for targets that support libopcodes based\n\
+disassembler styling. When Python Pygments based styling is used\n\
+then this style has no effect."),
+ &style_disasm_set_list,
+ &style_disasm_show_list,
+ false);
+
+ disasm_immediate_style.add_setshow_commands (no_class, _("\
+Disassembler immediate display styling.\n\
+Configure the colors and display intensity for immediates in the\n\
+disassembler output. The \"disassembler immediate\" style is used for\n\
+any number that is not an address, this includes constants in arithmetic\n\
+instructions, as well as address offsets in memory access instructions.\n\
+\n\
+This style will only be used for targets that support libopcodes based\n\
+disassembler styling. When Python Pygments based styling is used\n\
+then this style has no effect."),
+ &style_disasm_set_list,
+ &style_disasm_show_list,
+ false);
+
+ disasm_comment_style.add_setshow_commands (no_class, _("\
+Disassembler comment display styling.\n\
+Configure the colors and display intensity for comments in the\n\
+disassembler output. The \"disassembler comment\" style is used for\n\
+the comment character, and everything after the comment character up to\n\
+the end of the line. The comment style overrides any other styling,\n\
+e.g. a register name in a comment will use the comment styling.\n\
+\n\
+This style will only be used for targets that support libopcodes based\n\
+disassembler styling. When Python Pygments based styling is used\n\
+then this style has no effect."),
+ &style_disasm_set_list,
+ &style_disasm_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,
+ &style_disasm_set_list);
+ add_alias_cmd ("address", address_prefix_cmds.show, no_class, 0,
+ &style_disasm_show_list);
+ add_alias_cmd ("symbol", function_prefix_cmds.set, no_class, 0,
+ &style_disasm_set_list);
+ add_alias_cmd ("symbol", function_prefix_cmds.show, no_class, 0,
+ &style_disasm_show_list);
}