From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47352 invoked by alias); 23 Jun 2019 22:43:41 -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 47325 invoked by uid 89); 23 Jun 2019 22:43:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=Window, fan, syntax, HX-Languages-Length:2145 X-HELO: gateway31.websitewelcome.com Received: from gateway31.websitewelcome.com (HELO gateway31.websitewelcome.com) (192.185.143.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 23 Jun 2019 22:43:39 +0000 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway31.websitewelcome.com (Postfix) with ESMTP id B9C84D9D3 for ; Sun, 23 Jun 2019 17:43:37 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id fBCzh9EImiQerfBCzhf4rj; Sun, 23 Jun 2019 17:43:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:MIME-Version :Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=+2S4F7VGMuT8awT+9qb/lI2FIDq9fKO91BvLhB5elSM=; b=yCje+K6cYTuNdCiAF1mcxjSY1z pAcNCyF7W0T9rFKTZkHR4DcUvCXozsLrCJr2LeTCwPYZTJj/iRvg7RF2/a6bep+HFpMDZrEbgiQJZ Z75HomhE3X0JNH3fkl5743Iok; Received: from 75-166-12-78.hlrn.qwest.net ([75.166.12.78]:54396 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hfBCz-000vDQ-HC for gdb-patches@sourceware.org; Sun, 23 Jun 2019 17:43:37 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Subject: [PATCH 00/66] Clean up the TUI Date: Sun, 23 Jun 2019 22:43:00 -0000 Message-Id: <20190623224329.16060-1-tom@tromey.com> X-SW-Source: 2019-06/txt/msg00467.txt.bz2 My first real encounter with the TUI code was last year, when I added syntax styling to it. On the one hand, this experience convinced me that this code was some of the ugliest in gdb. It uses two different unions at different spots in the conceptual class hierarchy, leading to very obscure code. It also hard-codes both the possible window types but also the qpossible layout types in a brittle and unextensible way. On the other hand, working on the TUI changed my mind about the TUI generally. I've become a fan. I think it would be good to improve the TUI for users, but to do that I think we first have to improve its code. This series is a start at this. It's already quite long, unfortunately, and yet is still incomplete. Still, I think it is progress. This series: * Splits tui_win_info into subclasses, one per window type. * Adds virtual methods, particularly in an attempt to remove all the code that switches based on the type of the window. This is important to make it simpler to add new window types. * Changes tui_gen_win_info into a real base class for tui_win_info. * Removes the uses of unions from the window class hierarchy. * Simplifies and C++-ifies various other minor things along the way. There is still a ways to go, I only stopped here in the interest of review sanity. In particular: * Window layouts should be first-class entities that do not involve hard-coding the possible layouts in the C++. * tui_win_list should be changed to allow multiple types of windows. * The few remaining checks of the various *_WIN constants should be removed. I think once these things are done it should be possible to move on to making useful user-visible changes, like allowing custom layouts, or allowing custom windows to be written in Python. I tested this by trying the various TUI features by hand. However, I'm not sure I managed to test them all. I've also run the gdb.tui part of the test suite, though that does not really test very much. This series fixes one latent bug that I found with valgrind. I found two other existing bugs as well, but those I simply filed. Tom