From patchwork Sat Aug 3 13:29:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33944 Received: (qmail 96156 invoked by alias); 3 Aug 2019 13:29:40 -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 95499 invoked by uid 89); 3 Aug 2019 13:29:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.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=Window, 2426 X-HELO: gateway33.websitewelcome.com Received: from gateway33.websitewelcome.com (HELO gateway33.websitewelcome.com) (192.185.145.190) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 03 Aug 2019 13:29:34 +0000 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway33.websitewelcome.com (Postfix) with ESMTP id 96A195AC8D for ; Sat, 3 Aug 2019 08:29:33 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id tu6Hhg5KJdnCetu6Hh8XYp; Sat, 03 Aug 2019 08:29:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To: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:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=5yYhlnf0c3pfgj30Tx4QUm6F8vY2uH8kxU77Ec2PV0Y=; b=hPYFZpVYg7I/hE/NLZFEvXxcaH t416d5zgM+8MvSRM6UsdyjLbIrQ3njLLtprPNZZ4KQUMeaCZ3lmIva2pqUvCvUvrwHbVmUPNyRgxG xk2RVfaXf6CgseOAYIt9kkLVA; Received: from 97-122-178-82.hlrn.qwest.net ([97.122.178.82]:36980 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1htu6H-003nqS-CS; Sat, 03 Aug 2019 08:29:33 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 14/19] Move code to tui-winsource.h Date: Sat, 3 Aug 2019 07:29:20 -0600 Message-Id: <20190803132925.25074-15-tom@tromey.com> In-Reply-To: <20190803132925.25074-1-tom@tromey.com> References: <20190803132925.25074-1-tom@tromey.com> This moves code related to the execution info window from tui-data.h to tui-winsource.h. It fits better here because the execution info is conceptually part of the source and disassembly windows, and tui-winsource.h is where this common class lives. gdb/ChangeLog 2019-08-03 Tom Tromey * tui/tui-data.h (enum tui_bp_flag, tui_bp_flags, struct tui_source_element) (TUI_BP_HIT_POS, TUI_BP_BREAK_POS, TUI_EXEC_POS) (TUI_EXECINFO_SIZE, tui_exec_info_content): Move ... * tui/tui-winsource.h (enum tui_bp_flag, tui_bp_flags, struct tui_source_element, TUI_BP_HIT_POS, TUI_BP_BREAK_POS) (TUI_EXEC_POS, TUI_EXECINFO_SIZE, tui_exec_info_content): ... here. --- gdb/ChangeLog | 10 ++++++++++ gdb/tui/tui-data.h | 41 ----------------------------------------- gdb/tui/tui-winsource.h | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 41 deletions(-) diff --git a/gdb/tui/tui-data.h b/gdb/tui/tui-data.h index 6683848bc18..08178e49ea8 100644 --- a/gdb/tui/tui-data.h +++ b/gdb/tui/tui-data.h @@ -151,53 +151,12 @@ struct tui_line_or_address } u; }; -/* Flags to tell what kind of breakpoint is at current line. */ -enum tui_bp_flag -{ - TUI_BP_ENABLED = 0x01, - TUI_BP_DISABLED = 0x02, - TUI_BP_HIT = 0x04, - TUI_BP_CONDITIONAL = 0x08, - TUI_BP_HARDWARE = 0x10 -}; - -DEF_ENUM_FLAGS_TYPE (enum tui_bp_flag, tui_bp_flags); - -/* Elements in the Source/Disassembly Window. */ -struct tui_source_element -{ - tui_source_element () - { - line_or_addr.loa = LOA_LINE; - line_or_addr.u.line_no = 0; - } - - ~tui_source_element () - { - xfree (line); - } - - char *line = nullptr; - struct tui_line_or_address line_or_addr; - bool is_exec_point = false; - tui_bp_flags break_mode = 0; -}; - - #ifdef PATH_MAX # define MAX_LOCATOR_ELEMENT_LEN PATH_MAX #else # define MAX_LOCATOR_ELEMENT_LEN 1024 #endif -/* Position of breakpoint markers in the exec info string. */ -#define TUI_BP_HIT_POS 0 -#define TUI_BP_BREAK_POS 1 -#define TUI_EXEC_POS 2 -#define TUI_EXECINFO_SIZE 4 - -typedef char tui_exec_info_content[TUI_EXECINFO_SIZE]; - /* Locator window class. */ struct tui_locator_window : public tui_gen_win_info diff --git a/gdb/tui/tui-winsource.h b/gdb/tui/tui-winsource.h index bce889d5abe..71201e51d89 100644 --- a/gdb/tui/tui-winsource.h +++ b/gdb/tui/tui-winsource.h @@ -24,6 +24,26 @@ #include "tui/tui-data.h" +/* Flags to tell what kind of breakpoint is at current line. */ +enum tui_bp_flag +{ + TUI_BP_ENABLED = 0x01, + TUI_BP_DISABLED = 0x02, + TUI_BP_HIT = 0x04, + TUI_BP_CONDITIONAL = 0x08, + TUI_BP_HARDWARE = 0x10 +}; + +DEF_ENUM_FLAGS_TYPE (enum tui_bp_flag, tui_bp_flags); + +/* Position of breakpoint markers in the exec info string. */ +#define TUI_BP_HIT_POS 0 +#define TUI_BP_BREAK_POS 1 +#define TUI_EXEC_POS 2 +#define TUI_EXECINFO_SIZE 4 + +typedef char tui_exec_info_content[TUI_EXECINFO_SIZE]; + /* Execution info window class. */ struct tui_exec_info_window : public tui_gen_win_info @@ -52,6 +72,27 @@ private: tui_exec_info_content *m_content = nullptr; }; +/* Elements in the Source/Disassembly Window. */ +struct tui_source_element +{ + tui_source_element () + { + line_or_addr.loa = LOA_LINE; + line_or_addr.u.line_no = 0; + } + + ~tui_source_element () + { + xfree (line); + } + + char *line = nullptr; + struct tui_line_or_address line_or_addr; + bool is_exec_point = false; + tui_bp_flags break_mode = 0; +}; + + /* The base class for all source-like windows, namely the source and disassembly windows. */