From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from alt-proxy28.mail.unifiedlayer.com (alt-proxy28.mail.unifiedlayer.com [74.220.216.123]) by sourceware.org (Postfix) with ESMTPS id 309863858D35 for ; Tue, 14 Feb 2023 20:23:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 309863858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com Received: from cmgw10.mail.unifiedlayer.com (unknown [10.0.90.125]) by progateway1.mail.pro1.eigbox.com (Postfix) with ESMTP id A42A5100389E9 for ; Tue, 14 Feb 2023 20:23:40 +0000 (UTC) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTP id S1q0pOO7RA1zNS1q0pAuVm; Tue, 14 Feb 2023 20:23:40 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=CqN6zl0D c=1 sm=1 tr=0 ts=63ebedcc a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10:nop_charset_1 a=m04uMKEZRckA:10:nop_rcvd_month_year a=Qbun_eYptAEA:10:endurance_base64_authed_username_1 a=5HGvlBD7qXdGYqwDoaAA:9 a=QEXdDO2ut3YA:10:nop_charset_2 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=pyLNtscVrT+fgtFoIyYXzoXcTyP8rFdOpJNS5QxFhAQ=; b=DOCjLiKqttVD1wuqxBKVIuQ9Si qKCVFTfppzTd9lXHYL3lhGeEwoWbSpWjVkY/TdCEMfrs2Vu/f370hRssCdBZMGSuMk/7Dao2WRZmX t0KjFlFZvlpxAIDuxNmi3YFqw; Received: from 75-166-130-93.hlrn.qwest.net ([75.166.130.93]:49794 helo=[192.168.0.21]) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pS1q0-002zny-Gq for gdb-patches@sourceware.org; Tue, 14 Feb 2023 13:23:40 -0700 From: Tom Tromey Date: Tue, 14 Feb 2023 13:23:32 -0700 Subject: [PATCH 2/6] Change value::m_lazy to bool MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230214-submit-more-value-stuff-v1-2-2fb85efbaa72@tromey.com> References: <20230214-submit-more-value-stuff-v1-0-2fb85efbaa72@tromey.com> In-Reply-To: <20230214-submit-more-value-stuff-v1-0-2fb85efbaa72@tromey.com> To: gdb-patches@sourceware.org X-Mailer: b4 0.12.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 75.166.130.93 X-Source-L: No X-Exim-ID: 1pS1q0-002zny-Gq X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 75-166-130-93.hlrn.qwest.net ([192.168.0.21]) [75.166.130.93]:49794 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3027.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,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 List-Id: This changes value::m_lazy to be a bool and updates the various uses. --- gdb/dwarf2/loc.c | 2 +- gdb/gnu-v2-abi.c | 2 +- gdb/valops.c | 2 +- gdb/value.c | 6 +++--- gdb/value.h | 16 ++++++++-------- 5 files changed, 14 insertions(+), 14 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_info_ptr frame, memcpy (val->contents_raw ().data (), outer_val->contents_raw ().data (), checked_type->length ()); - val->set_lazy (0); + val->set_lazy (false); 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, if (!arg1->lazy ()) { - arg1->set_lazy (1); + arg1->set_lazy (true); arg1->fetch_lazy (); } 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 *fromval) information, but its contents are updated from FROMVAL. This implies the returned value is not lazy, even if TOVAL was. */ val = toval->copy (); - val->set_lazy (0); + val->set_lazy (false); copy (fromval->contents (), val->contents_raw ()); /* We copy over the enclosing type and pointed-to offset from FROMVAL diff --git a/gdb/value.c b/gdb/value.c index b027b63ee48..855354f542f 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -990,7 +990,7 @@ value::allocate_optimized_out (struct type *type) struct value *retval = value::allocate_lazy (type); retval->mark_bytes_optimized_out (0, type->length ()); - retval->set_lazy (0); + retval->set_lazy (false); return retval; } @@ -3809,7 +3809,7 @@ value::fetch_lazy_register () /* 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)); @@ -3893,7 +3893,7 @@ value::fetch_lazy () else internal_error (_("Unexpected lazy value type.")); - set_lazy (0); + set_lazy (false); } /* 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 @@ struct value /* 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 @@ struct value void set_embedded_offset (LONGEST val) { m_embedded_offset = val; } - /* 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. @@ -262,10 +262,10 @@ struct value element. If you ever change the way lazy flag is set and reset, be sure to consider this use as well! */ - int lazy () const + bool lazy () const { return m_lazy; } - void set_lazy (int val) + void set_lazy (bool val) { m_lazy = val; } /* If a value represents a C++ object, then the `type' field gives the @@ -621,8 +621,8 @@ struct value /* Is it modifiable? Only relevant if lval != not_lval. */ 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, + /* 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. @@ -635,7 +635,7 @@ struct value 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; /* If value is a variable, is it initialized or not. */ unsigned int m_initialized : 1; -- 2.39.1