]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Change value::m_modifiable to bool
authorTom Tromey <tom@tromey.com>
Tue, 14 Feb 2023 16:34:53 +0000 (09:34 -0700)
committerTom Tromey <tom@tromey.com>
Wed, 15 Feb 2023 22:07:07 +0000 (15:07 -0700)
This changes value::m_modifiable to be a bool and updates the various
uses.

Reviewed-By: Bruno Larsen <blarsen@redhat.com>
gdb/breakpoint.c
gdb/ppc-linux-nat.c
gdb/value.c
gdb/value.h

index 3b9aebc56056deaba3b11d42f93e403c75b42f7f..b1922fc1e98fd065e9775a3d4643820bb8fe3337 100644 (file)
@@ -10450,8 +10450,7 @@ can_use_hardware_watchpoint (const std::vector<value_ref_ptr> &vals)
                }
            }
        }
-      else if (v->lval () != not_lval
-              && v->deprecated_modifiable () == 0)
+      else if (v->lval () != not_lval && !v->deprecated_modifiable ())
        return 0;       /* These are values from the history (e.g., $1).  */
       else if (v->lval () == lval_register)
        return 0;       /* Cannot watch a register with a HW watchpoint.  */
index 32c0177228ad4c6d575b27977981a322d5fbfff2..494e9bf61199bde200f75b1f7054261efafac1e8 100644 (file)
@@ -2455,7 +2455,7 @@ ppc_linux_nat_target::num_memory_accesses (const std::vector<value_ref_ptr>
       struct value *v = iter.get ();
 
       /* Constants and values from the history are fine.  */
-      if (v->lval () == not_lval || v->deprecated_modifiable () == 0)
+      if (v->lval () == not_lval || !v->deprecated_modifiable ())
        continue;
       else if (v->lval () == lval_memory)
        {
index 34a282b9746508f75ba8b943626381e0246f293c..2dc2dabd790d28c61f6e31450e11e62237a12274 100644 (file)
@@ -1677,7 +1677,7 @@ value::record_latest ()
   /* We preserve VALUE_LVAL so that the user can find out where it was fetched
      from.  This is a bit dubious, because then *&$1 does not just return $1
      but the current contents of that location.  c'est la vie...  */
-  set_modifiable (0);
+  set_modifiable (false);
 
   value_history.push_back (release_value (this));
 
@@ -2174,7 +2174,7 @@ set_internalvar (struct internalvar *var, struct value *val)
     default:
       new_kind = INTERNALVAR_VALUE;
       struct value *copy = val->copy ();
-      copy->set_modifiable (1);
+      copy->set_modifiable (true);
 
       /* Force the value to be fetched from the target now, to avoid problems
         later when this internalvar is referenced and the target is gone or
@@ -2498,7 +2498,7 @@ value::from_xmethod (xmethod_worker_up &&worker)
   v = value::allocate (builtin_type (target_gdbarch ())->xmethod);
   v->m_lval = lval_xcallable;
   v->m_location.xm_worker = worker.release ();
-  v->m_modifiable = 0;
+  v->m_modifiable = false;
 
   return v;
 }
index 8b45f7fdee878b2b9d242247966b7b630978662c..92247185cd092ebfab928976dc1e8862a993195b 100644 (file)
@@ -132,7 +132,7 @@ private:
 
   /* Values can only be created via "static constructors".  */
   explicit value (struct type *type_)
-    : m_modifiable (1),
+    : m_modifiable (true),
       m_lazy (1),
       m_initialized (1),
       m_stack (0),
@@ -228,11 +228,11 @@ public:
   /* The comment from "struct value" reads: ``Is it modifiable?  Only
      relevant if lval != not_lval.''.  Shouldn't the value instead be
      not_lval and be done with it?  */
-  int deprecated_modifiable () const
+  bool deprecated_modifiable () const
   { return m_modifiable; }
 
   /* Set or clear the modifiable flag.  */
-  void set_modifiable (int val)
+  void set_modifiable (bool val)
   { m_modifiable = val; }
 
   LONGEST pointed_to_offset () const
@@ -619,7 +619,7 @@ private:
   enum lval_type m_lval = not_lval;
 
   /* Is it modifiable?  Only relevant if lval != not_lval.  */
-  unsigned int m_modifiable : 1;
+  bool m_modifiable : 1;
 
   /* If zero, contents of this value are in the contents field.  If
      nonzero, contents are in inferior.  If the lval field is lval_memory,