From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id A31313858C31; Wed, 15 Feb 2023 22:09:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A31313858C31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676498953; bh=sxujXDnQJ4HJvODjh1yWy0XTDDQc546J9bS3/VJiPME=; h=From:To:Subject:Date:From; b=LWE7eZGMoNm1lLa7GSigNJX2iC8kJIoakMme4n6ehn2m/wOzCuBLk/NDsc3XEpVfy d2vDmvhkDxzh0Bd9RH7RZbOkQ08x6RUgcDKb1Kj6gRguMFKe7TdsVT5y1PMy0rM07l O8RdAGpo5qctLT16zBvl8BjLUMpxH+y9/D9GByx0= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Change value::m_lazy to bool X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: b2227e67b4bdee65b1240f725dd2ea214178d984 X-Git-Newrev: a5b210cb6980f6aa38ae339aeef40c82799822a1 Message-Id: <20230215220913.A31313858C31@sourceware.org> Date: Wed, 15 Feb 2023 22:09:13 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Da5b210cb6980= f6aa38ae339aeef40c82799822a1 commit a5b210cb6980f6aa38ae339aeef40c82799822a1 Author: Tom Tromey Date: Tue Feb 14 09:37:47 2023 -0700 Change value::m_lazy to bool =20 This changes value::m_lazy to be a bool and updates the various uses. =20 Reviewed-By: Bruno Larsen Diff: --- gdb/dwarf2/loc.c | 2 +- gdb/gnu-v2-abi.c | 2 +- gdb/valops.c | 2 +- gdb/value.c | 8 ++++---- gdb/value.h | 16 ++++++++-------- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c index 27c4b7ce31a..0ab54abea9a 100644 --- a/gdb/dwarf2/loc.c +++ b/gdb/dwarf2/loc.c @@ -1366,7 +1366,7 @@ value_of_dwarf_reg_entry (struct type *type, frame_in= fo_ptr frame, memcpy (val->contents_raw ().data (), outer_val->contents_raw ().data (), checked_type->length ()); - val->set_lazy (0); + val->set_lazy (false); =20 return val; } diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c index fa46d474914..6afa1795ebd 100644 --- a/gdb/gnu-v2-abi.c +++ b/gdb/gnu-v2-abi.c @@ -163,7 +163,7 @@ gnuv2_virtual_fn_field (struct value **arg1p, struct fn= _field * f, int j, =20 if (!arg1->lazy ()) { - arg1->set_lazy (1); + arg1->set_lazy (true); arg1->fetch_lazy (); } =20 diff --git a/gdb/valops.c b/gdb/valops.c index 3901053c7d5..90f7b8c5532 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -1343,7 +1343,7 @@ value_assign (struct value *toval, struct value *from= val) information, but its contents are updated from FROMVAL. This implies the returned value is not lazy, even if TOVAL was. */ val =3D toval->copy (); - val->set_lazy (0); + val->set_lazy (false); copy (fromval->contents (), val->contents_raw ()); =20 /* We copy over the enclosing type and pointed-to offset from FROMVAL diff --git a/gdb/value.c b/gdb/value.c index 2dc2dabd790..ee35f705228 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -939,7 +939,7 @@ value::allocate (struct type *type, bool check_size) struct value *val =3D value::allocate_lazy (type); =20 val->allocate_contents (check_size); - val->m_lazy =3D 0; + val->m_lazy =3D false; return val; } =20 @@ -991,7 +991,7 @@ value::allocate_optimized_out (struct type *type) struct value *retval =3D value::allocate_lazy (type); =20 retval->mark_bytes_optimized_out (0, type->length ()); - retval->set_lazy (0); + retval->set_lazy (false); return retval; } =20 @@ -3815,7 +3815,7 @@ value::fetch_lazy_register () =20 /* Copy the contents and the unavailability/optimized-out meta-data from NEW_VAL to VAL. */ - set_lazy (0); + set_lazy (false); new_val->contents_copy (this, embedded_offset (), new_val->embedded_offset (), type_length_units (type)); @@ -3899,7 +3899,7 @@ value::fetch_lazy () else internal_error (_("Unexpected lazy value type.")); =20 - set_lazy (0); + set_lazy (false); } =20 /* Implementation of the convenience function $_isvoid. */ diff --git a/gdb/value.h b/gdb/value.h index 92247185cd0..233f42d32a0 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -133,7 +133,7 @@ private: /* Values can only be created via "static constructors". */ explicit value (struct type *type_) : m_modifiable (true), - m_lazy (1), + m_lazy (true), m_initialized (1), m_stack (0), m_is_zero (false), @@ -247,8 +247,8 @@ public: void set_embedded_offset (LONGEST val) { m_embedded_offset =3D val; } =20 - /* If zero, contents of this value are in the contents field. If - nonzero, contents are in inferior. If the lval field is lval_memory, + /* If false, contents of this value are in the contents field. If + true, contents are in inferior. If the lval field is lval_memory, the contents are in inferior memory at location.address plus offset. The lval field may also be lval_register. =20 @@ -262,10 +262,10 @@ public: element. If you ever change the way lazy flag is set and reset, be sure to consider this use as well! */ =20 - int lazy () const + bool lazy () const { return m_lazy; } =20 - void set_lazy (int val) + void set_lazy (bool val) { m_lazy =3D val; } =20 /* If a value represents a C++ object, then the `type' field gives the @@ -621,8 +621,8 @@ private: /* Is it modifiable? Only relevant if lval !=3D not_lval. */ bool m_modifiable : 1; =20 - /* If zero, contents of this value are in the contents field. If - nonzero, contents are in inferior. If the lval field is lval_memory, + /* If false, contents of this value are in the contents field. If + true, contents are in inferior. If the lval field is lval_memory, the contents are in inferior memory at location.address plus offset. The lval field may also be lval_register. =20 @@ -635,7 +635,7 @@ private: or array when the user wants to watch a single struct member or array element. If you ever change the way lazy flag is set and reset, be sure to consider this use as well! */ - unsigned int m_lazy : 1; + bool m_lazy : 1; =20 /* If value is a variable, is it initialized or not. */ unsigned int m_initialized : 1;