aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli/cli-style.h
diff options
context:
space:
mode:
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>2019-05-31 13:47:37 +0200
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>2019-06-03 21:59:11 +0200
commit9303eb2fb1630678def10613c81215c2bd21d278 (patch)
treea2282608bb0422631678012ddfe7ee36c1c1fef4 /gdb/cli/cli-style.h
parent79b377b3cf3a0e71e1e4710c4ee1e65e7a27a5d4 (diff)
downloadgdb-9303eb2fb1630678def10613c81215c2bd21d278.zip
gdb-9303eb2fb1630678def10613c81215c2bd21d278.tar.gz
gdb-9303eb2fb1630678def10613c81215c2bd21d278.tar.bz2
Add highlight style, title style, fputs_highlighted. Improve 'show style'
Have 'show style' and its subcommands using a style to style its output. This allows the GDB user or developer to use 'show style' to visually see with one command how all the current styles look like. Add 2 new styles highlight style, title style and fputs_highlighted function. Highlight style is used by fputs_highlighted to highlight the parts of its char *STR argument that match a HIGHLIGHT regexp. This (and the title style) will be used in a following patch.
Diffstat (limited to 'gdb/cli/cli-style.h')
-rw-r--r--gdb/cli/cli-style.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/gdb/cli/cli-style.h b/gdb/cli/cli-style.h
index c0520f9..6ae265e 100644
--- a/gdb/cli/cli-style.h
+++ b/gdb/cli/cli-style.h
@@ -28,15 +28,20 @@ class cli_style_option
public:
/* Construct a CLI style option with a foreground color. */
- cli_style_option (ui_file_style::basic_color fg);
+ cli_style_option (const char *name, ui_file_style::basic_color fg);
+
+ /* Construct a CLI style option with an intensity. */
+ cli_style_option (const char *name, ui_file_style::intensity i);
/* Return a ui_file_style corresponding to the settings in this CLI
style. */
ui_file_style style () const;
+ /* Return the style name. */
+ const char *name () { return m_name; };
+
/* Call once to register this CLI style with the CLI engine. */
- void add_setshow_commands (const char *name,
- enum command_class theclass,
+ void add_setshow_commands (enum command_class theclass,
const char *prefix_doc,
struct cmd_list_element **set_list,
void (*do_set) (const char *args, int from_tty),
@@ -52,6 +57,9 @@ public:
private:
+ /* The style name. */
+ const char *m_name;
+
/* The foreground. */
const char *m_foreground;
/* The background. */
@@ -93,6 +101,13 @@ extern cli_style_option variable_name_style;
/* The address style. */
extern cli_style_option address_style;
+/* The highlight style. */
+extern cli_style_option highlight_style;
+
+/* The title style. */
+extern cli_style_option title_style;
+
+
/* True if source styling is enabled. */
extern int source_styling;