From patchwork Fri Dec 27 16:50:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 37106 Received: (qmail 25529 invoked by alias); 27 Dec 2019 16:50:07 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 25516 invoked by uid 89); 27 Dec 2019 16:50:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=ctrl, Reset, alone, 5726 X-HELO: gateway21.websitewelcome.com Received: from gateway21.websitewelcome.com (HELO gateway21.websitewelcome.com) (192.185.46.109) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 27 Dec 2019 16:50:05 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway21.websitewelcome.com (Postfix) with ESMTP id E8EC7400EBB6F for ; Fri, 27 Dec 2019 10:50:03 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id ksoNiZy1e3Qi0ksoNiPgWK; Fri, 27 Dec 2019 10:50:03 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: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=jkGunNBNX0RWPLtrjLHhbYtBVTSolWzhDum0xcvLpYQ=; b=cFz4UfbRRG1LFmEhOsLBUNRWhL 8Z7P6gTDZ20fG8JJqUBKY9wa5Lq8JCQdLgbzPR2SFbJ4KVeR1BVMr9s89L2lT5wpq4wZgfhTS0Koy zURBlBEKY3H0QuEN/LoJIGr8B; Received: from 75-166-123-50.hlrn.qwest.net ([75.166.123.50]:36632 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1iksoN-001zsw-PR; Fri, 27 Dec 2019 09:50:03 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [FYI] Remove dead code from TUI Date: Fri, 27 Dec 2019 09:50:00 -0700 Message-Id: <20191227165000.32604-1-tom@tromey.com> I found some dead code in the TUI -- some using #if 0, and some commented-out code. There's no reason to keep this, so this patch removes it. gdb/ChangeLog 2019-12-27 Tom Tromey * tui/tui-source.c (tui_source_window::do_scroll_vertical): Remove commented-out code. * tui/tui.c: Remove #if 0 code. Change-Id: Ie00933b2ba498417ce22e5da3f62f5a40c234f33 --- gdb/ChangeLog | 6 +++++ gdb/tui/tui-source.c | 2 -- gdb/tui/tui.c | 56 -------------------------------------------- 3 files changed, 6 insertions(+), 58 deletions(-) diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c index 2d8ecee7473..700a37ada26 100644 --- a/gdb/tui/tui-source.c +++ b/gdb/tui/tui-source.c @@ -151,8 +151,6 @@ tui_source_window::do_scroll_vertical (int num_to_scroll) const std::vector *offsets; if (g_source_cache.get_line_charpos (s, &offsets) && l.u.line_no > offsets->size ()) - /* line = s->nlines - win_info->content_size + 1; */ - /* elz: fix for dts 23398. */ l.u.line_no = start_line_or_addr.u.line_no; if (l.u.line_no <= 0) l.u.line_no = 1; diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index 0ebe846e0d3..6fdfa4579f1 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -44,9 +44,6 @@ #include #include #include -#if 0 -#include -#endif #include #include "gdb_curses.h" @@ -575,59 +572,6 @@ tui_disable_command (const char *args, int from_tty) tui_disable (); } -#if 0 -/* Solaris defines CTRL. */ -#ifndef CTRL -#define CTRL(x) (x & ~0140) -#endif - -#define FILEDES 2 -#define CHK(val, dft) (val<=0 ? dft : val) - -static void -tui_reset (void) -{ - struct termio mode; - - /* Reset the teletype mode bits to a sensible state. - Copied tset.c. */ -#if defined (TIOCGETC) - struct tchars tbuf; -#endif /* TIOCGETC */ -#ifdef UCB_NTTY - struct ltchars ltc; - - if (ldisc == NTTYDISC) - { - ioctl (FILEDES, TIOCGLTC, <c); - ltc.t_suspc = CHK (ltc.t_suspc, CTRL ('Z')); - ltc.t_dsuspc = CHK (ltc.t_dsuspc, CTRL ('Y')); - ltc.t_rprntc = CHK (ltc.t_rprntc, CTRL ('R')); - ltc.t_flushc = CHK (ltc.t_flushc, CTRL ('O')); - ltc.t_werasc = CHK (ltc.t_werasc, CTRL ('W')); - ltc.t_lnextc = CHK (ltc.t_lnextc, CTRL ('V')); - ioctl (FILEDES, TIOCSLTC, <c); - } -#endif /* UCB_NTTY */ -#ifdef TIOCGETC - ioctl (FILEDES, TIOCGETC, &tbuf); - tbuf.t_intrc = CHK (tbuf.t_intrc, CTRL ('?')); - tbuf.t_quitc = CHK (tbuf.t_quitc, CTRL ('\\')); - tbuf.t_startc = CHK (tbuf.t_startc, CTRL ('Q')); - tbuf.t_stopc = CHK (tbuf.t_stopc, CTRL ('S')); - tbuf.t_eofc = CHK (tbuf.t_eofc, CTRL ('D')); - /* brkc is left alone. */ - ioctl (FILEDES, TIOCSETC, &tbuf); -#endif /* TIOCGETC */ - mode.sg_flags &= ~(RAW -#ifdef CBREAK - | CBREAK -#endif /* CBREAK */ - | VTDELAY | ALLDELAY); - mode.sg_flags |= XTABS | ECHO | CRMOD | ANYP; -} -#endif - void tui_show_assembly (struct gdbarch *gdbarch, CORE_ADDR addr) {