Message ID | 186859064.9289078.1552667917410@mail.yahoo.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 13989 invoked by alias); 15 Mar 2019 16:39:14 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 13980 invoked by uid 89); 15 Mar 2019 16:39:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=sk:ncurses, __mingw32__, __MINGW32__, video X-HELO: sonic306-20.consmr.mail.ir2.yahoo.com Received: from sonic306-20.consmr.mail.ir2.yahoo.com (HELO sonic306-20.consmr.mail.ir2.yahoo.com) (77.238.176.206) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 15 Mar 2019 16:39:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1552667949; bh=GMp4g5XxxQZTc56phx6s5DqIvp2wS4IuLtJWxlJUeio=; h=Date:From:To:In-Reply-To:References:Subject:From:Subject; b=V6lgDkD+exLIb4TgHInryIMVdEdBNtOLwG2cawzNaTSk7Jr0lcWf4V6SupTRuBIc2SCFdlxbNdpofvAdzqfjuDyxQiBGHjv5yqVFM9MxsA9iOJipeVXqcjRvHbUvjulCJ8J1SoBStWZv3ZL0hkm9IRBDxGKKjgv3rvkbr5NFdQ7ArkqplxYOs1QF/xF+g7x6Oy7CFiMU6yyembDRqPiHJcswm0IT3NsRx1QTWBu4AUywdJNJPfJPWiZGAupWIXzdwImvm+5dQPrkWwo01/7KHoXEsKlDx0/g781o4OCpPO26SJ2JbjG+s+8k6PYpUj17L9jTukD/MphSixTaiXm52Q== Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ir2.yahoo.com with HTTP; Fri, 15 Mar 2019 16:39:09 +0000 Date: Fri, 15 Mar 2019 16:38:37 +0000 (UTC) From: "Hannes Domani via gdb-patches" <gdb-patches@sourceware.org> Reply-To: Hannes Domani <ssbssa@yahoo.de> To: GDB Patches <gdb-patches@sourceware.org> Message-ID: <186859064.9289078.1552667917410@mail.yahoo.com> In-Reply-To: <6ada07d6-ff84-e215-19ff-0a17563390c6@redhat.com> References: <6ada07d6-ff84-e215-19ff-0a17563390c6@redhat.com> Subject: Re: [PATCH] Improve/fix the TUI's current source line highlight MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Length: 1802 X-IsSubscribed: yes |
Commit Message
Terekhov, Mikhail via Gdb-patches
March 15, 2019, 4:38 p.m. UTC
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):
Comments
On 03/15/2019 04:38 PM, Hannes Domani via gdb-patches wrote: > 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). > Wow, of course. I have no idea how I missed that. > > 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): Thanks, but can you explain it? It is not obvious to me. Thanks, Pedro Alves
> Date: Fri, 15 Mar 2019 16:38:37 +0000 (UTC) > From: "Hannes Domani via gdb-patches" <gdb-patches@sourceware.org> > > 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): Ncurses doesn't need this. > --- 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 > + Could you describe what happens with pdcurses if you don't make this change? It's strange that pdcurses cannot use explicit color specification if the color is the default one.
Am Sonntag, 17. März 2019, 17:07:46 MEZ hat Eli Zaretskii <eliz@gnu.org> Folgendes geschrieben: > > Date: Fri, 15 Mar 2019 16:38:37 +0000 (UTC)> > From: "Hannes Domani via gdb-patches" <gdb-patches@sourceware.org>> > > > 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):> > Ncurses doesn't need this.> > > > --- 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> > +> > Could you describe what happens with pdcurses if you don't make this> change? It's strange that pdcurses cannot use explicit color> specification if the color is the default one. Actually, you can disregard that. Before you added that fix for windows, I found a different workaround,it was to set the "normal" color in esc.style to gray. I forgot that I did that, and it backfired now.So I removed that again, and everything is fine now even without that above change. Sorry for the noise. RegardsHannes Domani
> Date: Sun, 17 Mar 2019 16:46:37 +0000 (UTC) > From: "Hannes Domani via gdb-patches" <gdb-patches@sourceware.org> > > Actually, you can disregard that. > Before you added that fix for windows, I found a different workaround,it was to set the "normal" color in esc.style to gray. > I forgot that I did that, and it backfired now.So I removed that again, and everything is fine now even without that above change. Great, thanks for unlocking this mystery. So Pedro, I think the way is clear for you to go ahead and push. Thanks.
On 03/17/2019 04:46 PM, Hannes Domani via gdb-patches wrote: > Am Sonntag, 17. März 2019, 17:07:46 MEZ hat Eli Zaretskii <eliz@gnu.org> Folgendes geschrieben: >>> Date: Fri, 15 Mar 2019 16:38:37 +0000 (UTC)> > From: "Hannes Domani via gdb-patches" <gdb-patches@sourceware.org>> > > > 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):> >> Ncurses doesn't need this.> >> >>> --- 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> > +> >> Could you describe what happens with pdcurses if you don't make this> change? It's strange that pdcurses cannot use explicit color> specification if the color is the default one. > Actually, you can disregard that. > Before you added that fix for windows, I found a different workaround,it was to set the "normal" color in esc.style to gray. > I forgot that I did that, and it backfired now.So I removed that again, and everything is fine now even without that above change. > Sorry for the noise. No worries, thanks for following through and for testing. The patch is in master and 8.3 branch now. Thanks, Pedro Alves
--- 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.,