From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 6F82D3858D35 for ; Wed, 15 Feb 2023 11:53:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6F82D3858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676462036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XMFSDzORZ0cuY4Z0Cle52HHJabKFYui6TatM9SSmWOg=; b=NyLwpmWyJgriqRaH1+DhhbUyeTQAXo6GnmjEK9lF2zwytyPa49lch/m7E4hYkQRIafbYgD Ve8c/5rfoFA1qMiiLyOUegzcvlCW/cBH8zSqUlnCHzTDp8KO76gn5aczVgcp+RyZFouKXH Mw50Oimikne/u55iH1FZZdW72AE5Wrg= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-315-jH5VOFl2OHy_gpadflYYAQ-1; Wed, 15 Feb 2023 06:53:55 -0500 X-MC-Unique: jH5VOFl2OHy_gpadflYYAQ-1 Received: by mail-qv1-f70.google.com with SMTP id el6-20020ad459c6000000b0056ee2bc0c3eso533275qvb.6 for ; Wed, 15 Feb 2023 03:53:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XMFSDzORZ0cuY4Z0Cle52HHJabKFYui6TatM9SSmWOg=; b=19aDmSd9MU17PX+FH2IRCiAp0rpeZiIqyBZdRG2S+m3x40WevEsURAT0wflxaBHf08 ZD0t7QVZtqj9jjA6cLeuaZfQtvqqM4ufc3MDmpMbm+GGMo1Ri/DBOZbNwrNQSO26rpT8 4pz78lxwfORkEKofPW43I8J/kw2kQoGrGaXWuxp6/lN7ixbmd4DQR/PsrRmHTxGlzutk CuKG99M7MpZB88V5GScCMkNInJl30yLNcYL5/WMZZ9Erq6hs7n+asTPBSERPYI4OWNUU UGUh2gMC+fuhe0CQ4ZwCbBud2bNSs8DDMeq8Z4JlxkHMvgxz3Hd8Fk2bK/phV312SnHQ WCWw== X-Gm-Message-State: AO0yUKVFLWCCnbhFZ77EG9amN2LV0dzq7BMQYU2dpkmUmawbuYBiVCPs BSFekWsl0yWjoYBirhl/+Eab4rZ+2D/V4E2wSp3bPZISqn1PV0b+/ZwAYjc9mYAooXV6hq14hNs HZKz1M27tHhUw8tdThI06FPc3uGM= X-Received: by 2002:ac8:7f8f:0:b0:3b8:6db0:7564 with SMTP id z15-20020ac87f8f000000b003b86db07564mr2042444qtj.44.1676462034436; Wed, 15 Feb 2023 03:53:54 -0800 (PST) X-Google-Smtp-Source: AK7set+17FSLSxjSeirAcY57ukYZfINg0tQj1QBX6ODsv2XoUFYYAsmhFmPRhNL0ACq4rzKt/53DDw== X-Received: by 2002:ac8:7f8f:0:b0:3b8:6db0:7564 with SMTP id z15-20020ac87f8f000000b003b86db07564mr2042433qtj.44.1676462034137; Wed, 15 Feb 2023 03:53:54 -0800 (PST) Received: from [192.168.0.45] (ip-94-112-225-44.bb.vodafone.cz. [94.112.225.44]) by smtp.gmail.com with ESMTPSA id r77-20020a374450000000b0073b425f6e33sm6232783qka.100.2023.02.15.03.53.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Feb 2023 03:53:53 -0800 (PST) Message-ID: <33813bc9-334e-3bbb-1833-57d125fda634@redhat.com> Date: Wed, 15 Feb 2023 12:53:52 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH 2/6] Change value::m_lazy to bool To: Tom Tromey , gdb-patches@sourceware.org References: <20230214-submit-more-value-stuff-v1-0-2fb85efbaa72@tromey.com> <20230214-submit-more-value-stuff-v1-2-2fb85efbaa72@tromey.com> From: Bruno Larsen In-Reply-To: <20230214-submit-more-value-stuff-v1-2-2fb85efbaa72@tromey.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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: On 14/02/2023 21:23, Tom Tromey wrote: > This changes value::m_lazy to be a bool and updates the various uses. You've missed an occurrence of val->m_lazy = 0 on the function value::allocate in gdb/value.c Other than that, Reviewed-By: Bruno Larsen -- Cheers, Bruno > --- > 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; >