From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id E09793858D1E; Mon, 13 Feb 2023 22:31:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E09793858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676327482; bh=cFR/jN4+NdBeQo6mMjLM7TPls651s/dxjm1WIdBr4Zo=; h=From:To:Subject:Date:From; b=rBk6Czj+ZAzrG0u4Im0SXmyMpwq56JqMaX32zVrIc4w+JSZbzWhSGytVofZHCSDYB xFDV7ZVuObMnAEDoAvGUEAfkZ+o0QwyJDVsJhpQMr0xrrkmwgilgpm2EtZ50IvLMdP 0yT0BX1Kfd3GmW59rJKp08bWL4OXKZhDW3T9EPKg= 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] Remove deprecated_lval_hack X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 6f9c9d71c2420e9bc6825cef59a922f5fb863e1a X-Git-Newrev: 736355f2e186a6a5275cac26d9486a5cc28f755c Message-Id: <20230213223122.E09793858D1E@sourceware.org> Date: Mon, 13 Feb 2023 22:31:22 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D736355f2e186= a6a5275cac26d9486a5cc28f755c commit 736355f2e186a6a5275cac26d9486a5cc28f755c Author: Tom Tromey Date: Thu Feb 9 06:55:48 2023 -0700 Remove deprecated_lval_hack =20 This removes deprecated_lval_hack and the VALUE_LVAL macro, replacing all uses with a call to value::lval. =20 Approved-By: Simon Marchi Diff: --- gdb/ada-lang.c | 28 +++++++++++------------ gdb/breakpoint.c | 8 +++---- gdb/c-lang.c | 6 ++--- gdb/cli/cli-dump.c | 2 +- gdb/compile/compile-c-symbols.c | 2 +- gdb/compile/compile-cplus-symbols.c | 2 +- gdb/compile/compile-loc2c.c | 2 +- gdb/dwarf2/frame.c | 2 +- gdb/dwarf2/loc.c | 6 ++--- gdb/eval.c | 12 +++++----- gdb/expop.h | 2 +- gdb/f-lang.c | 8 +++---- gdb/findvar.c | 2 +- gdb/frame.c | 8 +++---- gdb/gdbtypes.c | 2 +- gdb/infcall.c | 2 +- gdb/m2-lang.c | 2 +- gdb/opencl-lang.c | 6 ++--- gdb/ppc-linux-nat.c | 8 +++---- gdb/printcmd.c | 8 +++---- gdb/python/py-unwind.c | 2 +- gdb/rust-lang.c | 4 ++-- gdb/stack.c | 6 ++--- gdb/valarith.c | 14 ++++++------ gdb/valops.c | 34 ++++++++++++++-------------- gdb/value.c | 44 ++++++++++++++++++---------------= ---- gdb/value.h | 10 --------- gdb/varobj.c | 2 +- 28 files changed, 112 insertions(+), 122 deletions(-) diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 1fd424c60c2..ec85729042f 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -559,7 +559,7 @@ coerce_unspec_val_to_type (struct value *val, struct ty= pe *type) result =3D value::allocate_optimized_out (type); else if (val->lazy () /* Be careful not to make a lazy not_lval value. */ - || (VALUE_LVAL (val) !=3D not_lval + || (val->lval () !=3D not_lval && type->length () > val->type ()->length ())) result =3D value::allocate_lazy (type); else @@ -570,7 +570,7 @@ coerce_unspec_val_to_type (struct value *val, struct ty= pe *type) result->set_component_location (val); result->set_bitsize (val->bitsize ()); result->set_bitpos (val->bitpos ()); - if (VALUE_LVAL (result) =3D=3D lval_memory) + if (result->lval () =3D=3D lval_memory) result->set_address (val->address ()); return result; } @@ -2810,7 +2810,7 @@ ada_value_primitive_packed_val (struct value *obj, co= nst gdb_byte *valaddr, v =3D value::allocate (type); src =3D valaddr + offset; } - else if (VALUE_LVAL (obj) =3D=3D lval_memory && obj->lazy ()) + else if (obj->lval () =3D=3D lval_memory && obj->lazy ()) { int src_len =3D (bit_size + bit_offset + HOST_CHAR_BIT - 1) / 8; gdb_byte *buf; @@ -2891,7 +2891,7 @@ ada_value_assign (struct value *toval, struct value *= fromval) if (!toval->deprecated_modifiable ()) error (_("Left operand of assignment is not a modifiable lvalue.")); =20 - if (VALUE_LVAL (toval) =3D=3D lval_memory + if (toval->lval () =3D=3D lval_memory && bits > 0 && (type->code () =3D=3D TYPE_CODE_FLT || type->code () =3D=3D TYPE_CODE_STRUCT)) @@ -4349,8 +4349,8 @@ ada_read_renaming_var_value (struct symbol *renaming_= sym, static struct value * ensure_lval (struct value *val) { - if (VALUE_LVAL (val) =3D=3D not_lval - || VALUE_LVAL (val) =3D=3D lval_internalvar) + if (val->lval () =3D=3D not_lval + || val->lval () =3D=3D lval_internalvar) { int len =3D ada_check_typedef (val->type ())->length (); const CORE_ADDR addr =3D @@ -4523,7 +4523,7 @@ ada_convert_actual (struct value *actual, struct type= *formal_type0) result =3D desc_data (actual); else if (formal_type->code () !=3D TYPE_CODE_PTR) { - if (VALUE_LVAL (actual) !=3D lval_memory) + if (actual->lval () !=3D lval_memory) { struct value *val; =20 @@ -8841,7 +8841,7 @@ ada_to_fixed_value_create (struct type *type0, CORE_A= DDR address, if (type =3D=3D type0 && val0 !=3D NULL) return val0; =20 - if (VALUE_LVAL (val0) !=3D lval_memory) + if (val0->lval () !=3D lval_memory) { /* Our value does not live in memory; it could be a convenience variable, for instance. Create a not_lval value using val0's @@ -9771,12 +9771,12 @@ ada_assign_operation::evaluate (struct type *expect= _type, In the case of assigning to a convenience variable, the lhs should be exactly the result of the evaluation of the rhs. */ struct type *type =3D arg1->type (); - if (VALUE_LVAL (arg1) =3D=3D lval_internalvar) + if (arg1->lval () =3D=3D lval_internalvar) type =3D NULL; value *arg2 =3D std::get<1> (m_storage)->evaluate (type, exp, noside); if (noside =3D=3D EVAL_AVOID_SIDE_EFFECTS) return arg1; - if (VALUE_LVAL (arg1) =3D=3D lval_internalvar) + if (arg1->lval () =3D=3D lval_internalvar) { /* Nothing. */ } @@ -10279,7 +10279,7 @@ ada_ternop_slice (struct expression *exp, convert to a pointer. */ if (array->type ()->code () =3D=3D TYPE_CODE_REF || (array->type ()->code () =3D=3D TYPE_CODE_ARRAY - && VALUE_LVAL (array) =3D=3D lval_memory)) + && array->lval () =3D=3D lval_memory)) array =3D value_addr (array); =20 if (noside =3D=3D EVAL_AVOID_SIDE_EFFECTS @@ -10850,7 +10850,7 @@ ada_var_msym_value_operation::evaluate_for_cast (st= ruct type *expect_type, =20 /* Follow the Ada language semantics that do not allow taking an address of the result of a cast (view conversion in Ada). */ - if (VALUE_LVAL (val) =3D=3D lval_memory) + if (val->lval () =3D=3D lval_memory) { if (val->lazy ()) val->fetch_lazy (); @@ -10872,7 +10872,7 @@ ada_var_value_operation::evaluate_for_cast (struct = type *expect_type, =20 /* Follow the Ada language semantics that do not allow taking an address of the result of a cast (view conversion in Ada). */ - if (VALUE_LVAL (val) =3D=3D lval_memory) + if (val->lval () =3D=3D lval_memory) { if (val->lazy ()) val->fetch_lazy (); @@ -11169,7 +11169,7 @@ ada_funcall_operation::evaluate (struct type *expec= t_type, callee =3D ada_to_fixed_value (coerce_ref (callee)); } else if (callee->type ()->code () =3D=3D TYPE_CODE_ARRAY - && VALUE_LVAL (callee) =3D=3D lval_memory) + && callee->lval () =3D=3D lval_memory) callee =3D value_addr (callee); =20 struct type *type =3D ada_check_typedef (callee->type ()); diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 62ef31049fa..ebb28432cab 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -2074,7 +2074,7 @@ update_watchpoint (struct watchpoint *b, bool reparse) must watch it. If the first value returned is still lazy, that means an error occurred reading it; watch it anyway in case it becomes readable. */ - if (VALUE_LVAL (v) =3D=3D lval_memory + if (v->lval () =3D=3D lval_memory && (v =3D=3D val_chain[0] || ! v->lazy ())) { struct type *vtype =3D check_typedef (v->type ()); @@ -10412,7 +10412,7 @@ can_use_hardware_watchpoint (const std::vector &vals) { struct value *v =3D iter.get (); =20 - if (VALUE_LVAL (v) =3D=3D lval_memory) + if (v->lval () =3D=3D lval_memory) { if (v !=3D head && v->lazy ()) /* A lazy memory lvalue in the chain is one that GDB never @@ -10450,10 +10450,10 @@ can_use_hardware_watchpoint (const std::vector &vals) } } } - else if (VALUE_LVAL (v) !=3D not_lval + else if (v->lval () !=3D not_lval && v->deprecated_modifiable () =3D=3D 0) return 0; /* These are values from the history (e.g., $1). */ - else if (VALUE_LVAL (v) =3D=3D lval_register) + else if (v->lval () =3D=3D lval_register) return 0; /* Cannot watch a register with a HW watchpoint. */ } =20 diff --git a/gdb/c-lang.c b/gdb/c-lang.c index e4027d8ee96..6535ab93498 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c @@ -294,8 +294,8 @@ c_get_string (struct value *value, gdb::unique_xmalloc_= ptr *buffer, C struct hack. So, only do this if either no length was specified, or the length is within the existing bounds. This avoids running off the end of the value's contents. */ - if ((VALUE_LVAL (value) =3D=3D not_lval - || VALUE_LVAL (value) =3D=3D lval_internalvar + if ((value->lval () =3D=3D not_lval + || value->lval () =3D=3D lval_internalvar || type->code () =3D=3D TYPE_CODE_ARRAY) && fetchlimit !=3D UINT_MAX && (*length < 0 || *length <=3D fetchlimit)) @@ -328,7 +328,7 @@ c_get_string (struct value *value, gdb::unique_xmalloc_= ptr *buffer, CORE_ADDR addr; if (type->code () =3D=3D TYPE_CODE_ARRAY) { - if (VALUE_LVAL (value) !=3D lval_memory) + if (value->lval () !=3D lval_memory) error (_("Attempt to take address of value " "not located in memory.")); addr =3D value->address (); diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c index 769f6a589b6..08984f6fdf3 100644 --- a/gdb/cli/cli-dump.c +++ b/gdb/cli/cli-dump.c @@ -230,7 +230,7 @@ dump_value_to_file (const char *cmd, const char *mode, = const char *file_format) { CORE_ADDR vaddr; =20 - if (VALUE_LVAL (val)) + if (val->lval ()) { vaddr =3D val->address (); } diff --git a/gdb/compile/compile-c-symbols.c b/gdb/compile/compile-c-symbol= s.c index 5b53ab3263f..6faff0eee06 100644 --- a/gdb/compile/compile-c-symbols.c +++ b/gdb/compile/compile-c-symbols.c @@ -156,7 +156,7 @@ convert_one_symbol (compile_c_instance *context, } =20 val =3D read_var_value (sym.symbol, sym.block, frame); - if (VALUE_LVAL (val) !=3D lval_memory) + if (val->lval () !=3D lval_memory) error (_("Symbol \"%s\" cannot be used for compilation " "evaluation as its address has not been found."), sym.symbol->print_name ()); diff --git a/gdb/compile/compile-cplus-symbols.c b/gdb/compile/compile-cplu= s-symbols.c index 28447776d4f..039aee34ab7 100644 --- a/gdb/compile/compile-cplus-symbols.c +++ b/gdb/compile/compile-cplus-symbols.c @@ -150,7 +150,7 @@ convert_one_symbol (compile_cplus_instance *instance, } =20 val =3D read_var_value (sym.symbol, sym.block, frame); - if (VALUE_LVAL (val) !=3D lval_memory) + if (val->lval () !=3D lval_memory) error (_("Symbol \"%s\" cannot be used for compilation " "evaluation as its address has not been found."), sym.symbol->print_name ()); diff --git a/gdb/compile/compile-loc2c.c b/gdb/compile/compile-loc2c.c index ae30dd69dec..558460a7c57 100644 --- a/gdb/compile/compile-loc2c.c +++ b/gdb/compile/compile-loc2c.c @@ -642,7 +642,7 @@ do_compile_dwarf_expr_to_c (int indent, string_file *st= ream, sym->print_name ()); =20 val =3D read_var_value (sym, NULL, frame); - if (VALUE_LVAL (val) !=3D lval_memory) + if (val->lval () !=3D lval_memory) error (_("Symbol \"%s\" cannot be used for compilation evaluation " "as its address has not been found."), sym->print_name ()); diff --git a/gdb/dwarf2/frame.c b/gdb/dwarf2/frame.c index a83df2192c3..a561aaf3100 100644 --- a/gdb/dwarf2/frame.c +++ b/gdb/dwarf2/frame.c @@ -235,7 +235,7 @@ execute_stack_op (const gdb_byte *exp, ULONGEST len, in= t addr_size, ctx.push_address (initial, initial_in_stack_memory); value *result_val =3D ctx.evaluate (exp, len, true, nullptr, this_frame); =20 - if (VALUE_LVAL (result_val) =3D=3D lval_memory) + if (result_val->lval () =3D=3D lval_memory) return result_val->address (); else return value_as_address (result_val); diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c index 616db13488b..27c4b7ce31a 100644 --- a/gdb/dwarf2/loc.c +++ b/gdb/dwarf2/loc.c @@ -684,7 +684,7 @@ call_site_target::iterate_over_addresses dwarf_block->per_cu, dwarf_block->per_objfile); /* DW_AT_call_target is a DWARF expression, not a DWARF location. */ - if (VALUE_LVAL (val) =3D=3D lval_memory) + if (val->lval () =3D=3D lval_memory) callback (val->address ()); else callback (value_as_address (val)); @@ -1612,11 +1612,11 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_loce= xpr_baton *dlbaton, if (result->optimized_out ()) return 0; =20 - if (VALUE_LVAL (result) =3D=3D lval_memory) + if (result->lval () =3D=3D lval_memory) *valp =3D result->address (); else { - if (VALUE_LVAL (result) =3D=3D not_lval) + if (result->lval () =3D=3D not_lval) *is_reference =3D false; =20 *valp =3D value_as_address (result); diff --git a/gdb/eval.c b/gdb/eval.c index e043991c254..f8bbb9ef766 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -1224,7 +1224,7 @@ eval_op_structop_struct (struct type *expect_type, st= ruct expression *exp, struct value *arg3 =3D value_struct_elt (&arg1, {}, string, NULL, "structure"); if (noside =3D=3D EVAL_AVOID_SIDE_EFFECTS) - arg3 =3D value::zero (arg3->type (), VALUE_LVAL (arg3)); + arg3 =3D value::zero (arg3->type (), arg3->lval ()); return arg3; } =20 @@ -1280,7 +1280,7 @@ eval_op_structop_ptr (struct type *expect_type, struc= t expression *exp, struct value *arg3 =3D value_struct_elt (&arg1, {}, string, NULL, "structure pointer"); if (noside =3D=3D EVAL_AVOID_SIDE_EFFECTS) - arg3 =3D value::zero (arg3->type (), VALUE_LVAL (arg3)); + arg3 =3D value::zero (arg3->type (), arg3->lval ()); return arg3; } =20 @@ -1447,7 +1447,7 @@ eval_op_subscript (struct type *expect_type, struct e= xpression *exp, } =20 if (noside =3D=3D EVAL_AVOID_SIDE_EFFECTS) - return value::zero (type->target_type (), VALUE_LVAL (arg1)); + return value::zero (type->target_type (), arg1->lval ()); else return value_subscript (arg1, value_as_long (arg2)); } @@ -2590,7 +2590,7 @@ evaluate_subexp_for_address_base (struct expression *= exp, enum noside noside, if (TYPE_IS_REFERENCE (type)) return value::zero (lookup_pointer_type (type->target_type ()), not_lval); - else if (VALUE_LVAL (x) =3D=3D lval_memory || value_must_coerce_to_t= arget (x)) + else if (x->lval () =3D=3D lval_memory || value_must_coerce_to_targe= t (x)) return value::zero (lookup_pointer_type (x->type ()), not_lval); else @@ -2875,7 +2875,7 @@ var_msym_value_operation::evaluate_for_cast (struct t= ype *to_type, val =3D value_cast (to_type, val); =20 /* Don't allow e.g. '&(int)var_with_no_debug_info'. */ - if (VALUE_LVAL (val) =3D=3D lval_memory) + if (val->lval () =3D=3D lval_memory) { if (val->lazy ()) val->fetch_lazy (); @@ -2896,7 +2896,7 @@ var_value_operation::evaluate_for_cast (struct type *= to_type, val =3D value_cast (to_type, val); =20 /* Don't allow e.g. '&(int)var_with_no_debug_info'. */ - if (VALUE_LVAL (val) =3D=3D lval_memory) + if (val->lval () =3D=3D lval_memory) { if (val->lazy ()) val->fetch_lazy (); diff --git a/gdb/expop.h b/gdb/expop.h index e53474711fe..d973d2314bb 100644 --- a/gdb/expop.h +++ b/gdb/expop.h @@ -1889,7 +1889,7 @@ public: expected type. This avoids a weird case where re-assigning a string or array to an internal variable could error with "Too many array elements". */ - struct type *xtype =3D (VALUE_LVAL (lhs) =3D=3D lval_internalvar + struct type *xtype =3D (lhs->lval () =3D=3D lval_internalvar ? nullptr : lhs->type ()); value *rhs =3D std::get<1> (m_storage)->evaluate (xtype, exp, noside); diff --git a/gdb/f-lang.c b/gdb/f-lang.c index d935f59088f..0d7863e4fd1 100644 --- a/gdb/f-lang.c +++ b/gdb/f-lang.c @@ -1363,7 +1363,7 @@ fortran_undetermined::value_subarray (value *array, if (index < lb || (dim_type->index_type ()->bounds ()->high.kind () !=3D PROP_UNDE= FINED && index > ub) - || (VALUE_LVAL (array) !=3D lval_memory + || (array->lval () !=3D lval_memory && dim_type->index_type ()->bounds ()->high.kind () =3D=3D PROP_UNDEFI= NED)) { if (type_not_associated (dim_type)) @@ -1460,7 +1460,7 @@ fortran_undetermined::value_subarray (value *array, } else { - if (VALUE_LVAL (array) =3D=3D lval_memory) + if (array->lval () =3D=3D lval_memory) { /* If the value we're taking a slice from is not yet loaded, or the requested slice is outside the values content range then @@ -1637,7 +1637,7 @@ fortran_structop_operation::evaluate (struct type *ex= pect_type, =3D gdb::make_array_view (valaddr, elt_type->length ()); elt_type =3D resolve_dynamic_type (elt_type, view, address); } - elt =3D value::zero (elt_type, VALUE_LVAL (elt)); + elt =3D value::zero (elt_type, elt->lval ()); } =20 return elt; @@ -1872,7 +1872,7 @@ fortran_argument_convert (struct value *value, bool i= s_artificial) { /* If the value is not in the inferior e.g. registers values, convenience variables and user input. */ - if (VALUE_LVAL (value) !=3D lval_memory) + if (value->lval () !=3D lval_memory) { struct type *type =3D value->type (); const int length =3D type->length (); diff --git a/gdb/findvar.c b/gdb/findvar.c index 37ae518d6c4..7006500574c 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -846,7 +846,7 @@ read_frame_register_value (struct value *value, frame_i= nfo_ptr frame) int regnum =3D VALUE_REGNUM (value); int len =3D type_length_units (check_typedef (value->type ())); =20 - gdb_assert (VALUE_LVAL (value) =3D=3D lval_register); + gdb_assert (value->lval () =3D=3D lval_register); =20 /* Skip registers wholly inside of REG_OFFSET. */ while (reg_offset >=3D register_size (gdbarch, regnum)) diff --git a/gdb/frame.c b/gdb/frame.c index bf9b055878a..be4c58e4642 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -930,7 +930,7 @@ frame_find_by_id (struct frame_id id) and get_prev_frame performs a series of checks that are relatively expensive). This optimization is particularly useful when this funct= ion is called from another function (such as value_fetch_lazy, case - VALUE_LVAL (val) =3D=3D lval_register) which already loops over all f= rames, + val->lval () =3D=3D lval_register) which already loops over all frame= s, making the overall behavior O(n^2). */ frame =3D frame_stash_find (id); if (frame) @@ -1191,7 +1191,7 @@ frame_register_unwind (frame_info_ptr next_frame, int= regnum, =20 *optimizedp =3D value->optimized_out (); *unavailablep =3D !value->entirely_available (); - *lvalp =3D VALUE_LVAL (value); + *lvalp =3D value->lval (); *addrp =3D value->address (); if (*lvalp =3D=3D lval_register) *realnump =3D VALUE_REGNUM (value); @@ -1296,10 +1296,10 @@ frame_unwind_register_value (frame_info_ptr next_fr= ame, int regnum) } else { - if (VALUE_LVAL (value) =3D=3D lval_register) + if (value->lval () =3D=3D lval_register) gdb_printf (&debug_file, " register=3D%d", VALUE_REGNUM (value)); - else if (VALUE_LVAL (value) =3D=3D lval_memory) + else if (value->lval () =3D=3D lval_memory) gdb_printf (&debug_file, " address=3D%s", paddress (gdbarch, value->address ())); diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 73ccd1cf3f8..f22ba44a538 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -4908,7 +4908,7 @@ rank_one_type (struct type *parm, struct type *arg, s= truct value *value) =20 if (TYPE_IS_REFERENCE (parm) && value !=3D NULL) { - if (VALUE_LVAL (value) =3D=3D not_lval) + if (value->lval () =3D=3D not_lval) { /* Rvalues should preferably bind to rvalue references or const lvalue references. */ diff --git a/gdb/infcall.c b/gdb/infcall.c index 81a073d2123..9ed17bf4f8b 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -343,7 +343,7 @@ find_function_addr (struct value *function, int found_descriptor =3D 0; =20 funaddr =3D 0; /* pacify "gcc -Werror" */ - if (VALUE_LVAL (function) =3D=3D lval_memory) + if (function->lval () =3D=3D lval_memory) { CORE_ADDR nfunaddr; =20 diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c index ffa2faa44a9..72d0b58d675 100644 --- a/gdb/m2-lang.c +++ b/gdb/m2-lang.c @@ -104,7 +104,7 @@ eval_op_m2_subscript (struct type *expect_type, struct = expression *exp, } =20 if (noside =3D=3D EVAL_AVOID_SIDE_EFFECTS) - return value::zero (type->target_type (), VALUE_LVAL (arg1)); + return value::zero (type->target_type (), arg1->lval ()); else return value_subscript (arg1, value_as_long (arg2)); } diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c index b3e82f4a6ae..3e4a9c360b2 100644 --- a/gdb/opencl-lang.c +++ b/gdb/opencl-lang.c @@ -300,7 +300,7 @@ create_value (struct gdbarch *gdbarch, struct value *va= l, enum noside noside, else { /* Check whether to create a lvalue or not. */ - if (VALUE_LVAL (val) !=3D not_lval && !array_has_dups (indices, n)) + if (val->lval () !=3D not_lval && !array_has_dups (indices, n)) { struct lval_closure *c =3D allocate_lval_closure (indices, n, val); ret =3D value::allocate_computed (dst_type, &opencl_value_funcs, c); @@ -687,7 +687,7 @@ eval_opencl_assign (struct type *expect_type, struct ex= pression *exp, =20 struct type *type1 =3D arg1->type (); if (arg1->deprecated_modifiable () - && VALUE_LVAL (arg1) !=3D lval_internalvar) + && arg1->lval () !=3D lval_internalvar) arg2 =3D opencl_value_cast (type1, arg2); =20 return value_assign (arg1, arg2); @@ -714,7 +714,7 @@ opencl_structop_operation::evaluate (struct type *expec= t_type, NULL, "structure"); =20 if (noside =3D=3D EVAL_AVOID_SIDE_EFFECTS) - v =3D value::zero (v->type (), VALUE_LVAL (v)); + v =3D value::zero (v->type (), v->lval ()); return v; } } diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index 6d4bf2cc618..e4fcce694cf 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -2455,9 +2455,9 @@ ppc_linux_nat_target::num_memory_accesses (const std:= :vector struct value *v =3D iter.get (); =20 /* Constants and values from the history are fine. */ - if (VALUE_LVAL (v) =3D=3D not_lval || v->->deprecated_modifiable () = =3D=3D 0) + if (v->lval () =3D=3D not_lval || v->->deprecated_modifiable () =3D= =3D 0) continue; - else if (VALUE_LVAL (v) =3D=3D lval_memory) + else if (v->lval () =3D=3D lval_memory) { /* A lazy memory lvalue is one that GDB never needed to fetch; we either just used its address (e.g., `a' in `a.b') or @@ -2509,7 +2509,7 @@ ppc_linux_nat_target::check_condition (CORE_ADDR watc= h_addr, return 0; =20 if (num_accesses_left =3D=3D 1 && num_accesses_right =3D=3D 0 - && VALUE_LVAL (left_val) =3D=3D lval_memory + && left_val->lval () =3D=3D lval_memory && left_val->address () =3D=3D watch_addr) { *data_value =3D value_as_long (right_val); @@ -2519,7 +2519,7 @@ ppc_linux_nat_target::check_condition (CORE_ADDR watc= h_addr, *len =3D check_typedef (left_val->type ())->length (); } else if (num_accesses_left =3D=3D 0 && num_accesses_right =3D=3D 1 - && VALUE_LVAL (right_val) =3D=3D lval_memory + && right_val->lval () =3D=3D lval_memory && right_val->address () =3D=3D watch_addr) { *data_value =3D value_as_long (left_val); diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 58047c7bd02..13945abc36c 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -297,7 +297,7 @@ print_formatted (struct value *val, int size, struct type *type =3D check_typedef (val->type ()); int len =3D type->length (); =20 - if (VALUE_LVAL (val) =3D=3D lval_memory) + if (val->lval () =3D=3D lval_memory) next_address =3D val->address () + len; =20 if (size) @@ -1904,7 +1904,7 @@ x_command (const char *exp, int from_tty) /* In rvalue contexts, such as this, functions are coerced into pointers to functions. This makes "x/i main" work. */ if (val->type ()->code () =3D=3D TYPE_CODE_FUNC - && VALUE_LVAL (val) =3D=3D lval_memory) + && val->lval () =3D=3D lval_memory) next_address =3D val->address (); else next_address =3D value_as_address (val); @@ -2446,7 +2446,7 @@ printf_c_string (struct ui_file *stream, const char *= format, const gdb_byte *str; =20 if (value->type ()->code () !=3D TYPE_CODE_PTR - && VALUE_LVAL (value) =3D=3D lval_internalvar + && value->lval () =3D=3D lval_internalvar && c_is_string_type_p (value->type ())) { size_t len =3D value->type ()->length (); @@ -2518,7 +2518,7 @@ printf_wide_c_string (struct ui_file *stream, const c= har *format, "wchar_t", NULL, 0); int wcwidth =3D wctype->length (); =20 - if (VALUE_LVAL (value) =3D=3D lval_internalvar + if (value->lval () =3D=3D lval_internalvar && c_is_string_type_p (value->type ())) { str =3D value->contents ().data (); diff --git a/gdb/python/py-unwind.c b/gdb/python/py-unwind.c index 97b472f25b1..5b512c95dc7 100644 --- a/gdb/python/py-unwind.c +++ b/gdb/python/py-unwind.c @@ -272,7 +272,7 @@ unwind_infopy_add_saved_register (PyObject *self, PyObj= ect *args) { struct value *user_reg_value =3D value_of_user_reg (regnum, pending_frame->frame_info); - if (VALUE_LVAL (user_reg_value) =3D=3D lval_register) + if (user_reg_value->lval () =3D=3D lval_register) regnum =3D VALUE_REGNUM (user_reg_value); if (regnum >=3D gdbarch_num_cooked_regs (pending_frame->gdbarch)) { diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c index 27b5928298f..fb9db9fe31b 100644 --- a/gdb/rust-lang.c +++ b/gdb/rust-lang.c @@ -1204,7 +1204,7 @@ rust_subscript (struct type *expect_type, struct expr= ession *exp, else new_type =3D base_type; =20 - return value::zero (new_type, VALUE_LVAL (lhs)); + return value::zero (new_type, lhs->lval ()); } else { @@ -1470,7 +1470,7 @@ rust_structop::evaluate (struct type *expect_type, else result =3D value_struct_elt (&lhs, {}, field_name, NULL, "structure"); if (noside =3D=3D EVAL_AVOID_SIDE_EFFECTS) - result =3D value::zero (result->type (), VALUE_LVAL (result)); + result =3D value::zero (result->type (), result->lval ()); return result; } =20 diff --git a/gdb/stack.c b/gdb/stack.c index 934220e7c33..a26f65af1c4 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -1710,7 +1710,7 @@ info_frame_command_core (frame_info_ptr fi, bool sele= cted_frame_p) =20 if (!value->optimized_out () && value->entirely_available ()) { - if (VALUE_LVAL (value) =3D=3D not_lval) + if (value->lval () =3D=3D not_lval) { CORE_ADDR sp; enum bfd_endian byte_order =3D gdbarch_byte_order (gdbarch); @@ -1723,13 +1723,13 @@ info_frame_command_core (frame_info_ptr fi, bool se= lected_frame_p) gdb_puts (paddress (gdbarch, sp)); gdb_printf ("\n"); } - else if (VALUE_LVAL (value) =3D=3D lval_memory) + else if (value->lval () =3D=3D lval_memory) { gdb_printf (" Previous frame's sp at "); gdb_puts (paddress (gdbarch, value->address ())); gdb_printf ("\n"); } - else if (VALUE_LVAL (value) =3D=3D lval_register) + else if (value->lval () =3D=3D lval_register) { gdb_printf (" Previous frame's sp in %s\n", gdbarch_register_name (gdbarch, diff --git a/gdb/valarith.c b/gdb/valarith.c index 427cafd81a2..0ab684aa05b 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -93,7 +93,7 @@ value_ptradd (struct value *arg1, LONGEST arg2) =20 result =3D value_from_pointer (valptrtype, value_as_address (arg1) + sz * arg2); - if (VALUE_LVAL (result) !=3D lval_internalvar) + if (result->lval () !=3D lval_internalvar) result->set_component_location (arg1); return result; } @@ -159,7 +159,7 @@ value_subscript (struct value *array, LONGEST index) if (!lowerbound.has_value ()) lowerbound =3D 0; =20 - if (VALUE_LVAL (array) !=3D lval_memory) + if (array->lval () !=3D lval_memory) return value_subscripted_rvalue (array, index, *lowerbound); =20 gdb::optional upperbound @@ -235,7 +235,7 @@ value_subscripted_rvalue (struct value *array, LONGEST = index, if (index < lowerbound || (!array_upper_bound_undefined && elt_offs >=3D type_length_units (array_type)) - || (VALUE_LVAL (array) !=3D lval_memory && array_upper_bound_undefin= ed)) + || (array->lval () !=3D lval_memory && array_upper_bound_undefined)) { if (type_not_associated (array_type)) error (_("no such vector element (vector not associated)")); @@ -532,7 +532,7 @@ value_x_binop (struct value *arg1, struct value *arg2, = enum exp_opcode op, =20 if (return_type =3D=3D NULL) error (_("Xmethod is missing return type.")); - return value::zero (return_type, VALUE_LVAL (arg1)); + return value::zero (return_type, arg1->lval ()); } return argvec[0]->call_xmethod (argvec.slice (1)); } @@ -541,7 +541,7 @@ value_x_binop (struct value *arg1, struct value *arg2, = enum exp_opcode op, struct type *return_type; =20 return_type =3D check_typedef (argvec[0]->type ())->target_type (); - return value::zero (return_type, VALUE_LVAL (arg1)); + return value::zero (return_type, arg1->lval ()); } return call_function_by_hand (argvec[0], NULL, argvec.slice (1, 2 - static_memfuncp)); @@ -645,7 +645,7 @@ value_x_unop (struct value *arg1, enum exp_opcode op, e= num noside noside) =20 if (return_type =3D=3D NULL) error (_("Xmethod is missing return type.")); - return value::zero (return_type, VALUE_LVAL (arg1)); + return value::zero (return_type, arg1->lval ()); } return argvec[0]->call_xmethod (argvec[1]); } @@ -654,7 +654,7 @@ value_x_unop (struct value *arg1, enum exp_opcode op, e= num noside noside) struct type *return_type; =20 return_type =3D check_typedef (argvec[0]->type ())->target_type (); - return value::zero (return_type, VALUE_LVAL (arg1)); + return value::zero (return_type, arg1->lval ()); } return call_function_by_hand (argvec[0], NULL, argvec.slice (1, nargs)); diff --git a/gdb/valops.c b/gdb/valops.c index a90bcbe7f29..3901053c7d5 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -653,7 +653,7 @@ value_cast (struct type *type, struct value *arg2) arg2->set_pointed_to_offset (0); /* pai: chk_val */ return arg2; } - else if (VALUE_LVAL (arg2) =3D=3D lval_memory) + else if (arg2->lval () =3D=3D lval_memory) return value_at_lazy (to_type, arg2->address ()); else { @@ -971,7 +971,7 @@ value_one (struct type *type) } =20 /* value_one result is never used for assignments to. */ - gdb_assert (VALUE_LVAL (val) =3D=3D not_lval); + gdb_assert (val->lval () =3D=3D not_lval); =20 return val; } @@ -1095,7 +1095,7 @@ value_assign (struct value *toval, struct value *from= val) toval =3D coerce_ref (toval); =20 type =3D toval->type (); - if (VALUE_LVAL (toval) !=3D lval_internalvar) + if (toval->lval () !=3D lval_internalvar) fromval =3D value_cast (type, fromval); else { @@ -1112,7 +1112,7 @@ value_assign (struct value *toval, struct value *from= val) and then restore the new frame afterwards. */ old_frame =3D get_frame_id (deprecated_safe_get_selected_frame ()); =20 - switch (VALUE_LVAL (toval)) + switch (toval->lval ()) { case lval_internalvar: set_internalvar (VALUE_INTERNALVAR (toval), fromval); @@ -1292,7 +1292,7 @@ value_assign (struct value *toval, struct value *from= val) cause the frame cache and regcache to be out of date. Assigning to m= emory also can. We just do this on all assignments to registers or memory, for simplicity's sake; I doubt the slowdown matters. */ - switch (VALUE_LVAL (toval)) + switch (toval->lval ()) { case lval_memory: case lval_register: @@ -1366,7 +1366,7 @@ value_repeat (struct value *arg1, int count) { struct value *val; =20 - if (VALUE_LVAL (arg1) !=3D lval_memory) + if (arg1->lval () !=3D lval_memory) error (_("Only values in memory can be extended with '@'.")); if (count < 1) error (_("Invalid number %d of repetitions."), count); @@ -1406,7 +1406,7 @@ address_of_variable (struct symbol *var, const struct= block *b) val =3D value_of_variable (var, b); type =3D val->type (); =20 - if ((VALUE_LVAL (val) =3D=3D lval_memory && val->lazy ()) + if ((val->lval () =3D=3D lval_memory && val->lazy ()) || type->code () =3D=3D TYPE_CODE_FUNC) { CORE_ADDR addr =3D val->address (); @@ -1415,7 +1415,7 @@ address_of_variable (struct symbol *var, const struct= block *b) } =20 /* Not a memory address; check what the problem was. */ - switch (VALUE_LVAL (val)) + switch (val->lval ()) { case lval_register: { @@ -1452,9 +1452,9 @@ value_must_coerce_to_target (struct value *val) struct type *valtype; =20 /* The only lval kinds which do not live in target memory. */ - if (VALUE_LVAL (val) !=3D not_lval - && VALUE_LVAL (val) !=3D lval_internalvar - && VALUE_LVAL (val) !=3D lval_xcallable) + if (val->lval () !=3D not_lval + && val->lval () !=3D lval_internalvar + && val->lval () !=3D lval_xcallable) return false; =20 valtype =3D check_typedef (val->type ()); @@ -1522,7 +1522,7 @@ value_coerce_array (struct value *arg1) be a good time to do so. */ arg1 =3D value_coerce_to_target (arg1); =20 - if (VALUE_LVAL (arg1) !=3D lval_memory) + if (arg1->lval () !=3D lval_memory) error (_("Attempt to take address of value not located in memory.")); =20 return value_from_pointer (lookup_pointer_type (type->target_type ()), @@ -1537,7 +1537,7 @@ value_coerce_function (struct value *arg1) { struct value *retval; =20 - if (VALUE_LVAL (arg1) !=3D lval_memory) + if (arg1->lval () !=3D lval_memory) error (_("Attempt to take address of value not located in memory.")); =20 retval =3D value_from_pointer (lookup_pointer_type (arg1->type ()), @@ -1586,7 +1586,7 @@ value_addr (struct value *arg1) then this would be a good time to force it to memory. */ arg1 =3D value_coerce_to_target (arg1); =20 - if (VALUE_LVAL (arg1) !=3D lval_memory) + if (arg1->lval () !=3D lval_memory) error (_("Attempt to take address of value not located in memory.")); =20 /* Get target memory address. */ @@ -1637,7 +1637,7 @@ value_ind (struct value *arg1) =20 base_type =3D check_typedef (arg1->type ()); =20 - if (VALUE_LVAL (arg1) =3D=3D lval_computed) + if (arg1->lval () =3D=3D lval_computed) { const struct lval_funcs *funcs =3D arg1->computed_funcs (); =20 @@ -3963,7 +3963,7 @@ value_full_object (struct value *argp, } =20 /* Check if object is in memory. */ - if (VALUE_LVAL (argp) !=3D lval_memory) + if (argp->lval () !=3D lval_memory) { warning (_("Couldn't retrieve complete object of RTTI " "type %s; object may be in register(s)."),=20 @@ -4077,7 +4077,7 @@ value_slice (struct value *array, int lowbound, int l= ength) slice_range_type); slice_type->set_code (array_type->code ()); =20 - if (VALUE_LVAL (array) =3D=3D lval_memory && array->lazy ()) + if (array->lval () =3D=3D lval_memory && array->lazy ()) slice =3D value::allocate_lazy (slice_type); else { diff --git a/gdb/value.c b/gdb/value.c index 6b01d257b4d..0adf6faa152 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -149,14 +149,14 @@ static struct cmd_list_element *functionlist; =20 value::~value () { - if (VALUE_LVAL (this) =3D=3D lval_computed) + if (this->lval () =3D=3D lval_computed) { const struct lval_funcs *funcs =3D m_location.computed.funcs; =20 if (funcs->free_closure) funcs->free_closure (this); } - else if (VALUE_LVAL (this) =3D=3D lval_xcallable) + else if (this->lval () =3D=3D lval_xcallable) delete m_location.xm_worker; } =20 @@ -1262,9 +1262,9 @@ value::optimized_out () { /* See if we can compute the result without fetching the value. */ - if (VALUE_LVAL (this) =3D=3D lval_memory) + if (this->lval () =3D=3D lval_memory) return false; - else if (VALUE_LVAL (this) =3D=3D lval_computed) + else if (this->lval () =3D=3D lval_computed) { const struct lval_funcs *funcs =3D m_location.computed.funcs; =20 @@ -1515,7 +1515,7 @@ value::copy () const gdb::copy (arg_view, val_contents); } =20 - if (VALUE_LVAL (val) =3D=3D lval_computed) + if (val->lval () =3D=3D lval_computed) { const struct lval_funcs *funcs =3D val->m_location.computed.funcs; =20 @@ -1549,7 +1549,7 @@ make_cv_value (int cnst, int voltl, struct value *v) struct value * value::non_lval () { - if (VALUE_LVAL (this) !=3D not_lval) + if (this->lval () !=3D not_lval) { struct type *enc_type =3D enclosing_type (); struct value *val =3D value::allocate (enc_type); @@ -1568,7 +1568,7 @@ value::non_lval () void value::force_lval (CORE_ADDR addr) { - gdb_assert (VALUE_LVAL (this) =3D=3D not_lval); + gdb_assert (this->lval () =3D=3D not_lval); =20 write_memory (addr, contents_raw ().data (), type ()->length ()); m_lval =3D lval_memory; @@ -1626,13 +1626,13 @@ value::set_component_location (const struct value *= whole) carry around both the parent value contents, and the contents of any dynamic fields within the parent. This is a substantial change to how values work in GDB. */ - if (VALUE_LVAL (this) =3D=3D lval_internalvar_component) + if (this->lval () =3D=3D lval_internalvar_component) { gdb_assert (lazy ()); m_lval =3D lval_memory; } else - gdb_assert (VALUE_LVAL (this) =3D=3D lval_memory); + gdb_assert (this->lval () =3D=3D lval_memory); set_address (TYPE_DATA_LOCATION_ADDR (type)); } } @@ -2159,7 +2159,7 @@ set_internalvar (struct internalvar *var, struct valu= e *val) break; =20 case TYPE_CODE_INTERNAL_FUNCTION: - gdb_assert (VALUE_LVAL (val) =3D=3D lval_internalvar); + gdb_assert (val->lval () =3D=3D lval_internalvar); new_kind =3D INTERNALVAR_FUNCTION; get_internalvar_function (VALUE_INTERNALVAR (val), &new_data.fn.function); @@ -2282,7 +2282,7 @@ value_internal_function_name (struct value *val) struct internal_function *ifn; int result; =20 - gdb_assert (VALUE_LVAL (val) =3D=3D lval_internalvar); + gdb_assert (val->lval () =3D=3D lval_internalvar); result =3D get_internalvar_function (VALUE_INTERNALVAR (val), &ifn); gdb_assert (result); =20 @@ -2297,7 +2297,7 @@ call_internal_function (struct gdbarch *gdbarch, struct internal_function *ifn; int result; =20 - gdb_assert (VALUE_LVAL (func) =3D=3D lval_internalvar); + gdb_assert (func->lval () =3D=3D lval_internalvar); result =3D get_internalvar_function (VALUE_INTERNALVAR (func), &ifn); gdb_assert (result); =20 @@ -2888,7 +2888,7 @@ value::primitive_field (LONGEST offset, int fieldno, = struct type *arg_type) LONGEST boffset; =20 /* Lazy register values with offsets are not supported. */ - if (VALUE_LVAL (this) =3D=3D lval_register && lazy ()) + if (this->lval () =3D=3D lval_register && lazy ()) fetch_lazy (); =20 /* We special case virtual inheritance here because this @@ -2932,7 +2932,7 @@ value::primitive_field (LONGEST offset, int fieldno, = struct type *arg_type) / (HOST_CHAR_BIT * unit_size)); =20 /* Lazy register values with offsets are not supported. */ - if (VALUE_LVAL (this) =3D=3D lval_register && lazy ()) + if (this->lval () =3D=3D lval_register && lazy ()) fetch_lazy (); =20 if (lazy ()) @@ -3526,7 +3526,7 @@ value_from_component (struct value *whole, struct typ= e *type, LONGEST offset) { struct value *v; =20 - if (VALUE_LVAL (whole) =3D=3D lval_memory && whole->lazy ()) + if (whole->lval () =3D=3D lval_memory && whole->lazy ()) v =3D value::allocate_lazy (type); else { @@ -3761,7 +3761,7 @@ value::fetch_lazy_register () refer to the entire register. */ gdb_assert (offset () =3D=3D 0); =20 - while (VALUE_LVAL (new_val) =3D=3D lval_register && new_val->lazy ()) + while (new_val->lval () =3D=3D lval_register && new_val->lazy ()) { struct frame_id next_frame_id =3D VALUE_NEXT_FRAME_ID (new_val); =20 @@ -3796,7 +3796,7 @@ value::fetch_lazy_register () sniffer trying to unwind), bypassing its validations. In any case, it should always be an internal error to end up in this situation. */ - if (VALUE_LVAL (new_val) =3D=3D lval_register + if (new_val->lval () =3D=3D lval_register && new_val->lazy () && VALUE_NEXT_FRAME_ID (new_val) =3D=3D next_frame_id) internal_error (_("infinite loop while fetching a register")); @@ -3840,10 +3840,10 @@ value::fetch_lazy_register () int i; gdb::array_view buf =3D new_val->contents (); =20 - if (VALUE_LVAL (new_val) =3D=3D lval_register) + if (new_val->lval () =3D=3D lval_register) gdb_printf (&debug_file, " register=3D%d", VALUE_REGNUM (new_val)); - else if (VALUE_LVAL (new_val) =3D=3D lval_memory) + else if (new_val->lval () =3D=3D lval_memory) gdb_printf (&debug_file, " address=3D%s", paddress (gdbarch, new_val->address ())); @@ -3883,11 +3883,11 @@ value::fetch_lazy () } else if (bitsize ()) fetch_lazy_bitfield (); - else if (VALUE_LVAL (this) =3D=3D lval_memory) + else if (this->lval () =3D=3D lval_memory) fetch_lazy_memory (); - else if (VALUE_LVAL (this) =3D=3D lval_register) + else if (this->lval () =3D=3D lval_register) fetch_lazy_register (); - else if (VALUE_LVAL (this) =3D=3D lval_computed + else if (this->lval () =3D=3D lval_computed && computed_funcs ()->read !=3D NULL) computed_funcs ()->read (this); else diff --git a/gdb/value.h b/gdb/value.h index 9b31511af47..8b45f7fdee8 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -329,9 +329,6 @@ public: uses. */ void *computed_closure () const; =20 - enum lval_type *deprecated_lval_hack () - { return &m_lval; } - enum lval_type lval () const { return m_lval; } =20 @@ -952,13 +949,6 @@ struct lval_funcs =20 extern void error_value_optimized_out (void); =20 -/* While the following fields are per- VALUE .CONTENT .PIECE (i.e., a - single value might have multiple LVALs), this hacked interface is - limited to just the first PIECE. Expect further change. */ -/* Type of value; either not an lval, or one of the various different - possible kinds of lval. */ -#define VALUE_LVAL(val) (*((val)->deprecated_lval_hack ())) - /* Pointer to internal variable. */ #define VALUE_INTERNALVAR(val) (*((val)->deprecated_internalvar_hack ())) =20 diff --git a/gdb/varobj.c b/gdb/varobj.c index 72d5e7f2a25..37b64a0c4bd 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -2270,7 +2270,7 @@ varobj_editable_p (const struct varobj *var) struct type *type; =20 if (!(var->root->is_valid && var->value !=3D nullptr - && VALUE_LVAL (var->value.get ()))) + && var->value.get ()->lval ())) return false; =20 type =3D varobj_get_value_type (var);