From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id B219C3857BA4; Wed, 15 Feb 2023 22:09:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B219C3857BA4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676498958; bh=8IzR2K9/wGXWkBOzDZmapChMhm22w7225GzgLJFzG/E=; h=From:To:Subject:Date:From; b=qNrOErxzTaBVbjLJG1Jm5+TEbLHg3bLZU/7Jwgymxih/hSYEcw0qfD2QbMfLiaFJ9 P1xKKQhqzUkdthUlAaltB+HVoxwSysu9+oPGbeOA5LdsY/D7IJu+N3zFL/k/n+BDEe cu1x9Wvzdx3TEyTAPM8Ns1Jtfgn0DH4VgGik23U8= 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_initialized to bool X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: a5b210cb6980f6aa38ae339aeef40c82799822a1 X-Git-Newrev: a7c27481a077a32c5a7c5bce11904a60dcec7feb Message-Id: <20230215220918.B219C3857BA4@sourceware.org> Date: Wed, 15 Feb 2023 22:09:18 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Da7c27481a077= a32c5a7c5bce11904a60dcec7feb commit a7c27481a077a32c5a7c5bce11904a60dcec7feb Author: Tom Tromey Date: Tue Feb 14 09:40:35 2023 -0700 Change value::m_initialized to bool =20 This changes value::m_initialized to be a bool and updates the various uses. =20 Reviewed-By: Bruno Larsen Diff: --- gdb/dwarf2/expr.c | 4 ++-- gdb/dwarf2/expr.h | 6 +++--- gdb/value.h | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gdb/dwarf2/expr.c b/gdb/dwarf2/expr.c index 60d9bf5f1f9..760c5c4b0d0 100644 --- a/gdb/dwarf2/expr.c +++ b/gdb/dwarf2/expr.c @@ -1496,7 +1496,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte = *op_ptr, type *address_type =3D this->address_type (); =20 this->m_location =3D DWARF_VALUE_MEMORY; - this->m_initialized =3D 1; /* Default is initialized. */ + this->m_initialized =3D true; /* Default is initialized. */ =20 if (this->m_recursion_depth > this->m_max_recursion_depth) error (_("DWARF-2 expression error: Loop detected (%d)."), @@ -2192,7 +2192,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte = *op_ptr, error (_("DWARF-2 expression error: DW_OP_GNU_uninit must always " "be the very last op.")); =20 - this->m_initialized =3D 0; + this->m_initialized =3D false; goto no_push; =20 case DW_OP_call2: diff --git a/gdb/dwarf2/expr.h b/gdb/dwarf2/expr.h index 44fc645116a..7a64316160e 100644 --- a/gdb/dwarf2/expr.h +++ b/gdb/dwarf2/expr.h @@ -164,9 +164,9 @@ private: ULONGEST m_len =3D 0; const gdb_byte *m_data =3D nullptr; =20 - /* Initialization status of variable: Non-zero if variable has been - initialized; zero otherwise. */ - int m_initialized =3D 0; + /* Initialization status of variable: True if variable has been + initialized; false otherwise. */ + bool m_initialized =3D false; =20 /* A vector of pieces. =20 diff --git a/gdb/value.h b/gdb/value.h index 233f42d32a0..41327ebe3b8 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -134,7 +134,7 @@ private: explicit value (struct type *type_) : m_modifiable (true), m_lazy (true), - m_initialized (1), + m_initialized (true), m_stack (0), m_is_zero (false), m_in_history (false), @@ -338,11 +338,11 @@ public: =20 /* Set or return field indicating whether a variable is initialized or not, based on debugging information supplied by the compiler. - 1 =3D initialized; 0 =3D uninitialized. */ - int initialized () const + true =3D initialized; false =3D uninitialized. */ + bool initialized () const { return m_initialized; } =20 - void set_initialized (int value) + void set_initialized (bool value) { m_initialized =3D value; } =20 /* If lval =3D=3D lval_memory, return the address in the inferior. If @@ -638,7 +638,7 @@ private: bool m_lazy : 1; =20 /* If value is a variable, is it initialized or not. */ - unsigned int m_initialized : 1; + bool m_initialized : 1; =20 /* If value is from the stack. If this is set, read_stack will be used instead of read_memory to enable extra caching. */