From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113548 invoked by alias); 30 Nov 2018 16:17:44 -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 113445 invoked by uid 89); 30 Nov 2018 16:17:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=ANSI, ssh, terminals, scenario X-HELO: gateway21.websitewelcome.com Received: from gateway21.websitewelcome.com (HELO gateway21.websitewelcome.com) (192.185.45.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 30 Nov 2018 16:17:39 +0000 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway21.websitewelcome.com (Postfix) with ESMTP id 54B2D4016A975 for ; Fri, 30 Nov 2018 10:17:38 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id SlU2g1PBuRPojSlU2g9Z4L; Fri, 30 Nov 2018 10:17:38 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=XjIoiuI+SUujH877p/RmMY77CK65AVs/8WldVvbDfLA=; b=OZabnh1RXUzhKuGWei7wvMZXHK uOeDyCbLfs/8DTLeVqhPK2UmXLsRk6lHFjIL8GdeT+84+e/LcYbmUOtHwvOL389BdhLG1rOJzxWcK ioa75Re+d12kFbcbYxJrH/2G8; Received: from 97-122-190-66.hlrn.qwest.net ([97.122.190.66]:59802 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gSlU1-001JiZ-SN; Fri, 30 Nov 2018 10:17:37 -0600 From: Tom Tromey To: Eli Zaretskii Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH 00/16] Add styling to the gdb CLI and TUI References: <20181128001435.12703-1-tom@tromey.com> <83k1kxfzwo.fsf@gnu.org> <8736rja4i8.fsf@tromey.com> <83r2f3caje.fsf@gnu.org> Date: Fri, 30 Nov 2018 16:17:00 -0000 In-Reply-To: <83r2f3caje.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 30 Nov 2018 09:03:01 +0200") Message-ID: <87o9a61qvz.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2018-11/txt/msg00570.txt.bz2 >>>>> "Eli" == Eli Zaretskii writes: Tom> I think it should work, but you'd have to "set style enabled on" first. Eli> Maybe a TUI invocation should "set style enabled on" on all platforms? Eli> Or at least on those that use ncurses? That would possibly override the user's setting. It's probably better to simply implement the console support for Windows. Or, change how the disabling is done on Windows -- right now it is done by changing the default for this setting, but perhaps it could be done some other way. Is it possible to ssh in to a Windows machine and then use gdb? That's one scenario where you may want to keep the ANSI terminal escape sequences in the output. It also may affect how calls to the Windows API are handled. Eli> One problem with this approach is that it needs to fix the escape Eli> sequences for the relevant attributes, whereas AFAIU your code Eli> simply uses the terminfo that happens to be in effect, is that Eli> right? This patch series uses ANSI escape sequences for the styling; and the TUI decodes these and turns them into curses calls. Tom> Doing it that way can't work due to buffering. Eli> Not sure I understand. Console output is generally line-buffered, and Eli> there's fflush to force writing any buffered output before applying Eli> text attributes. Am I missing something? utils.c implements its own buffering. Previous to this series this was only done when "wrap_column > 0", but patch #1 changes this code to always buffer. This is a problem for other approaches because styles are emitted inline with other text; and then flushed as a unit. Tom> Also, this approach would be undesirable anyway, because GNU Source Tom> Highlight emits escape codes -- that's why I abandoned my earlier Tom> plan of implementing styling as objects in the utils.c buffer. Eli> What is GNU Source Highlight, and what is its relevance to the issue Eli> at hand? GNU Source Highlight is used to style source text. https://www.gnu.org/software/src-highlite/ Support for using it is added to gdb in patch #15. Tom> Instead, I think filtering the escape sequences is really the only Tom> way. Eli> The problem with that is that it hard-codes the SGR sequences concepts Eli> right into the design, and the escape sequences are unknown in advance Eli> on systems where there's no terminfo. Only terminals using the ANSI sequences are supported by this series, at least for the CLI. The TUI can support more in theory, though I have no way to test that. Tom