static dwarf2_cu *load_full_type_unit (signatured_type *sig_type,
dwarf2_per_objfile *per_objfile);
-static int attr_to_dynamic_prop (const struct attribute *attr,
- struct die_info *die, struct dwarf2_cu *cu,
- struct dynamic_prop *prop, struct type *type);
+static bool attr_to_dynamic_prop (const struct attribute *attr,
+ struct die_info *die, struct dwarf2_cu *cu,
+ struct dynamic_prop *prop, struct type *type);
/* memory allocation interface */
if (attribute *attr = dwarf2_attr (die, DW_AT_byte_stride, cu);
attr != nullptr)
{
- int stride_ok;
struct type *prop_type = cu->addr_sized_int_type (false);
byte_stride_prop = &stride_storage;
- stride_ok = attr_to_dynamic_prop (attr, die, cu, byte_stride_prop,
- prop_type);
+ bool stride_ok
+ = attr_to_dynamic_prop (attr, die, cu, byte_stride_prop, prop_type);
+
if (!stride_ok)
{
complaint (_("unable to read array DW_AT_byte_stride "
/* Parse dwarf attribute if it's a block, reference or constant and put the
resulting value of the attribute into struct bound_prop.
- Returns 1 if ATTR could be resolved into PROP, 0 otherwise. */
+ Returns true if ATTR could be resolved into PROP, false otherwise. */
-static int
+static bool
attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
struct dwarf2_cu *cu, struct dynamic_prop *prop,
struct type *default_type)
gdb_assert (default_type != NULL);
if (attr == NULL || prop == NULL)
- return 0;
+ return false;
if (attr->form_is_block ())
{
if (name != nullptr)
{
prop->set_variable_name (name);
- return 1;
+ return true;
}
- return 0;
+ return false;
}
switch (target_attr->name)
{
dwarf2_invalid_attrib_class_complaint ("DW_AT_location",
"dynamic property");
- return 0;
+ return false;
}
break;
case DW_AT_data_member_location:
{
baton = find_field_create_baton (cu, target_die);
if (baton == nullptr)
- return 0;
+ return false;
baton->property_type = read_type_die (target_die->parent,
target_cu);
else
goto invalid;
- return 1;
+ return true;
invalid:
dwarf2_invalid_attrib_class_complaint (dwarf_form_name (attr->form),
dwarf2_name (die, cu));
- return 0;
+ return false;
}
/* See read.h. */