From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gproxy1-pub.mail.unifiedlayer.com (gproxy1-pub.mail.unifiedlayer.com [69.89.25.95]) by sourceware.org (Postfix) with ESMTPS id EB996385B534 for ; Mon, 13 Feb 2023 03:15:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EB996385B534 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 cmgw11.mail.unifiedlayer.com (unknown [10.0.90.126]) by progateway3.mail.pro1.eigbox.com (Postfix) with ESMTP id 65DAF100480F5 for ; Mon, 13 Feb 2023 03:15:30 +0000 (UTC) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTP id RPJSpJ4yKjkdRRPJSpCxiy; Mon, 13 Feb 2023 03:15:30 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=LPqj/La9 c=1 sm=1 tr=0 ts=63e9ab52 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=zrrbmALDYAWZkxnlKlQA: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=YNXaI1/iWWQnzS1OUNn5W5Ac+sZmAAvT72Nm3u09qxQ=; b=FVlAqZ+JUqZXURB25VM7i/dBPs 2KH+TQES3JOj1tjtq28zR9uBqOZAhDihxCEZweyInqiDqYsdFMpGNrC2NPjS8kUYs1lGyIOs9UV+j sq2oqAJ78W4ap9SGgFQPTvSkO; Received: from 75-166-130-93.hlrn.qwest.net ([75.166.130.93]:37668 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 1pRPJS-001AGJ-6m for gdb-patches@sourceware.org; Sun, 12 Feb 2023 20:15:30 -0700 From: Tom Tromey Date: Sun, 12 Feb 2023 20:15:44 -0700 Subject: [PATCH v3 28/50] Turn value_fetch_lazy into a method MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230209-submit-value-fixups-2023-v3-28-45e91a20c742@tromey.com> References: <20230209-submit-value-fixups-2023-v3-0-45e91a20c742@tromey.com> In-Reply-To: <20230209-submit-value-fixups-2023-v3-0-45e91a20c742@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: 1pRPJS-001AGJ-6m 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]:37668 X-Source-Auth: tom+tromey.com X-Email-Count: 58 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3027.4 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_fetch_lazy to be a method of value. A few helper functions are converted as well, to avoid problems in later patches when the data members are all made private. --- gdb/ada-lang.c | 4 +- gdb/ada-valprint.c | 2 +- gdb/eval.c | 6 +-- gdb/findvar.c | 2 +- gdb/gnu-v2-abi.c | 2 +- gdb/guile/scm-pretty-print.c | 2 +- gdb/guile/scm-value.c | 2 +- gdb/python/py-prettyprint.c | 2 +- gdb/python/py-value.c | 2 +- gdb/rust-lang.c | 2 +- gdb/stack.c | 10 ++-- gdb/valops.c | 2 +- gdb/valprint.c | 2 +- gdb/value.c | 124 ++++++++++++++++++++----------------------- gdb/value.h | 20 ++++++- gdb/varobj.c | 2 +- 16 files changed, 98 insertions(+), 88 deletions(-) diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 274b5e3ce03..7f962200a1f 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -10853,7 +10853,7 @@ ada_var_msym_value_operation::evaluate_for_cast (struct type *expect_type, if (VALUE_LVAL (val) == lval_memory) { if (val->lazy ()) - value_fetch_lazy (val); + val->fetch_lazy (); VALUE_LVAL (val) = not_lval; } return val; @@ -10875,7 +10875,7 @@ ada_var_value_operation::evaluate_for_cast (struct type *expect_type, if (VALUE_LVAL (val) == lval_memory) { if (val->lazy ()) - value_fetch_lazy (val); + val->fetch_lazy (); VALUE_LVAL (val) = not_lval; } return val; diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index 814678ea0e1..05d30649887 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -983,7 +983,7 @@ ada_val_print_ref (struct type *type, const gdb_byte *valaddr, deref_val = ada_tag_value_at_base_address (deref_val); if (deref_val->lazy ()) - value_fetch_lazy (deref_val); + deref_val->fetch_lazy (); common_val_print (deref_val, stream, recurse + 1, options, language_def (language_ada)); diff --git a/gdb/eval.c b/gdb/eval.c index fbc72a5a34e..74ce57ac70c 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -212,7 +212,7 @@ fetch_subexp_value (struct expression *exp, try { - value_fetch_lazy (result); + result->fetch_lazy (); *valp = result; } catch (const gdb_exception_error &except) @@ -2878,7 +2878,7 @@ var_msym_value_operation::evaluate_for_cast (struct type *to_type, if (VALUE_LVAL (val) == lval_memory) { if (val->lazy ()) - value_fetch_lazy (val); + val->fetch_lazy (); VALUE_LVAL (val) = not_lval; } return val; @@ -2899,7 +2899,7 @@ var_value_operation::evaluate_for_cast (struct type *to_type, if (VALUE_LVAL (val) == lval_memory) { if (val->lazy ()) - value_fetch_lazy (val); + val->fetch_lazy (); VALUE_LVAL (val) = not_lval; } return val; diff --git a/gdb/findvar.c b/gdb/findvar.c index a64b35c2bcf..b4852b2cfb3 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -262,7 +262,7 @@ value_of_register (int regnum, frame_info_ptr frame) return value_of_user_reg (regnum, frame); reg_val = value_of_register_lazy (frame, regnum); - value_fetch_lazy (reg_val); + reg_val->fetch_lazy (); return reg_val; } diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c index 908581a2063..4636ad55109 100644 --- a/gdb/gnu-v2-abi.c +++ b/gdb/gnu-v2-abi.c @@ -164,7 +164,7 @@ gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j, if (!arg1->lazy ()) { arg1->set_lazy (1); - value_fetch_lazy (arg1); + arg1->fetch_lazy (); } vfn = value_field (entry, 2); diff --git a/gdb/guile/scm-pretty-print.c b/gdb/guile/scm-pretty-print.c index 7a680c052d3..ca44133cd7f 100644 --- a/gdb/guile/scm-pretty-print.c +++ b/gdb/guile/scm-pretty-print.c @@ -966,7 +966,7 @@ gdbscm_apply_val_pretty_printer (const struct extension_language_defn *extlang, enum guile_string_repr_result print_result; if (value->lazy ()) - value_fetch_lazy (value); + value->fetch_lazy (); /* No pretty-printer support for unavailable values. */ if (!value_bytes_available (value, 0, type->length ())) diff --git a/gdb/guile/scm-value.c b/gdb/guile/scm-value.c index 8f292c25851..195fd3b8912 100644 --- a/gdb/guile/scm-value.c +++ b/gdb/guile/scm-value.c @@ -1248,7 +1248,7 @@ gdbscm_value_fetch_lazy_x (SCM self) return gdbscm_wrap ([=] { if (value->lazy ()) - value_fetch_lazy (value); + value->fetch_lazy (); return SCM_UNSPECIFIED; }); } diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c index 0bd54dab5c6..18d2b7f5ba4 100644 --- a/gdb/python/py-prettyprint.c +++ b/gdb/python/py-prettyprint.c @@ -579,7 +579,7 @@ gdbpy_apply_val_pretty_printer (const struct extension_language_defn *extlang, enum gdbpy_string_repr_result print_result; if (value->lazy ()) - value_fetch_lazy (value); + value->fetch_lazy (); /* No pretty-printer support for unavailable values. */ if (!value_bytes_available (value, 0, type->length ())) diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c index 6a176c7efda..465d8d92bd2 100644 --- a/gdb/python/py-value.c +++ b/gdb/python/py-value.c @@ -1241,7 +1241,7 @@ valpy_fetch_lazy (PyObject *self, PyObject *args) try { if (value->lazy ()) - value_fetch_lazy (value); + value->fetch_lazy (); } catch (const gdb_exception &except) { diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c index ff30babca75..cca2baa6f63 100644 --- a/gdb/rust-lang.c +++ b/gdb/rust-lang.c @@ -352,7 +352,7 @@ rust_val_print_slice (struct value *val, struct ui_file *stream, int recurse, struct value *array = value::allocate_lazy (array_type); VALUE_LVAL (array) = lval_memory; array->set_address (value_as_address (base)); - value_fetch_lazy (array); + array->fetch_lazy (); generic_value_print (array, stream, recurse, options, &rust_decorations); } diff --git a/gdb/stack.c b/gdb/stack.c index ca6087f3414..983c99e5860 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -581,9 +581,9 @@ read_frame_arg (const frame_print_options &fp_opts, struct type *type = val->type (); if (val->lazy ()) - value_fetch_lazy (val); + val->fetch_lazy (); if (entryval->lazy ()) - value_fetch_lazy (entryval); + entryval->fetch_lazy (); if (value_contents_eq (val, 0, entryval, 0, type->length ())) { @@ -600,12 +600,12 @@ read_frame_arg (const frame_print_options &fp_opts, val_deref = coerce_ref (val); if (val_deref->lazy ()) - value_fetch_lazy (val_deref); + val_deref->fetch_lazy (); type_deref = val_deref->type (); entryval_deref = coerce_ref (entryval); if (entryval_deref->lazy ()) - value_fetch_lazy (entryval_deref); + entryval_deref->fetch_lazy (); /* If the reference addresses match but dereferenced content does not match print them. */ @@ -2750,7 +2750,7 @@ return_command (const char *retval_exp, int from_tty) /* Make sure the value is fully evaluated. It may live in the stack frame we're about to pop. */ if (return_value->lazy ()) - value_fetch_lazy (return_value); + return_value->fetch_lazy (); if (thisfun != NULL) function = read_var_value (thisfun, NULL, thisframe); diff --git a/gdb/valops.c b/gdb/valops.c index 99dede85a0d..6896478c0f8 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -992,7 +992,7 @@ get_value_at (struct type *type, CORE_ADDR addr, int lazy) val = value_from_contents_and_address (type, NULL, addr); if (!lazy) - value_fetch_lazy (val); + val->fetch_lazy (); return val; } diff --git a/gdb/valprint.c b/gdb/valprint.c index 1ad964a70c5..1beec19dcb6 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -1044,7 +1044,7 @@ common_val_print (struct value *value, struct ui_file *stream, int recurse, value = ada_to_fixed_value (value); if (value->lazy ()) - value_fetch_lazy (value); + value->fetch_lazy (); struct value_print_options local_opts = *options; struct type *type = value->type (); diff --git a/gdb/value.c b/gdb/value.c index 811c6356281..d1f06174d97 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -214,7 +214,7 @@ value_entirely_available (struct value *value) /* We can only tell whether the whole value is available when we try to read it. */ if (value->m_lazy) - value_fetch_lazy (value); + value->fetch_lazy (); if (value->m_unavailable.empty ()) return 1; @@ -232,7 +232,7 @@ value_entirely_covered_by_range_vector (struct value *value, /* We can only tell whether the whole value is optimized out / unavailable when we try to read it. */ if (value->m_lazy) - value_fetch_lazy (value); + value->fetch_lazy (); if (ranges.size () == 1) { @@ -1117,7 +1117,7 @@ gdb::array_view value_contents_for_printing (struct value *value) { if (value->m_lazy) - value_fetch_lazy (value); + value->fetch_lazy (); ULONGEST length = value->enclosing_type ()->length (); return gdb::make_array_view (value->m_contents.get (), length); @@ -1283,7 +1283,7 @@ value_contents_copy (struct value *dst, LONGEST dst_offset, struct value *src, LONGEST src_offset, LONGEST length) { if (src->m_lazy) - value_fetch_lazy (src); + src->fetch_lazy (); value_contents_copy_raw (dst, dst_offset, src, src_offset, length); } @@ -1301,7 +1301,7 @@ gdb::array_view value::contents_writeable () { if (m_lazy) - value_fetch_lazy (this); + fetch_lazy (); return contents_raw (); } @@ -1325,7 +1325,7 @@ value_optimized_out (struct value *value) /* Fall back to fetching. */ try { - value_fetch_lazy (value); + value->fetch_lazy (); } catch (const gdb_exception_error &ex) { @@ -1733,7 +1733,7 @@ record_latest_value (struct value *val) && calculate_limited_array_length (type) <= max_value_size) val->m_limited_length = max_value_size; - value_fetch_lazy (val); + val->fetch_lazy (); } ULONGEST limit = val->m_limited_length; @@ -2106,7 +2106,7 @@ value_of_internalvar (struct gdbarch *gdbarch, struct internalvar *var) case INTERNALVAR_VALUE: val = value_copy (var->u.value); if (val->lazy ()) - value_fetch_lazy (val); + val->fetch_lazy (); break; case INTERNALVAR_MAKE_VALUE: @@ -2246,7 +2246,7 @@ set_internalvar (struct internalvar *var, struct value *val) later when this internalvar is referenced and the target is gone or has changed. */ if (copy->lazy ()) - value_fetch_lazy (copy); + copy->fetch_lazy (); /* Release the value from the value chain to prevent it from being deleted by free_all_values. From here on this function should not @@ -2959,7 +2959,7 @@ value_primitive_field (struct value *arg1, LONGEST offset, + (bitpos - v->m_bitpos) / 8); v->set_parent (arg1); if (!arg1->lazy ()) - value_fetch_lazy (v); + v->fetch_lazy (); } else if (fieldno < TYPE_N_BASECLASSES (arg_type)) { @@ -2970,7 +2970,7 @@ value_primitive_field (struct value *arg1, LONGEST offset, /* Lazy register values with offsets are not supported. */ if (VALUE_LVAL (arg1) == lval_register && arg1->lazy ()) - value_fetch_lazy (arg1); + arg1->fetch_lazy (); /* We special case virtual inheritance here because this requires access to the contents, which we would rather avoid @@ -3015,7 +3015,7 @@ value_primitive_field (struct value *arg1, LONGEST offset, /* Lazy register values with offsets are not supported. */ if (VALUE_LVAL (arg1) == lval_register && arg1->lazy ()) - value_fetch_lazy (arg1); + arg1->fetch_lazy (); if (arg1->lazy ()) v = value::allocate_lazy (type); @@ -3788,46 +3788,46 @@ using_struct_return (struct gdbarch *gdbarch, != RETURN_VALUE_REGISTER_CONVENTION); } -/* Helper for value_fetch_lazy when the value is a bitfield. */ +/* See value.h. */ -static void -value_fetch_lazy_bitfield (struct value *val) +void +value::fetch_lazy_bitfield () { - gdb_assert (val->bitsize () != 0); + gdb_assert (bitsize () != 0); /* To read a lazy bitfield, read the entire enclosing value. This prevents reading the same block of (possibly volatile) memory once per bitfield. It would be even better to read only the containing word, but we have no way to record that just specific bits of a value have been fetched. */ - struct value *parent = val->parent (); + struct value *parent = this->parent (); if (parent->lazy ()) - value_fetch_lazy (parent); + parent->fetch_lazy (); - unpack_value_bitfield (val, val->bitpos (), val->bitsize (), + unpack_value_bitfield (this, bitpos (), bitsize (), value_contents_for_printing (parent).data (), - val->offset (), parent); + offset (), parent); } -/* Helper for value_fetch_lazy when the value is in memory. */ +/* See value.h. */ -static void -value_fetch_lazy_memory (struct value *val) +void +value::fetch_lazy_memory () { - gdb_assert (VALUE_LVAL (val) == lval_memory); + gdb_assert (m_lval == lval_memory); - CORE_ADDR addr = val->address (); - struct type *type = check_typedef (val->enclosing_type ()); + CORE_ADDR addr = address (); + struct type *type = check_typedef (enclosing_type ()); /* Figure out how much we should copy from memory. Usually, this is just the size of the type, but, for arrays, we might only be loading a small part of the array (this is only done for very large arrays). */ int len = 0; - if (val->m_limited_length > 0) + if (m_limited_length > 0) { - gdb_assert (val->type ()->code () == TYPE_CODE_ARRAY); - len = val->m_limited_length; + gdb_assert (this->type ()->code () == TYPE_CODE_ARRAY); + len = m_limited_length; } else if (type->length () > 0) len = type_length_units (type); @@ -3835,23 +3835,23 @@ value_fetch_lazy_memory (struct value *val) gdb_assert (len >= 0); if (len > 0) - read_value_memory (val, 0, val->stack (), addr, - val->contents_all_raw ().data (), len); + read_value_memory (this, 0, stack (), addr, + contents_all_raw ().data (), len); } -/* Helper for value_fetch_lazy when the value is in a register. */ +/* See value.h. */ -static void -value_fetch_lazy_register (struct value *val) +void +value::fetch_lazy_register () { frame_info_ptr next_frame; int regnum; - struct type *type = check_typedef (val->type ()); - struct value *new_val = val, *mark = value_mark (); + struct type *type = check_typedef (this->type ()); + struct value *new_val = this, *mark = value_mark (); /* Offsets are not supported here; lazy register values must refer to the entire register. */ - gdb_assert (val->offset () == 0); + gdb_assert (offset () == 0); while (VALUE_LVAL (new_val) == lval_register && new_val->lazy ()) { @@ -3897,12 +3897,12 @@ value_fetch_lazy_register (struct value *val) /* If it's still lazy (for instance, a saved register on the stack), fetch it. */ if (new_val->lazy ()) - value_fetch_lazy (new_val); + new_val->fetch_lazy (); /* Copy the contents and the unavailability/optimized-out meta-data from NEW_VAL to VAL. */ - val->set_lazy (0); - value_contents_copy (val, val->embedded_offset (), + set_lazy (0); + value_contents_copy (this, embedded_offset (), new_val, new_val->embedded_offset (), type_length_units (type)); @@ -3910,9 +3910,9 @@ value_fetch_lazy_register (struct value *val) { struct gdbarch *gdbarch; frame_info_ptr frame; - frame = frame_find_by_id (VALUE_NEXT_FRAME_ID (val)); + frame = frame_find_by_id (VALUE_NEXT_FRAME_ID (this)); frame = get_prev_frame_always (frame); - regnum = VALUE_REGNUM (val); + regnum = VALUE_REGNUM (this); gdbarch = get_frame_arch (frame); string_file debug_file; @@ -3957,41 +3957,35 @@ value_fetch_lazy_register (struct value *val) value_free_to_mark (mark); } -/* Load the actual content of a lazy value. Fetch the data from the - user's process and clear the lazy flag to indicate that the data in - the buffer is valid. - - If the value is zero-length, we avoid calling read_memory, which - would abort. We mark the value as fetched anyway -- all 0 bytes of - it. */ +/* See value.h. */ void -value_fetch_lazy (struct value *val) +value::fetch_lazy () { - gdb_assert (val->lazy ()); - allocate_value_contents (val, true); + gdb_assert (lazy ()); + allocate_value_contents (this, true); /* A value is either lazy, or fully fetched. The availability/validity is only established as we try to fetch a value. */ - gdb_assert (val->m_optimized_out.empty ()); - gdb_assert (val->m_unavailable.empty ()); - if (val->m_is_zero) + gdb_assert (m_optimized_out.empty ()); + gdb_assert (m_unavailable.empty ()); + if (m_is_zero) { /* Nothing. */ } - else if (val->bitsize ()) - value_fetch_lazy_bitfield (val); - else if (VALUE_LVAL (val) == lval_memory) - value_fetch_lazy_memory (val); - else if (VALUE_LVAL (val) == lval_register) - value_fetch_lazy_register (val); - else if (VALUE_LVAL (val) == lval_computed - && val->computed_funcs ()->read != NULL) - val->computed_funcs ()->read (val); + else if (bitsize ()) + fetch_lazy_bitfield (); + else if (VALUE_LVAL (this) == lval_memory) + fetch_lazy_memory (); + else if (VALUE_LVAL (this) == lval_register) + fetch_lazy_register (); + else if (VALUE_LVAL (this) == lval_computed + && computed_funcs ()->read != NULL) + computed_funcs ()->read (this); else internal_error (_("Unexpected lazy value type.")); - val->set_lazy (0); + set_lazy (0); } /* Implementation of the convenience function $_isvoid. */ diff --git a/gdb/value.h b/gdb/value.h index 66074a1ab71..a7eed4880b4 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -386,6 +386,15 @@ struct value gdb::array_view contents_all_raw (); gdb::array_view contents_writeable (); + /* Load the actual content of a lazy value. Fetch the data from the + user's process and clear the lazy flag to indicate that the data in + the buffer is valid. + + If the value is zero-length, we avoid calling read_memory, which + would abort. We mark the value as fetched anyway -- all 0 bytes of + it. */ + void fetch_lazy (); + /* Type of value; either not an lval, or one of the various different possible kinds of lval. */ @@ -568,6 +577,15 @@ struct value /* Allocate a value and its contents for type TYPE. If CHECK_SIZE is true, then apply the usual max-value-size checks. */ static struct value *allocate (struct type *type, bool check_size); + + /* Helper for fetch_lazy when the value is a bitfield. */ + void fetch_lazy_bitfield (); + + /* Helper for fetch_lazy when the value is in memory. */ + void fetch_lazy_memory (); + + /* Helper for fetch_lazy when the value is in a register. */ + void fetch_lazy_register (); }; /* Returns value_type or value_enclosing_type depending on @@ -676,8 +694,6 @@ extern gdb::array_view value_contents_for_printing (struct value extern gdb::array_view value_contents_for_printing_const (const struct value *value); -extern void value_fetch_lazy (struct value *val); - /* If nonzero, this is the value of a variable which does not actually exist in the program, at least partially. If the value is lazy, this may fetch it now. */ diff --git a/gdb/varobj.c b/gdb/varobj.c index 0e023c09cf8..72d5e7f2a25 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -1268,7 +1268,7 @@ install_new_value (struct varobj *var, struct value *value, bool initial) try { - value_fetch_lazy (value); + value->fetch_lazy (); } catch (const gdb_exception_error &except) -- 2.39.1