From patchwork Tue Feb 28 11:28:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aktemur, Tankut Baris" X-Patchwork-Id: 65758 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8B8B1383E81B for ; Tue, 28 Feb 2023 11:32:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B8B1383E81B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677583953; bh=TYzSRzRTkDHELmW0IsRy873PV+2s8m5mEY/j7geawb8=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Nc9V4rnJK1FEk6kgvaNGxqUsHdxpYD7Uuab0wTUlc01K/re5owWsXUveALdiHS9F+ PqyQFZOEe/mYM2y0i7TdaApImoFt3fPu1wmTsAjBAvLz2i5vt1tVnhPaMJO4tztWe/ VmSYzXy5N9wXxG+Z0xUzIsgWsrZY9dRUmijBnXqI= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by sourceware.org (Postfix) with ESMTPS id 347C03850229 for ; Tue, 28 Feb 2023 11:30:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 347C03850229 X-IronPort-AV: E=McAfee;i="6500,9779,10634"; a="313785167" X-IronPort-AV: E=Sophos;i="5.98,221,1673942400"; d="scan'208";a="313785167" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 03:30:52 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10634"; a="623992214" X-IronPort-AV: E=Sophos;i="5.98,221,1673942400"; d="scan'208";a="623992214" Received: from ultl2604.iul.intel.com (HELO localhost) ([172.28.48.47]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 03:30:51 -0800 To: gdb-patches@sourceware.org Subject: [PATCH 20/26] gdbserver: make some regcache fields private Date: Tue, 28 Feb 2023 12:28:18 +0100 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tankut Baris Aktemur via Gdb-patches From: "Aktemur, Tankut Baris" Reply-To: Tankut Baris Aktemur Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" Some fields of the regcache struct are used for internal state tracking. Prevent direct access to them from outside by making them private. --- gdbserver/regcache.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gdbserver/regcache.h b/gdbserver/regcache.h index ad71a9acaec..be412bc3765 100644 --- a/gdbserver/regcache.h +++ b/gdbserver/regcache.h @@ -36,6 +36,8 @@ struct regcache : public reg_buffer_common /* Back-link to the thread to which this regcache belongs. */ thread_info *thread = nullptr; +private: + /* Whether the REGISTERS buffer's contents are fetched. If false, we haven't fetched the registers from the target yet. Note that this register cache is _not_ pass-through, unlike GDB's. Also, @@ -49,6 +51,8 @@ struct regcache : public reg_buffer_common /* See gdbsupport/common-regcache.h. */ enum register_status *register_status = nullptr; +public: + /* Constructors. */ regcache () = default; regcache (const target_desc *tdesc); @@ -59,6 +63,8 @@ struct regcache : public reg_buffer_common virtual ~regcache (); #endif +public: + /* Init the regcache data. */ void initialize (const target_desc *tdesc, unsigned char *regbuf);