For both /r and /b GDB is now better at using whitespace in order to
align the disassembled instruction text.
+* The TUI no longer styles the source and assembly code highlighted by
+ the current position indicator by default. You can however
+ re-enable styling using the new "set style tui-current-position"
+ command.
+
* New commands
maintenance set ignore-prologue-end-flag on|off
show debug infcall
Print additional debug messages about inferior function calls.
+set style tui-current-position [on|off]
+ Whether to style the source and assembly code highlighted by the
+ TUI's current position indicator. The default is off.
+
* Changed commands
document user-defined
return prefix_cmds;
}
-static cmd_list_element *style_set_list;
-static cmd_list_element *style_show_list;
+cmd_list_element *style_set_list;
+cmd_list_element *style_show_list;
/* The command list for 'set style disassembler'. */
@item show style sources
Show the current state of source code styling.
+@item set style tui-current-position @samp{on|off}
+Enable or disable styling of the source and assembly code highlighted
+by the TUI's current position indicator. The default is @samp{off}.
+@xref{TUI, ,@value{GDBN} Text User Interface}.
+
+@item show style tui-current-position
+Show whether the source and assembly code highlighted by the TUI's
+current position indicator is styled.
+
@anchor{style_disassembler_enabled}
@item set style disassembler enabled @samp{on|off}
Enable or disable disassembler styling. This affects whether
when their values change.
@end table
-The source and assembly windows show the current program position
-by highlighting the current line and marking it with a @samp{>} marker.
+The source and assembly windows show the current program position by
+highlighting the current line and marking it with a @samp{>} marker.
+By default, source and assembly code styling is disabled for the
+highlighted text, but you can enable it with the @code{set style
+tui-current-position on} command. @xref{Output Styling}.
+
Breakpoints are indicated with two markers. The first marker
indicates the breakpoint type:
extern void print_command_lines (struct ui_out *,
struct command_line *, unsigned int);
+/* Chains containing all defined "set/show style" subcommands. */
+extern struct cmd_list_element *style_set_list;
+extern struct cmd_list_element *style_show_list;
+
#endif /* !defined (GDBCMD_H) */
if (reverse_mode_p)
{
+ if (!style_tui_current_position)
+ return n_read;
+
/* We want to reverse _only_ the default foreground/background
colors. If the foreground color is not the default (because
the text was styled), we want to leave it as is. If e.g.,
ui_file_style style = last_style;
reverse_mode_p = reverse;
- style.set_reverse (reverse);
if (reverse)
{
reverse_save_bg = style.get_background ();
reverse_save_fg = style.get_foreground ();
+
+ if (!style_tui_current_position)
+ {
+ /* Switch to default style (reversed) while highlighting the
+ current position. */
+ style = {};
+ }
}
else
{
style.set_fg (reverse_save_fg);
}
+ style.set_reverse (reverse);
+
tui_apply_style (w, style);
}
value);
}
+/* Implementation of the "set/show style tui-current-position" commands. */
+
+bool style_tui_current_position = false;
+
+static void
+show_style_tui_current_position (ui_file *file,
+ int from_tty,
+ cmd_list_element *c,
+ const char *value)
+{
+ gdb_printf (file, _("\
+Styling the text highlighted by the TUI's current position indicator is %s.\n"),
+ value);
+}
+
+static void
+set_style_tui_current_position (const char *ignore, int from_tty,
+ cmd_list_element *c)
+{
+ if (TUI_SRC_WIN != nullptr)
+ TUI_SRC_WIN->refill ();
+ if (TUI_DISASM_WIN != nullptr)
+ TUI_DISASM_WIN->refill ();
+}
/* Tui internal configuration variables. These variables are updated
by tui_update_variables to reflect the tui configuration
tui_set_compact_source, tui_show_compact_source,
&tui_setlist, &tui_showlist);
+ add_setshow_boolean_cmd ("tui-current-position", class_maintenance,
+ &style_tui_current_position, _("\
+Set whether to style text highlighted by the TUI's current position indicator."),
+ _("\
+Show whether to style text highlighted by the TUI's current position indicator."),
+ _("\
+When enabled, the source and assembly code highlighted by the TUI's current\n\
+position indicator is styled."),
+ set_style_tui_current_position,
+ show_style_tui_current_position,
+ &style_set_list,
+ &style_show_list);
+
tui_border_style.changed.attach (tui_rehighlight_all, "tui-win");
tui_active_border_style.changed.attach (tui_rehighlight_all, "tui-win");
}
/* Whether compact source display should be used. */
extern bool compact_source;
+/* Whether to style the source and assembly code highlighted by the TUI's
+ current position indicator. */
+extern bool style_tui_current_position;
+
#endif /* TUI_TUI_WIN_H */