aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-01-31 16:13:08 -0700
committerTom Tromey <tom@tromey.com>2023-02-13 15:22:17 -0700
commitd00664dbba2802bacfed2335b6f249fc418182a0 (patch)
treed926f7656d767617427844def6d80e8e72817207 /gdb/dwarf2
parentcda0334434412d888443e9a98386255f2e0c2eab (diff)
downloadgdb-d00664dbba2802bacfed2335b6f249fc418182a0.zip
gdb-d00664dbba2802bacfed2335b6f249fc418182a0.tar.gz
gdb-d00664dbba2802bacfed2335b6f249fc418182a0.tar.bz2
Turn many optimized-out value functions into methods
This turns many functions that are related to optimized-out or availability-checking to be methods of value. The static function value_entirely_covered_by_range_vector is also converted to be a private method. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r--gdb/dwarf2/expr.c18
-rw-r--r--gdb/dwarf2/loc.c8
2 files changed, 13 insertions, 13 deletions
diff --git a/gdb/dwarf2/expr.c b/gdb/dwarf2/expr.c
index a1119e1..45bdb00 100644
--- a/gdb/dwarf2/expr.c
+++ b/gdb/dwarf2/expr.c
@@ -233,12 +233,12 @@ rw_pieced_value (value *v, value *from, bool check_optimized)
{
if (check_optimized)
return true;
- mark_value_bits_optimized_out (v, offset,
- this_size_bits);
+ v->mark_bits_optimized_out (offset,
+ this_size_bits);
}
if (unavail && !check_optimized)
- mark_value_bits_unavailable (v, offset,
- this_size_bits);
+ v->mark_bits_unavailable (offset,
+ this_size_bits);
break;
}
@@ -358,7 +358,7 @@ rw_pieced_value (value *v, value *from, bool check_optimized)
if (from != nullptr)
{
- mark_value_bits_optimized_out (v, offset, this_size_bits);
+ v->mark_bits_optimized_out (offset, this_size_bits);
break;
}
@@ -390,7 +390,7 @@ rw_pieced_value (value *v, value *from, bool check_optimized)
if (from != nullptr)
{
- mark_value_bits_optimized_out (v, offset, this_size_bits);
+ v->mark_bits_optimized_out (offset, this_size_bits);
break;
}
@@ -413,7 +413,7 @@ rw_pieced_value (value *v, value *from, bool check_optimized)
case DWARF_VALUE_IMPLICIT_POINTER:
if (from != nullptr)
{
- mark_value_bits_optimized_out (v, offset, this_size_bits);
+ v->mark_bits_optimized_out (offset, this_size_bits);
break;
}
@@ -424,7 +424,7 @@ rw_pieced_value (value *v, value *from, bool check_optimized)
case DWARF_VALUE_OPTIMIZED_OUT:
if (check_optimized)
return true;
- mark_value_bits_optimized_out (v, offset, this_size_bits);
+ v->mark_bits_optimized_out (offset, this_size_bits);
break;
default:
@@ -960,7 +960,7 @@ dwarf_expr_context::fetch_result (struct type *type, struct type *subobj_type,
retval = value_from_register (subobj_type, gdb_regnum,
this->m_frame);
- if (value_optimized_out (retval))
+ if (retval->optimized_out ())
{
/* This means the register has undefined value / was
not saved. As we're computing the location of some
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
index f9706a0..616db13 100644
--- a/gdb/dwarf2/loc.c
+++ b/gdb/dwarf2/loc.c
@@ -1515,8 +1515,8 @@ dwarf2_evaluate_loc_desc_full (struct type *type, frame_info_ptr frame,
{
free_values.free_to_mark ();
retval = value::allocate (subobj_type);
- mark_value_bytes_unavailable (retval, 0,
- subobj_type->length ());
+ retval->mark_bytes_unavailable (0,
+ subobj_type->length ());
return retval;
}
else if (ex.error == NO_ENTRY_VALUE_ERROR)
@@ -1609,7 +1609,7 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
throw;
}
- if (value_optimized_out (result))
+ if (result->optimized_out ())
return 0;
if (VALUE_LVAL (result) == lval_memory)
@@ -1709,7 +1709,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
val = dwarf2_evaluate_loc_desc (baton->property_type, frame, data,
size, baton->loclist.per_cu,
baton->loclist.per_objfile);
- if (!value_optimized_out (val))
+ if (!val->optimized_out ())
{
*value = value_as_address (val);
return true;