From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@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:39:00 -0000 From: "Hannes Domani via gdb-patches" Reply-To: Hannes Domani To: GDB Patches 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 X-IsSubscribed: yes X-SW-Source: 2019-03/txt/msg00318.txt.bz2 Am Donnerstag, 14. M=C3=A4rz 2019, 18:47:56 MEZ hat Pedro Alves Folgendes geschrieben:=20 > WDYT? The result looks very nice. > +/* If true, we're highlighting the current source line in reverse > +=C2=A0 video mode.=C2=A0 */ > +static bool reverse_mode_p =3D 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) =C2=A0=C2=A0 if (reverse_mode_p) =C2=A0=C2=A0=C2=A0=C2=A0 { +#if defined(__MINGW32__) +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (style.get_foreground ().is_basic () +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 && style.get_foreground (= ).get_value () +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D=3D (ncurses_norm_attr= & 15)) +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 style.set_fg (ui_file_style::NONE); +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (style.get_background ().is_basic () +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 && style.get_background (= ).get_value () +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D=3D ((ncurses_norm_att= r >> 4) & 15)) +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 style.set_bg (ui_file_style::NONE); +#endif + =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* We want to reverse _only_ the defau= lt foreground/background =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 colors.=C2=A0 If the foreg= round color is not the default (because =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 the text was styled), we w= ant to leave it as is.=C2=A0 If e.g.,