mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-05-29 15:18:34 +08:00
Add ability to return rvalue reference values from value_ref
Parameterize value_ref() by the kind of reference type the value of which is requested. Change all callers to use the new API. gdb/ChangeLog PR gdb/14441 * ada-lang.c (ada_evaluate_subexp): Adhere to the new value_ref() interface. * c-valprint.c (c_value_print): Likewise. * infcall.c (value_arg_coerce): Likewise. * python/py-value.c (valpy_reference_value): Likewise. * valops.c (value_cast, value_reinterpret_cast) (value_dynamic_cast, typecmp): Likewise. (value_ref): Parameterize by kind of return value reference type. * value.h (value_ref): Add new parameter "refcode".
This commit is contained in:

committed by
Keith Seitz

parent
3b22433085
commit
a65cfae5f8
@ -552,9 +552,10 @@ gdbpy_invoke_xmethod (const struct extension_language_defn *extlang,
|
||||
if (!types_equal (obj_type, this_ptr))
|
||||
obj = value_cast (this_ptr, obj);
|
||||
}
|
||||
else if (TYPE_CODE (obj_type) == TYPE_CODE_REF)
|
||||
else if (TYPE_IS_REFERENCE (obj_type))
|
||||
{
|
||||
struct type *this_ref = lookup_lvalue_reference_type (this_type);
|
||||
struct type *this_ref
|
||||
= lookup_reference_type (this_type, TYPE_CODE (obj_type));
|
||||
|
||||
if (!types_equal (obj_type, this_ref))
|
||||
obj = value_cast (this_ref, obj);
|
||||
|
Reference in New Issue
Block a user