[20/26] gdbserver: make some regcache fields private

Message ID e212bf44ab32c693e1b46a696afd1666c0d090dc.1677582745.git.tankut.baris.aktemur@intel.com
State New
Headers
Series gdbserver: refactor regcache and allow gradually populating |

Commit Message

Tankut Baris Aktemur Feb. 28, 2023, 11:28 a.m. UTC
  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(+)
  

Patch

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);