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.5 christos cli_style_option command_style ("command", ui_file_style::BOLD); 95 1.1.1.5 christos 96 1.1.1.5 christos /* See cli-style.h. */ 97 1.1.1.5 christos 98 1.1.1.2 christos cli_style_option tui_border_style ("tui-border", ui_file_style::CYAN); 99 1.1.1.2 christos 100 1.1.1.2 christos /* See cli-style.h. */ 101 1.1.1.2 christos 102 1.1.1.2 christos cli_style_option tui_active_border_style ("tui-active-border", 103 1.1.1.2 christos ui_file_style::CYAN); 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.2 christos cli_style_option metadata_style ("metadata", ui_file_style::DIM); 108 1.1.1.2 christos 109 1.1.1.2 christos /* See cli-style.h. */ 110 1.1.1.2 christos 111 1.1.1.3 christos cli_style_option version_style ("version", ui_file_style::MAGENTA, 112 1.1.1.3 christos ui_file_style::BOLD); 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_mnemonic_style ("mnemonic", ui_file_style::GREEN); 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_register_style ("register", ui_file_style::RED); 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_immediate_style ("immediate", ui_file_style::BLUE); 125 1.1.1.3 christos 126 1.1.1.3 christos /* See cli-style.h. */ 127 1.1.1.3 christos 128 1.1.1.3 christos cli_style_option disasm_comment_style ("comment", ui_file_style::WHITE, 129 1.1.1.3 christos ui_file_style::DIM); 130 1.1.1.3 christos 131 1.1.1.3 christos /* See cli-style.h. */ 132 1.1.1.3 christos 133 1.1.1.5 christos cli_style_option line_number_style ("line-number", ui_file_style::DIM); 134 1.1.1.5 christos 135 1.1.1.5 christos /* See cli-style.h. */ 136 1.1.1.5 christos 137 1.1.1.2 christos cli_style_option::cli_style_option (const char *name, 138 1.1.1.3 christos ui_file_style::basic_color fg, 139 1.1.1.3 christos ui_file_style::intensity intensity) 140 1.1.1.2 christos : changed (name), 141 1.1.1.2 christos m_name (name), 142 1.1.1.2 christos m_foreground (cli_colors[fg - ui_file_style::NONE]), 143 1.1 christos m_background (cli_colors[0]), 144 1.1.1.3 christos m_intensity (cli_intensities[intensity]) 145 1.1 christos { 146 1.1 christos } 147 1.1 christos 148 1.1.1.2 christos /* See cli-style.h. */ 149 1.1.1.2 christos 150 1.1.1.2 christos cli_style_option::cli_style_option (const char *name, 151 1.1.1.2 christos ui_file_style::intensity i) 152 1.1.1.2 christos : changed (name), 153 1.1.1.2 christos m_name (name), 154 1.1.1.2 christos m_foreground (cli_colors[0]), 155 1.1.1.2 christos m_background (cli_colors[0]), 156 1.1.1.2 christos m_intensity (cli_intensities[i]) 157 1.1.1.2 christos { 158 1.1.1.2 christos } 159 1.1.1.2 christos 160 1.1 christos /* Return the color number corresponding to COLOR. */ 161 1.1 christos 162 1.1 christos static int 163 1.1 christos color_number (const char *color) 164 1.1 christos { 165 1.1 christos for (int i = 0; i < ARRAY_SIZE (cli_colors); ++i) 166 1.1 christos { 167 1.1 christos if (color == cli_colors[i]) 168 1.1 christos return i - 1; 169 1.1 christos } 170 1.1 christos gdb_assert_not_reached ("color not found"); 171 1.1 christos } 172 1.1 christos 173 1.1 christos /* See cli-style.h. */ 174 1.1 christos 175 1.1 christos ui_file_style 176 1.1 christos cli_style_option::style () const 177 1.1 christos { 178 1.1 christos int fg = color_number (m_foreground); 179 1.1 christos int bg = color_number (m_background); 180 1.1 christos ui_file_style::intensity intensity = ui_file_style::NORMAL; 181 1.1 christos 182 1.1 christos for (int i = 0; i < ARRAY_SIZE (cli_intensities); ++i) 183 1.1 christos { 184 1.1 christos if (m_intensity == cli_intensities[i]) 185 1.1 christos { 186 1.1 christos intensity = (ui_file_style::intensity) i; 187 1.1 christos break; 188 1.1 christos } 189 1.1 christos } 190 1.1 christos 191 1.1 christos return ui_file_style (fg, bg, intensity); 192 1.1 christos } 193 1.1 christos 194 1.1 christos /* See cli-style.h. */ 195 1.1 christos 196 1.1 christos void 197 1.1.1.2 christos cli_style_option::do_set_value (const char *ignore, int from_tty, 198 1.1.1.2 christos struct cmd_list_element *cmd) 199 1.1.1.2 christos { 200 1.1.1.3 christos cli_style_option *cso = (cli_style_option *) cmd->context (); 201 1.1.1.2 christos cso->changed.notify (); 202 1.1.1.2 christos } 203 1.1.1.2 christos 204 1.1.1.2 christos /* Implements the cli_style_option::do_show_* functions. 205 1.1.1.2 christos WHAT and VALUE are the property and value to show. 206 1.1.1.2 christos The style for which WHAT is shown is retrieved from CMD context. */ 207 1.1.1.2 christos 208 1.1.1.2 christos static void 209 1.1.1.2 christos do_show (const char *what, struct ui_file *file, 210 1.1.1.2 christos struct cmd_list_element *cmd, 211 1.1.1.2 christos const char *value) 212 1.1.1.2 christos { 213 1.1.1.3 christos cli_style_option *cso = (cli_style_option *) cmd->context (); 214 1.1.1.3 christos gdb_puts (_("The "), file); 215 1.1.1.2 christos fprintf_styled (file, cso->style (), _("\"%s\" style"), cso->name ()); 216 1.1.1.3 christos gdb_printf (file, _(" %s is: %s\n"), what, value); 217 1.1.1.2 christos } 218 1.1.1.2 christos 219 1.1.1.2 christos /* See cli-style.h. */ 220 1.1.1.2 christos 221 1.1.1.2 christos void 222 1.1 christos cli_style_option::do_show_foreground (struct ui_file *file, int from_tty, 223 1.1 christos struct cmd_list_element *cmd, 224 1.1 christos const char *value) 225 1.1 christos { 226 1.1.1.2 christos do_show (_("foreground color"), file, cmd, value); 227 1.1 christos } 228 1.1 christos 229 1.1 christos /* See cli-style.h. */ 230 1.1 christos 231 1.1 christos void 232 1.1 christos cli_style_option::do_show_background (struct ui_file *file, int from_tty, 233 1.1 christos struct cmd_list_element *cmd, 234 1.1 christos const char *value) 235 1.1 christos { 236 1.1.1.2 christos do_show (_("background color"), file, cmd, value); 237 1.1 christos } 238 1.1 christos 239 1.1 christos /* See cli-style.h. */ 240 1.1 christos 241 1.1 christos void 242 1.1 christos cli_style_option::do_show_intensity (struct ui_file *file, int from_tty, 243 1.1 christos struct cmd_list_element *cmd, 244 1.1 christos const char *value) 245 1.1 christos { 246 1.1.1.2 christos do_show (_("display intensity"), file, cmd, value); 247 1.1 christos } 248 1.1 christos 249 1.1 christos /* See cli-style.h. */ 250 1.1 christos 251 1.1.1.3 christos set_show_commands 252 1.1.1.2 christos cli_style_option::add_setshow_commands (enum command_class theclass, 253 1.1 christos const char *prefix_doc, 254 1.1 christos struct cmd_list_element **set_list, 255 1.1 christos struct cmd_list_element **show_list, 256 1.1.1.2 christos bool skip_intensity) 257 1.1 christos { 258 1.1.1.3 christos set_show_commands prefix_cmds 259 1.1.1.3 christos = add_setshow_prefix_cmd (m_name, theclass, prefix_doc, prefix_doc, 260 1.1.1.3 christos &m_set_list, &m_show_list, set_list, show_list); 261 1.1.1.3 christos 262 1.1.1.3 christos set_show_commands commands; 263 1.1.1.3 christos 264 1.1.1.3 christos commands = add_setshow_enum_cmd 265 1.1.1.3 christos ("foreground", theclass, cli_colors, 266 1.1.1.3 christos &m_foreground, 267 1.1.1.3 christos _("Set the foreground color for this property."), 268 1.1.1.3 christos _("Show the foreground color for this property."), 269 1.1.1.3 christos nullptr, 270 1.1.1.3 christos do_set_value, 271 1.1.1.3 christos do_show_foreground, 272 1.1.1.3 christos &m_set_list, &m_show_list); 273 1.1.1.3 christos commands.set->set_context (this); 274 1.1.1.3 christos commands.show->set_context (this); 275 1.1.1.3 christos 276 1.1.1.3 christos commands = add_setshow_enum_cmd 277 1.1.1.3 christos ("background", theclass, cli_colors, 278 1.1.1.3 christos &m_background, 279 1.1.1.3 christos _("Set the background color for this property."), 280 1.1.1.3 christos _("Show the background color for this property."), 281 1.1.1.3 christos nullptr, 282 1.1.1.3 christos do_set_value, 283 1.1.1.3 christos do_show_background, 284 1.1.1.3 christos &m_set_list, &m_show_list); 285 1.1.1.3 christos commands.set->set_context (this); 286 1.1.1.3 christos commands.show->set_context (this); 287 1.1 christos 288 1.1.1.2 christos if (!skip_intensity) 289 1.1.1.3 christos { 290 1.1.1.3 christos commands = add_setshow_enum_cmd 291 1.1.1.3 christos ("intensity", theclass, cli_intensities, 292 1.1.1.3 christos &m_intensity, 293 1.1.1.3 christos _("Set the display intensity for this property."), 294 1.1.1.3 christos _("Show the display intensity for this property."), 295 1.1.1.3 christos nullptr, 296 1.1.1.3 christos do_set_value, 297 1.1.1.3 christos do_show_intensity, 298 1.1.1.3 christos &m_set_list, &m_show_list); 299 1.1.1.3 christos commands.set->set_context (this); 300 1.1.1.3 christos commands.show->set_context (this); 301 1.1.1.3 christos } 302 1.1.1.3 christos 303 1.1.1.3 christos return prefix_cmds; 304 1.1 christos } 305 1.1 christos 306 1.1.1.3 christos cmd_list_element *style_set_list; 307 1.1.1.3 christos cmd_list_element *style_show_list; 308 1.1.1.3 christos 309 1.1.1.3 christos /* The command list for 'set style disassembler'. */ 310 1.1.1.3 christos 311 1.1.1.3 christos static cmd_list_element *style_disasm_set_list; 312 1.1.1.3 christos 313 1.1.1.3 christos /* The command list for 'show style disassembler'. */ 314 1.1.1.3 christos 315 1.1.1.3 christos static cmd_list_element *style_disasm_show_list; 316 1.1 christos 317 1.1 christos static void 318 1.1 christos set_style_enabled (const char *args, int from_tty, struct cmd_list_element *c) 319 1.1 christos { 320 1.1 christos g_source_cache.clear (); 321 1.1.1.3 christos gdb::observers::styling_changed.notify (); 322 1.1 christos } 323 1.1 christos 324 1.1 christos static void 325 1.1 christos show_style_enabled (struct ui_file *file, int from_tty, 326 1.1 christos struct cmd_list_element *c, const char *value) 327 1.1 christos { 328 1.1 christos if (cli_styling) 329 1.1.1.3 christos gdb_printf (file, _("CLI output styling is enabled.\n")); 330 1.1 christos else 331 1.1.1.3 christos gdb_printf (file, _("CLI output styling is disabled.\n")); 332 1.1 christos } 333 1.1 christos 334 1.1 christos static void 335 1.1 christos show_style_sources (struct ui_file *file, int from_tty, 336 1.1 christos struct cmd_list_element *c, const char *value) 337 1.1 christos { 338 1.1 christos if (source_styling) 339 1.1.1.3 christos gdb_printf (file, _("Source code styling is enabled.\n")); 340 1.1 christos else 341 1.1.1.3 christos gdb_printf (file, _("Source code styling is disabled.\n")); 342 1.1.1.3 christos } 343 1.1.1.3 christos 344 1.1.1.3 christos /* Implement 'show style disassembler'. */ 345 1.1.1.3 christos 346 1.1.1.3 christos static void 347 1.1.1.3 christos show_style_disassembler (struct ui_file *file, int from_tty, 348 1.1.1.3 christos struct cmd_list_element *c, const char *value) 349 1.1.1.3 christos { 350 1.1.1.3 christos if (disassembler_styling) 351 1.1.1.3 christos gdb_printf (file, _("Disassembler output styling is enabled.\n")); 352 1.1.1.3 christos else 353 1.1.1.3 christos gdb_printf (file, _("Disassembler output styling is disabled.\n")); 354 1.1 christos } 355 1.1 christos 356 1.1.1.2 christos void _initialize_cli_style (); 357 1.1 christos void 358 1.1 christos _initialize_cli_style () 359 1.1 christos { 360 1.1.1.3 christos add_setshow_prefix_cmd ("style", no_class, 361 1.1.1.3 christos _("\ 362 1.1.1.2 christos Style-specific settings.\n\ 363 1.1 christos Configure various style-related variables, such as colors"), 364 1.1.1.3 christos _("\ 365 1.1.1.2 christos Style-specific settings.\n\ 366 1.1 christos Configure various style-related variables, such as colors"), 367 1.1.1.3 christos &style_set_list, &style_show_list, 368 1.1.1.3 christos &setlist, &showlist); 369 1.1 christos 370 1.1 christos add_setshow_boolean_cmd ("enabled", no_class, &cli_styling, _("\ 371 1.1 christos Set whether CLI styling is enabled."), _("\ 372 1.1 christos Show whether CLI is enabled."), _("\ 373 1.1 christos If enabled, output to the terminal is styled."), 374 1.1 christos set_style_enabled, show_style_enabled, 375 1.1 christos &style_set_list, &style_show_list); 376 1.1 christos 377 1.1 christos add_setshow_boolean_cmd ("sources", no_class, &source_styling, _("\ 378 1.1 christos Set whether source code styling is enabled."), _("\ 379 1.1 christos Show whether source code styling is enabled."), _("\ 380 1.1 christos If enabled, source code is styled.\n" 381 1.1 christos #ifdef HAVE_SOURCE_HIGHLIGHT 382 1.1 christos "Note that source styling only works if styling in general is enabled,\n\ 383 1.1 christos see \"show style enabled\"." 384 1.1 christos #else 385 1.1.1.2 christos "Source highlighting may be disabled in this installation of gdb, because\n\ 386 1.1.1.2 christos it was not linked against GNU Source Highlight. However, it might still be\n\ 387 1.1.1.2 christos available if the appropriate extension is available at runtime." 388 1.1 christos #endif 389 1.1 christos ), set_style_enabled, show_style_sources, 390 1.1 christos &style_set_list, &style_show_list); 391 1.1 christos 392 1.1.1.3 christos add_setshow_prefix_cmd ("disassembler", no_class, 393 1.1.1.3 christos _("\ 394 1.1.1.3 christos Style-specific settings for the disassembler.\n\ 395 1.1.1.3 christos Configure various disassembler style-related variables."), 396 1.1.1.3 christos _("\ 397 1.1.1.3 christos Style-specific settings for the disassembler.\n\ 398 1.1.1.3 christos Configure various disassembler style-related variables."), 399 1.1.1.3 christos &style_disasm_set_list, &style_disasm_show_list, 400 1.1.1.3 christos &style_set_list, &style_show_list); 401 1.1.1.3 christos 402 1.1.1.3 christos add_setshow_boolean_cmd ("enabled", no_class, &disassembler_styling, _("\ 403 1.1.1.3 christos Set whether disassembler output styling is enabled."), _("\ 404 1.1.1.3 christos Show whether disassembler output styling is enabled."), _("\ 405 1.1.1.3 christos If enabled, disassembler output is styled. Disassembler highlighting\n\ 406 1.1.1.3 christos requires the Python Pygments library, if this library is not available\n\ 407 1.1.1.3 christos then disassembler highlighting will not be possible." 408 1.1.1.3 christos ), set_style_enabled, show_style_disassembler, 409 1.1.1.3 christos &style_disasm_set_list, &style_disasm_show_list); 410 1.1.1.3 christos 411 1.1.1.2 christos file_name_style.add_setshow_commands (no_class, _("\ 412 1.1.1.2 christos Filename display styling.\n\ 413 1.1.1.2 christos Configure filename colors and display intensity."), 414 1.1.1.2 christos &style_set_list, &style_show_list, 415 1.1.1.2 christos false); 416 1.1.1.2 christos 417 1.1.1.3 christos set_show_commands function_prefix_cmds 418 1.1.1.3 christos = function_name_style.add_setshow_commands (no_class, _("\ 419 1.1.1.2 christos Function name display styling.\n\ 420 1.1.1.2 christos Configure function name colors and display intensity"), 421 1.1.1.3 christos &style_set_list, 422 1.1.1.3 christos &style_show_list, 423 1.1.1.3 christos false); 424 1.1.1.2 christos 425 1.1.1.2 christos variable_name_style.add_setshow_commands (no_class, _("\ 426 1.1.1.2 christos Variable name display styling.\n\ 427 1.1.1.2 christos Configure variable name colors and display intensity"), 428 1.1.1.2 christos &style_set_list, &style_show_list, 429 1.1.1.2 christos false); 430 1.1.1.2 christos 431 1.1.1.3 christos set_show_commands address_prefix_cmds 432 1.1.1.3 christos = address_style.add_setshow_commands (no_class, _("\ 433 1.1.1.2 christos Address display styling.\n\ 434 1.1.1.2 christos Configure address colors and display intensity"), 435 1.1.1.3 christos &style_set_list, &style_show_list, 436 1.1.1.3 christos false); 437 1.1.1.2 christos 438 1.1.1.2 christos title_style.add_setshow_commands (no_class, _("\ 439 1.1.1.2 christos Title display styling.\n\ 440 1.1.1.2 christos Configure title colors and display intensity\n\ 441 1.1.1.2 christos Some commands (such as \"apropos -v REGEXP\") use the title style to improve\n\ 442 1.1.1.2 christos readability."), 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.5 christos command_style.add_setshow_commands (no_class, _("\ 447 1.1.1.5 christos Command display styling.\n\ 448 1.1.1.5 christos Configure the colors and display intensity for GDB commands mentioned\n\ 449 1.1.1.5 christos in the output."), 450 1.1.1.5 christos &style_set_list, &style_show_list, 451 1.1.1.5 christos false); 452 1.1.1.5 christos 453 1.1.1.2 christos highlight_style.add_setshow_commands (no_class, _("\ 454 1.1.1.2 christos Highlight display styling.\n\ 455 1.1.1.2 christos Configure highlight colors and display intensity\n\ 456 1.1.1.2 christos Some commands use the highlight style to draw the attention to a part\n\ 457 1.1.1.2 christos of their output."), 458 1.1.1.2 christos &style_set_list, &style_show_list, 459 1.1.1.2 christos false); 460 1.1.1.2 christos 461 1.1.1.2 christos metadata_style.add_setshow_commands (no_class, _("\ 462 1.1.1.2 christos Metadata display styling.\n\ 463 1.1.1.2 christos Configure metadata colors and display intensity\n\ 464 1.1.1.2 christos The \"metadata\" style is used when GDB displays information about\n\ 465 1.1.1.2 christos your data, for example \"<unavailable>\""), 466 1.1.1.2 christos &style_set_list, &style_show_list, 467 1.1.1.2 christos false); 468 1.1.1.2 christos 469 1.1.1.2 christos tui_border_style.add_setshow_commands (no_class, _("\ 470 1.1.1.2 christos TUI border display styling.\n\ 471 1.1.1.2 christos Configure TUI border colors\n\ 472 1.1.1.2 christos The \"tui-border\" style is used when GDB displays the border of a\n\ 473 1.1.1.2 christos TUI window that does not have the focus."), 474 1.1.1.2 christos &style_set_list, &style_show_list, 475 1.1.1.2 christos true); 476 1.1.1.2 christos 477 1.1.1.2 christos tui_active_border_style.add_setshow_commands (no_class, _("\ 478 1.1.1.2 christos TUI active border display styling.\n\ 479 1.1.1.2 christos Configure TUI active border colors\n\ 480 1.1.1.2 christos The \"tui-active-border\" style is used when GDB displays the border of a\n\ 481 1.1.1.2 christos TUI window that does have the focus."), 482 1.1.1.2 christos &style_set_list, 483 1.1.1.2 christos &style_show_list, 484 1.1.1.2 christos true); 485 1.1.1.3 christos 486 1.1.1.3 christos version_style.add_setshow_commands (no_class, _("\ 487 1.1.1.3 christos Version string display styling.\n\ 488 1.1.1.3 christos Configure colors used to display the GDB version string."), 489 1.1.1.3 christos &style_set_list, &style_show_list, 490 1.1.1.3 christos false); 491 1.1.1.3 christos 492 1.1.1.3 christos disasm_mnemonic_style.add_setshow_commands (no_class, _("\ 493 1.1.1.3 christos Disassembler mnemonic display styling.\n\ 494 1.1.1.3 christos Configure the colors and display intensity for instruction mnemonics\n\ 495 1.1.1.3 christos in the disassembler output. The \"disassembler mnemonic\" style is\n\ 496 1.1.1.3 christos used to display instruction mnemonics as well as any assembler\n\ 497 1.1.1.3 christos directives, e.g. \".byte\", \".word\", etc.\n\ 498 1.1.1.3 christos \n\ 499 1.1.1.3 christos This style will only be used for targets that support libopcodes based\n\ 500 1.1.1.3 christos disassembler styling. When Python Pygments based styling is used\n\ 501 1.1.1.3 christos then this style has no effect."), 502 1.1.1.3 christos &style_disasm_set_list, 503 1.1.1.3 christos &style_disasm_show_list, 504 1.1.1.3 christos false); 505 1.1.1.3 christos 506 1.1.1.3 christos disasm_register_style.add_setshow_commands (no_class, _("\ 507 1.1.1.3 christos Disassembler register display styling.\n\ 508 1.1.1.3 christos Configure the colors and display intensity for registers in the\n\ 509 1.1.1.3 christos disassembler output.\n\ 510 1.1.1.3 christos \n\ 511 1.1.1.3 christos This style will only be used for targets that support libopcodes based\n\ 512 1.1.1.3 christos disassembler styling. When Python Pygments based styling is used\n\ 513 1.1.1.3 christos then this style has no effect."), 514 1.1.1.3 christos &style_disasm_set_list, 515 1.1.1.3 christos &style_disasm_show_list, 516 1.1.1.3 christos false); 517 1.1.1.3 christos 518 1.1.1.3 christos disasm_immediate_style.add_setshow_commands (no_class, _("\ 519 1.1.1.3 christos Disassembler immediate display styling.\n\ 520 1.1.1.3 christos Configure the colors and display intensity for immediates in the\n\ 521 1.1.1.3 christos disassembler output. The \"disassembler immediate\" style is used for\n\ 522 1.1.1.3 christos any number that is not an address, this includes constants in arithmetic\n\ 523 1.1.1.3 christos instructions, as well as address offsets in memory access instructions.\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 disasm_comment_style.add_setshow_commands (no_class, _("\ 533 1.1.1.3 christos Disassembler comment display styling.\n\ 534 1.1.1.3 christos Configure the colors and display intensity for comments in the\n\ 535 1.1.1.3 christos disassembler output. The \"disassembler comment\" style is used for\n\ 536 1.1.1.3 christos the comment character, and everything after the comment character up to\n\ 537 1.1.1.3 christos the end of the line. The comment style overrides any other styling,\n\ 538 1.1.1.3 christos e.g. a register name in a comment will use the comment styling.\n\ 539 1.1.1.3 christos \n\ 540 1.1.1.3 christos This style will only be used for targets that support libopcodes based\n\ 541 1.1.1.3 christos disassembler styling. When Python Pygments based styling is used\n\ 542 1.1.1.3 christos then this style has no effect."), 543 1.1.1.3 christos &style_disasm_set_list, 544 1.1.1.3 christos &style_disasm_show_list, 545 1.1.1.3 christos false); 546 1.1.1.3 christos 547 1.1.1.5 christos line_number_style.add_setshow_commands (no_class, _("\ 548 1.1.1.5 christos Line number display styling.\n\ 549 1.1.1.5 christos Configure colors and display intensity for line numbers\n\ 550 1.1.1.5 christos The \"line-number\" style is used when GDB displays line numbers\n\ 551 1.1.1.5 christos coming from your source code."), 552 1.1.1.5 christos &style_set_list, &style_show_list, 553 1.1.1.5 christos false); 554 1.1.1.5 christos 555 1.1.1.3 christos /* Setup 'disassembler address' style and 'disassembler symbol' style, 556 1.1.1.3 christos these are aliases for 'address' and 'function' styles respectively. */ 557 1.1.1.3 christos add_alias_cmd ("address", address_prefix_cmds.set, no_class, 0, 558 1.1.1.3 christos &style_disasm_set_list); 559 1.1.1.3 christos add_alias_cmd ("address", address_prefix_cmds.show, no_class, 0, 560 1.1.1.3 christos &style_disasm_show_list); 561 1.1.1.3 christos add_alias_cmd ("symbol", function_prefix_cmds.set, no_class, 0, 562 1.1.1.3 christos &style_disasm_set_list); 563 1.1.1.3 christos add_alias_cmd ("symbol", function_prefix_cmds.show, no_class, 0, 564 1.1.1.3 christos &style_disasm_show_list); 565 1.1 christos } 566