This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Improve/fix the TUI's current source line highlight
- From: "Hannes Domani via gdb-patches" <gdb-patches at sourceware dot org>
- To: GDB Patches <gdb-patches at sourceware dot org>
- Date: Fri, 15 Mar 2019 16:38:37 +0000 (UTC)
- Subject: Re: [PATCH] Improve/fix the TUI's current source line highlight
- References: <6ada07d6-ff84-e215-19ff-0a17563390c6@redhat.com>
- Reply-to: Hannes Domani <ssbssa at yahoo dot de>
Am Donnerstag, 14. März 2019, 18:47:56 MEZ hat Pedro Alves <palves@redhat.com> Folgendes geschrieben:
> WDYT?
The result looks very nice.
> +/* If true, we're highlighting the current source line in reverse
> + video mode. */
> +static bool reverse_mode_p = true;
Shouldn't this variable be initialized to false?
Weird things happen on my end with true (sometimes the cmd window contents are reversed).
Also, I had to add the following to make it work on windows
(but beware, I'm using pdcurses, not ncurses, and I don't know if ncurses
for windows needs this as well):
--- a/gdb/tui/tui-io.c
+++ b/gdb/tui/tui-io.c
@@ -369,6 +386,17 @@ apply_ansi_escape (WINDOW *w, const char *buf)
if (reverse_mode_p)
{
+#if defined(__MINGW32__)
+ if (style.get_foreground ().is_basic ()
+ && style.get_foreground ().get_value ()
+ == (ncurses_norm_attr & 15))
+ style.set_fg (ui_file_style::NONE);
+ if (style.get_background ().is_basic ()
+ && style.get_background ().get_value ()
+ == ((ncurses_norm_attr >> 4) & 15))
+ style.set_bg (ui_file_style::NONE);
+#endif
+
/* 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.,