cli-style.c revision 1.1.1.4 1 1.1 christos /* CLI colorizing
2 1.1 christos
3 1.1.1.4 christos Copyright (C) 2018-2024 Free Software Foundation, Inc.
4 1.1 christos
5 1.1 christos This file is part of GDB.
6 1.1 christos
7 1.1 christos This program is free software; you can redistribute it and/or modify
8 1.1 christos it under the terms of the GNU General Public License as published by
9 1.1 christos the Free Software Foundation; either version 3 of the License, or
10 1.1 christos (at your option) any later version.
11 1.1 christos
12 1.1 christos This program is distributed in the hope that it will be useful,
13 1.1 christos but WITHOUT ANY WARRANTY; without even the implied warranty of
14 1.1 christos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 1.1 christos GNU General Public License for more details.
16 1.1 christos
17 1.1 christos You should have received a copy of the GNU General Public License
18 1.1 christos along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 1.1 christos
20 1.1 christos #include "cli/cli-cmds.h"
21 1.1.1.3 christos #include "cli/cli-decode.h"
22 1.1.1.3 christos #include "cli/cli-setshow.h"
23 1.1 christos #include "cli/cli-style.h"
24 1.1 christos #include "source-cache.h"
25 1.1 christos #include "observable.h"
26 1.1 christos
27 1.1 christos /* True if styling is enabled. */
28 1.1 christos
29 1.1.1.2 christos #if defined (__MSDOS__)
30 1.1.1.2 christos bool cli_styling = false;
31 1.1 christos #else
32 1.1.1.2 christos bool cli_styling = true;
33 1.1 christos #endif
34 1.1 christos
35 1.1 christos /* True if source styling is enabled. Note that this is only
36 1.1 christos consulted when cli_styling is true. */
37 1.1 christos
38 1.1.1.2 christos bool source_styling = true;
39 1.1 christos
40 1.1.1.3 christos /* True if disassembler styling is enabled. Note that this is only
41 1.1.1.3 christos consulted when cli_styling is true. */
42 1.1.1.3 christos
43 1.1.1.3 christos bool disassembler_styling = true;
44 1.1.1.3 christos
45 1.1 christos /* Name of colors; must correspond to ui_file_style::basic_color. */
46 1.1 christos static const char * const cli_colors[] = {
47 1.1 christos "none",
48 1.1 christos "black",
49 1.1 christos "red",
50 1.1 christos "green",
51 1.1 christos "yellow",
52 1.1 christos "blue",
53 1.1 christos "magenta",
54 1.1 christos "cyan",
55 1.1 christos "white",
56 1.1 christos nullptr
57 1.1 christos };
58 1.1 christos
59 1.1 christos /* Names of intensities; must correspond to
60 1.1 christos ui_file_style::intensity. */
61 1.1 christos static const char * const cli_intensities[] = {
62 1.1 christos "normal",
63 1.1 christos "bold",
64 1.1 christos "dim",
65 1.1 christos nullptr
66 1.1 christos };
67 1.1 christos
68 1.1 christos /* See cli-style.h. */
69 1.1 christos
70 1.1.1.2 christos cli_style_option file_name_style ("filename", ui_file_style::GREEN);
71 1.1 christos
72 1.1 christos /* See cli-style.h. */
73 1.1 christos
74 1.1.1.2 christos cli_style_option function_name_style ("function", ui_file_style::YELLOW);
75 1.1 christos
76 1.1 christos /* See cli-style.h. */
77 1.1 christos
78 1.1.1.2 christos cli_style_option variable_name_style ("variable", ui_file_style::CYAN);
79 1.1 christos
80 1.1 christos /* See cli-style.h. */
81 1.1 christos
82 1.1.1.2 christos cli_style_option address_style ("address", ui_file_style::BLUE);
83 1.1 christos
84 1.1 christos /* See cli-style.h. */
85 1.1 christos
86 1.1.1.2 christos cli_style_option highlight_style ("highlight", ui_file_style::RED);
87 1.1.1.2 christos
88 1.1.1.2 christos /* See cli-style.h. */
89 1.1.1.2 christos
90 1.1.1.2 christos cli_style_option title_style ("title", ui_file_style::BOLD);
91 1.1.1.2 christos
92 1.1.1.2 christos /* See cli-style.h. */
93 1.1.1.2 christos
94 1.1.1.2 christos cli_style_option tui_border_style ("tui-border", ui_file_style::CYAN);
95 1.1.1.2 christos
96 1.1.1.2 christos /* See cli-style.h. */
97 1.1.1.2 christos
98 1.1.1.2 christos cli_style_option tui_active_border_style ("tui-active-border",
99 1.1.1.2 christos ui_file_style::CYAN);
100 1.1.1.2 christos
101 1.1.1.2 christos /* See cli-style.h. */
102 1.1.1.2 christos
103 1.1.1.2 christos cli_style_option metadata_style ("metadata", ui_file_style::DIM);
104 1.1.1.2 christos
105 1.1.1.2 christos /* See cli-style.h. */
106 1.1.1.2 christos
107 1.1.1.3 christos cli_style_option version_style ("version", ui_file_style::MAGENTA,
108 1.1.1.3 christos ui_file_style::BOLD);
109 1.1.1.3 christos
110 1.1.1.3 christos /* See cli-style.h. */
111 1.1.1.3 christos
112 1.1.1.3 christos cli_style_option disasm_mnemonic_style ("mnemonic", ui_file_style::GREEN);
113 1.1.1.3 christos
114 1.1.1.3 christos /* See cli-style.h. */
115 1.1.1.3 christos
116 1.1.1.3 christos cli_style_option disasm_register_style ("register", ui_file_style::RED);
117 1.1.1.3 christos
118 1.1.1.3 christos /* See cli-style.h. */
119 1.1.1.3 christos
120 1.1.1.3 christos cli_style_option disasm_immediate_style ("immediate", ui_file_style::BLUE);
121 1.1.1.3 christos
122 1.1.1.3 christos /* See cli-style.h. */
123 1.1.1.3 christos
124 1.1.1.3 christos cli_style_option disasm_comment_style ("comment", ui_file_style::WHITE,
125 1.1.1.3 christos ui_file_style::DIM);
126 1.1.1.3 christos
127 1.1.1.3 christos /* See cli-style.h. */
128 1.1.1.3 christos
129 1.1.1.2 christos cli_style_option::cli_style_option (const char *name,
130 1.1.1.3 christos ui_file_style::basic_color fg,
131 1.1.1.3 christos ui_file_style::intensity intensity)
132 1.1.1.2 christos : changed (name),
133 1.1.1.2 christos m_name (name),
134 1.1.1.2 christos m_foreground (cli_colors[fg - ui_file_style::NONE]),
135 1.1 christos m_background (cli_colors[0]),
136 1.1.1.3 christos m_intensity (cli_intensities[intensity])
137 1.1 christos {
138 1.1 christos }
139 1.1 christos
140 1.1.1.2 christos /* See cli-style.h. */
141 1.1.1.2 christos
142 1.1.1.2 christos cli_style_option::cli_style_option (const char *name,
143 1.1.1.2 christos ui_file_style::intensity i)
144 1.1.1.2 christos : changed (name),
145 1.1.1.2 christos m_name (name),
146 1.1.1.2 christos m_foreground (cli_colors[0]),
147 1.1.1.2 christos m_background (cli_colors[0]),
148 1.1.1.2 christos m_intensity (cli_intensities[i])
149 1.1.1.2 christos {
150 1.1.1.2 christos }
151 1.1.1.2 christos
152 1.1 christos /* Return the color number corresponding to COLOR. */
153 1.1 christos
154 1.1 christos static int
155 1.1 christos color_number (const char *color)
156 1.1 christos {
157 1.1 christos for (int i = 0; i < ARRAY_SIZE (cli_colors); ++i)
158 1.1 christos {
159 1.1 christos if (color == cli_colors[i])
160 1.1 christos return i - 1;
161 1.1 christos }
162 1.1 christos gdb_assert_not_reached ("color not found");
163 1.1 christos }
164 1.1 christos
165 1.1 christos /* See cli-style.h. */
166 1.1 christos
167 1.1 christos ui_file_style
168 1.1 christos cli_style_option::style () const
169 1.1 christos {
170 1.1 christos int fg = color_number (m_foreground);
171 1.1 christos int bg = color_number (m_background);
172 1.1 christos ui_file_style::intensity intensity = ui_file_style::NORMAL;
173 1.1 christos
174 1.1 christos for (int i = 0; i < ARRAY_SIZE (cli_intensities); ++i)
175 1.1 christos {
176 1.1 christos if (m_intensity == cli_intensities[i])
177 1.1 christos {
178 1.1 christos intensity = (ui_file_style::intensity) i;
179 1.1 christos break;
180 1.1 christos }
181 1.1 christos }
182 1.1 christos
183 1.1 christos return ui_file_style (fg, bg, intensity);
184 1.1 christos }
185 1.1 christos
186 1.1 christos /* See cli-style.h. */
187 1.1 christos
188 1.1 christos void
189 1.1.1.2 christos cli_style_option::do_set_value (const char *ignore, int from_tty,
190 1.1.1.2 christos struct cmd_list_element *cmd)
191 1.1.1.2 christos {
192 1.1.1.3 christos cli_style_option *cso = (cli_style_option *) cmd->context ();
193 1.1.1.2 christos cso->changed.notify ();
194 1.1.1.2 christos }
195 1.1.1.2 christos
196 1.1.1.2 christos /* Implements the cli_style_option::do_show_* functions.
197 1.1.1.2 christos WHAT and VALUE are the property and value to show.
198 1.1.1.2 christos The style for which WHAT is shown is retrieved from CMD context. */
199 1.1.1.2 christos
200 1.1.1.2 christos static void
201 1.1.1.2 christos do_show (const char *what, struct ui_file *file,
202 1.1.1.2 christos struct cmd_list_element *cmd,
203 1.1.1.2 christos const char *value)
204 1.1.1.2 christos {
205 1.1.1.3 christos cli_style_option *cso = (cli_style_option *) cmd->context ();
206 1.1.1.3 christos gdb_puts (_("The "), file);
207 1.1.1.2 christos fprintf_styled (file, cso->style (), _("\"%s\" style"), cso->name ());
208 1.1.1.3 christos gdb_printf (file, _(" %s is: %s\n"), what, value);
209 1.1.1.2 christos }
210 1.1.1.2 christos
211 1.1.1.2 christos /* See cli-style.h. */
212 1.1.1.2 christos
213 1.1.1.2 christos void
214 1.1 christos cli_style_option::do_show_foreground (struct ui_file *file, int from_tty,
215 1.1 christos struct cmd_list_element *cmd,
216 1.1 christos const char *value)
217 1.1 christos {
218 1.1.1.2 christos do_show (_("foreground color"), file, cmd, value);
219 1.1 christos }
220 1.1 christos
221 1.1 christos /* See cli-style.h. */
222 1.1 christos
223 1.1 christos void
224 1.1 christos cli_style_option::do_show_background (struct ui_file *file, int from_tty,
225 1.1 christos struct cmd_list_element *cmd,
226 1.1 christos const char *value)
227 1.1 christos {
228 1.1.1.2 christos do_show (_("background color"), file, cmd, value);
229 1.1 christos }
230 1.1 christos
231 1.1 christos /* See cli-style.h. */
232 1.1 christos
233 1.1 christos void
234 1.1 christos cli_style_option::do_show_intensity (struct ui_file *file, int from_tty,
235 1.1 christos struct cmd_list_element *cmd,
236 1.1 christos const char *value)
237 1.1 christos {
238 1.1.1.2 christos do_show (_("display intensity"), file, cmd, value);
239 1.1 christos }
240 1.1 christos
241 1.1 christos /* See cli-style.h. */
242 1.1 christos
243 1.1.1.3 christos set_show_commands
244 1.1.1.2 christos cli_style_option::add_setshow_commands (enum command_class theclass,
245 1.1 christos const char *prefix_doc,
246 1.1 christos struct cmd_list_element **set_list,
247 1.1 christos struct cmd_list_element **show_list,
248 1.1.1.2 christos bool skip_intensity)
249 1.1 christos {
250 1.1.1.3 christos set_show_commands prefix_cmds
251 1.1.1.3 christos = add_setshow_prefix_cmd (m_name, theclass, prefix_doc, prefix_doc,
252 1.1.1.3 christos &m_set_list, &m_show_list, set_list, show_list);
253 1.1.1.3 christos
254 1.1.1.3 christos set_show_commands commands;
255 1.1.1.3 christos
256 1.1.1.3 christos commands = add_setshow_enum_cmd
257 1.1.1.3 christos ("foreground", theclass, cli_colors,
258 1.1.1.3 christos &m_foreground,
259 1.1.1.3 christos _("Set the foreground color for this property."),
260 1.1.1.3 christos _("Show the foreground color for this property."),
261 1.1.1.3 christos nullptr,
262 1.1.1.3 christos do_set_value,
263 1.1.1.3 christos do_show_foreground,
264 1.1.1.3 christos &m_set_list, &m_show_list);
265 1.1.1.3 christos commands.set->set_context (this);
266 1.1.1.3 christos commands.show->set_context (this);
267 1.1.1.3 christos
268 1.1.1.3 christos commands = add_setshow_enum_cmd
269 1.1.1.3 christos ("background", theclass, cli_colors,
270 1.1.1.3 christos &m_background,
271 1.1.1.3 christos _("Set the background color for this property."),
272 1.1.1.3 christos _("Show the background color for this property."),
273 1.1.1.3 christos nullptr,
274 1.1.1.3 christos do_set_value,
275 1.1.1.3 christos do_show_background,
276 1.1.1.3 christos &m_set_list, &m_show_list);
277 1.1.1.3 christos commands.set->set_context (this);
278 1.1.1.3 christos commands.show->set_context (this);
279 1.1 christos
280 1.1.1.2 christos if (!skip_intensity)
281 1.1.1.3 christos {
282 1.1.1.3 christos commands = add_setshow_enum_cmd
283 1.1.1.3 christos ("intensity", theclass, cli_intensities,
284 1.1.1.3 christos &m_intensity,
285 1.1.1.3 christos _("Set the display intensity for this property."),
286 1.1.1.3 christos _("Show the display intensity for this property."),
287 1.1.1.3 christos nullptr,
288 1.1.1.3 christos do_set_value,
289 1.1.1.3 christos do_show_intensity,
290 1.1.1.3 christos &m_set_list, &m_show_list);
291 1.1.1.3 christos commands.set->set_context (this);
292 1.1.1.3 christos commands.show->set_context (this);
293 1.1.1.3 christos }
294 1.1.1.3 christos
295 1.1.1.3 christos return prefix_cmds;
296 1.1 christos }
297 1.1 christos
298 1.1.1.3 christos cmd_list_element *style_set_list;
299 1.1.1.3 christos cmd_list_element *style_show_list;
300 1.1.1.3 christos
301 1.1.1.3 christos /* The command list for 'set style disassembler'. */
302 1.1.1.3 christos
303 1.1.1.3 christos static cmd_list_element *style_disasm_set_list;
304 1.1.1.3 christos
305 1.1.1.3 christos /* The command list for 'show style disassembler'. */
306 1.1.1.3 christos
307 1.1.1.3 christos static cmd_list_element *style_disasm_show_list;
308 1.1 christos
309 1.1 christos static void
310 1.1 christos set_style_enabled (const char *args, int from_tty, struct cmd_list_element *c)
311 1.1 christos {
312 1.1 christos g_source_cache.clear ();
313 1.1.1.3 christos gdb::observers::styling_changed.notify ();
314 1.1 christos }
315 1.1 christos
316 1.1 christos static void
317 1.1 christos show_style_enabled (struct ui_file *file, int from_tty,
318 1.1 christos struct cmd_list_element *c, const char *value)
319 1.1 christos {
320 1.1 christos if (cli_styling)
321 1.1.1.3 christos gdb_printf (file, _("CLI output styling is enabled.\n"));
322 1.1 christos else
323 1.1.1.3 christos gdb_printf (file, _("CLI output styling is disabled.\n"));
324 1.1 christos }
325 1.1 christos
326 1.1 christos static void
327 1.1 christos show_style_sources (struct ui_file *file, int from_tty,
328 1.1 christos struct cmd_list_element *c, const char *value)
329 1.1 christos {
330 1.1 christos if (source_styling)
331 1.1.1.3 christos gdb_printf (file, _("Source code styling is enabled.\n"));
332 1.1 christos else
333 1.1.1.3 christos gdb_printf (file, _("Source code styling is disabled.\n"));
334 1.1.1.3 christos }
335 1.1.1.3 christos
336 1.1.1.3 christos /* Implement 'show style disassembler'. */
337 1.1.1.3 christos
338 1.1.1.3 christos static void
339 1.1.1.3 christos show_style_disassembler (struct ui_file *file, int from_tty,
340 1.1.1.3 christos struct cmd_list_element *c, const char *value)
341 1.1.1.3 christos {
342 1.1.1.3 christos if (disassembler_styling)
343 1.1.1.3 christos gdb_printf (file, _("Disassembler output styling is enabled.\n"));
344 1.1.1.3 christos else
345 1.1.1.3 christos gdb_printf (file, _("Disassembler output styling is disabled.\n"));
346 1.1 christos }
347 1.1 christos
348 1.1.1.2 christos void _initialize_cli_style ();
349 1.1 christos void
350 1.1 christos _initialize_cli_style ()
351 1.1 christos {
352 1.1.1.3 christos add_setshow_prefix_cmd ("style", no_class,
353 1.1.1.3 christos _("\
354 1.1.1.2 christos Style-specific settings.\n\
355 1.1 christos Configure various style-related variables, such as colors"),
356 1.1.1.3 christos _("\
357 1.1.1.2 christos Style-specific settings.\n\
358 1.1 christos Configure various style-related variables, such as colors"),
359 1.1.1.3 christos &style_set_list, &style_show_list,
360 1.1.1.3 christos &setlist, &showlist);
361 1.1 christos
362 1.1 christos add_setshow_boolean_cmd ("enabled", no_class, &cli_styling, _("\
363 1.1 christos Set whether CLI styling is enabled."), _("\
364 1.1 christos Show whether CLI is enabled."), _("\
365 1.1 christos If enabled, output to the terminal is styled."),
366 1.1 christos set_style_enabled, show_style_enabled,
367 1.1 christos &style_set_list, &style_show_list);
368 1.1 christos
369 1.1 christos add_setshow_boolean_cmd ("sources", no_class, &source_styling, _("\
370 1.1 christos Set whether source code styling is enabled."), _("\
371 1.1 christos Show whether source code styling is enabled."), _("\
372 1.1 christos If enabled, source code is styled.\n"
373 1.1 christos #ifdef HAVE_SOURCE_HIGHLIGHT
374 1.1 christos "Note that source styling only works if styling in general is enabled,\n\
375 1.1 christos see \"show style enabled\"."
376 1.1 christos #else
377 1.1.1.2 christos "Source highlighting may be disabled in this installation of gdb, because\n\
378 1.1.1.2 christos it was not linked against GNU Source Highlight. However, it might still be\n\
379 1.1.1.2 christos available if the appropriate extension is available at runtime."
380 1.1 christos #endif
381 1.1 christos ), set_style_enabled, show_style_sources,
382 1.1 christos &style_set_list, &style_show_list);
383 1.1 christos
384 1.1.1.3 christos add_setshow_prefix_cmd ("disassembler", no_class,
385 1.1.1.3 christos _("\
386 1.1.1.3 christos Style-specific settings for the disassembler.\n\
387 1.1.1.3 christos Configure various disassembler style-related variables."),
388 1.1.1.3 christos _("\
389 1.1.1.3 christos Style-specific settings for the disassembler.\n\
390 1.1.1.3 christos Configure various disassembler style-related variables."),
391 1.1.1.3 christos &style_disasm_set_list, &style_disasm_show_list,
392 1.1.1.3 christos &style_set_list, &style_show_list);
393 1.1.1.3 christos
394 1.1.1.3 christos add_setshow_boolean_cmd ("enabled", no_class, &disassembler_styling, _("\
395 1.1.1.3 christos Set whether disassembler output styling is enabled."), _("\
396 1.1.1.3 christos Show whether disassembler output styling is enabled."), _("\
397 1.1.1.3 christos If enabled, disassembler output is styled. Disassembler highlighting\n\
398 1.1.1.3 christos requires the Python Pygments library, if this library is not available\n\
399 1.1.1.3 christos then disassembler highlighting will not be possible."
400 1.1.1.3 christos ), set_style_enabled, show_style_disassembler,
401 1.1.1.3 christos &style_disasm_set_list, &style_disasm_show_list);
402 1.1.1.3 christos
403 1.1.1.2 christos file_name_style.add_setshow_commands (no_class, _("\
404 1.1.1.2 christos Filename display styling.\n\
405 1.1.1.2 christos Configure filename colors and display intensity."),
406 1.1.1.2 christos &style_set_list, &style_show_list,
407 1.1.1.2 christos false);
408 1.1.1.2 christos
409 1.1.1.3 christos set_show_commands function_prefix_cmds
410 1.1.1.3 christos = function_name_style.add_setshow_commands (no_class, _("\
411 1.1.1.2 christos Function name display styling.\n\
412 1.1.1.2 christos Configure function name colors and display intensity"),
413 1.1.1.3 christos &style_set_list,
414 1.1.1.3 christos &style_show_list,
415 1.1.1.3 christos false);
416 1.1.1.2 christos
417 1.1.1.2 christos variable_name_style.add_setshow_commands (no_class, _("\
418 1.1.1.2 christos Variable name display styling.\n\
419 1.1.1.2 christos Configure variable name colors and display intensity"),
420 1.1.1.2 christos &style_set_list, &style_show_list,
421 1.1.1.2 christos false);
422 1.1.1.2 christos
423 1.1.1.3 christos set_show_commands address_prefix_cmds
424 1.1.1.3 christos = address_style.add_setshow_commands (no_class, _("\
425 1.1.1.2 christos Address display styling.\n\
426 1.1.1.2 christos Configure address colors and display intensity"),
427 1.1.1.3 christos &style_set_list, &style_show_list,
428 1.1.1.3 christos false);
429 1.1.1.2 christos
430 1.1.1.2 christos title_style.add_setshow_commands (no_class, _("\
431 1.1.1.2 christos Title display styling.\n\
432 1.1.1.2 christos Configure title colors and display intensity\n\
433 1.1.1.2 christos Some commands (such as \"apropos -v REGEXP\") use the title style to improve\n\
434 1.1.1.2 christos readability."),
435 1.1.1.2 christos &style_set_list, &style_show_list,
436 1.1.1.2 christos false);
437 1.1.1.2 christos
438 1.1.1.2 christos highlight_style.add_setshow_commands (no_class, _("\
439 1.1.1.2 christos Highlight display styling.\n\
440 1.1.1.2 christos Configure highlight colors and display intensity\n\
441 1.1.1.2 christos Some commands use the highlight style to draw the attention to a part\n\
442 1.1.1.2 christos of their output."),
443 1.1.1.2 christos &style_set_list, &style_show_list,
444 1.1.1.2 christos false);
445 1.1.1.2 christos
446 1.1.1.2 christos metadata_style.add_setshow_commands (no_class, _("\
447 1.1.1.2 christos Metadata display styling.\n\
448 1.1.1.2 christos Configure metadata colors and display intensity\n\
449 1.1.1.2 christos The \"metadata\" style is used when GDB displays information about\n\
450 1.1.1.2 christos your data, for example \"<unavailable>\""),
451 1.1.1.2 christos &style_set_list, &style_show_list,
452 1.1.1.2 christos false);
453 1.1.1.2 christos
454 1.1.1.2 christos tui_border_style.add_setshow_commands (no_class, _("\
455 1.1.1.2 christos TUI border display styling.\n\
456 1.1.1.2 christos Configure TUI border colors\n\
457 1.1.1.2 christos The \"tui-border\" style is used when GDB displays the border of a\n\
458 1.1.1.2 christos TUI window that does not have the focus."),
459 1.1.1.2 christos &style_set_list, &style_show_list,
460 1.1.1.2 christos true);
461 1.1.1.2 christos
462 1.1.1.2 christos tui_active_border_style.add_setshow_commands (no_class, _("\
463 1.1.1.2 christos TUI active border display styling.\n\
464 1.1.1.2 christos Configure TUI active border colors\n\
465 1.1.1.2 christos The \"tui-active-border\" style is used when GDB displays the border of a\n\
466 1.1.1.2 christos TUI window that does have the focus."),
467 1.1.1.2 christos &style_set_list,
468 1.1.1.2 christos &style_show_list,
469 1.1.1.2 christos true);
470 1.1.1.3 christos
471 1.1.1.3 christos version_style.add_setshow_commands (no_class, _("\
472 1.1.1.3 christos Version string display styling.\n\
473 1.1.1.3 christos Configure colors used to display the GDB version string."),
474 1.1.1.3 christos &style_set_list, &style_show_list,
475 1.1.1.3 christos false);
476 1.1.1.3 christos
477 1.1.1.3 christos disasm_mnemonic_style.add_setshow_commands (no_class, _("\
478 1.1.1.3 christos Disassembler mnemonic display styling.\n\
479 1.1.1.3 christos Configure the colors and display intensity for instruction mnemonics\n\
480 1.1.1.3 christos in the disassembler output. The \"disassembler mnemonic\" style is\n\
481 1.1.1.3 christos used to display instruction mnemonics as well as any assembler\n\
482 1.1.1.3 christos directives, e.g. \".byte\", \".word\", etc.\n\
483 1.1.1.3 christos \n\
484 1.1.1.3 christos This style will only be used for targets that support libopcodes based\n\
485 1.1.1.3 christos disassembler styling. When Python Pygments based styling is used\n\
486 1.1.1.3 christos then this style has no effect."),
487 1.1.1.3 christos &style_disasm_set_list,
488 1.1.1.3 christos &style_disasm_show_list,
489 1.1.1.3 christos false);
490 1.1.1.3 christos
491 1.1.1.3 christos disasm_register_style.add_setshow_commands (no_class, _("\
492 1.1.1.3 christos Disassembler register display styling.\n\
493 1.1.1.3 christos Configure the colors and display intensity for registers in the\n\
494 1.1.1.3 christos disassembler output.\n\
495 1.1.1.3 christos \n\
496 1.1.1.3 christos This style will only be used for targets that support libopcodes based\n\
497 1.1.1.3 christos disassembler styling. When Python Pygments based styling is used\n\
498 1.1.1.3 christos then this style has no effect."),
499 1.1.1.3 christos &style_disasm_set_list,
500 1.1.1.3 christos &style_disasm_show_list,
501 1.1.1.3 christos false);
502 1.1.1.3 christos
503 1.1.1.3 christos disasm_immediate_style.add_setshow_commands (no_class, _("\
504 1.1.1.3 christos Disassembler immediate display styling.\n\
505 1.1.1.3 christos Configure the colors and display intensity for immediates in the\n\
506 1.1.1.3 christos disassembler output. The \"disassembler immediate\" style is used for\n\
507 1.1.1.3 christos any number that is not an address, this includes constants in arithmetic\n\
508 1.1.1.3 christos instructions, as well as address offsets in memory access instructions.\n\
509 1.1.1.3 christos \n\
510 1.1.1.3 christos This style will only be used for targets that support libopcodes based\n\
511 1.1.1.3 christos disassembler styling. When Python Pygments based styling is used\n\
512 1.1.1.3 christos then this style has no effect."),
513 1.1.1.3 christos &style_disasm_set_list,
514 1.1.1.3 christos &style_disasm_show_list,
515 1.1.1.3 christos false);
516 1.1.1.3 christos
517 1.1.1.3 christos disasm_comment_style.add_setshow_commands (no_class, _("\
518 1.1.1.3 christos Disassembler comment display styling.\n\
519 1.1.1.3 christos Configure the colors and display intensity for comments in the\n\
520 1.1.1.3 christos disassembler output. The \"disassembler comment\" style is used for\n\
521 1.1.1.3 christos the comment character, and everything after the comment character up to\n\
522 1.1.1.3 christos the end of the line. The comment style overrides any other styling,\n\
523 1.1.1.3 christos e.g. a register name in a comment will use the comment styling.\n\
524 1.1.1.3 christos \n\
525 1.1.1.3 christos This style will only be used for targets that support libopcodes based\n\
526 1.1.1.3 christos disassembler styling. When Python Pygments based styling is used\n\
527 1.1.1.3 christos then this style has no effect."),
528 1.1.1.3 christos &style_disasm_set_list,
529 1.1.1.3 christos &style_disasm_show_list,
530 1.1.1.3 christos false);
531 1.1.1.3 christos
532 1.1.1.3 christos /* Setup 'disassembler address' style and 'disassembler symbol' style,
533 1.1.1.3 christos these are aliases for 'address' and 'function' styles respectively. */
534 1.1.1.3 christos add_alias_cmd ("address", address_prefix_cmds.set, no_class, 0,
535 1.1.1.3 christos &style_disasm_set_list);
536 1.1.1.3 christos add_alias_cmd ("address", address_prefix_cmds.show, no_class, 0,
537 1.1.1.3 christos &style_disasm_show_list);
538 1.1.1.3 christos add_alias_cmd ("symbol", function_prefix_cmds.set, no_class, 0,
539 1.1.1.3 christos &style_disasm_set_list);
540 1.1.1.3 christos add_alias_cmd ("symbol", function_prefix_cmds.show, no_class, 0,
541 1.1.1.3 christos &style_disasm_show_list);
542 1.1 christos }
543