sect_offset line_offset {};
attr = dwarf2_attr (comp_unit_die, DW_AT_stmt_list, cu);
- if (attr)
+ if (attr != nullptr)
{
struct quick_file_names find_entry;
cu->base_address = 0;
attr = dwarf2_attr (die, DW_AT_entry_pc, cu);
- if (attr)
+ if (attr != nullptr)
{
cu->base_address = attr_value_as_address (attr);
cu->base_known = 1;
else
{
attr = dwarf2_attr (die, DW_AT_low_pc, cu);
- if (attr)
+ if (attr != nullptr)
{
cu->base_address = attr_value_as_address (attr);
cu->base_known = 1;
struct attribute *attr;
attr = dwarf2_attr (die, DW_AT_stmt_list, cu);
- if (attr)
+ if (attr != nullptr)
lh = dwarf_decode_line_header ((sect_offset) DW_UNSND (attr), cu);
if (lh == NULL)
return; /* No linetable, so no includes. */
or DW_FORM_addrx. */
cu->addr_base = 0;
attr = dwarf2_attr (stub_comp_unit_die, DW_AT_GNU_addr_base, cu);
- if (attr)
+ if (attr != nullptr)
cu->addr_base = DW_UNSND (attr);
/* There should be a DW_AT_ranges_base attribute here (if needed).
We need the value before we can process DW_AT_ranges. */
cu->ranges_base = 0;
attr = dwarf2_attr (stub_comp_unit_die, DW_AT_GNU_ranges_base, cu);
- if (attr)
+ if (attr != nullptr)
cu->ranges_base = DW_UNSND (attr);
}
else if (stub_comp_dir != NULL)
/* If there is a location expression for DW_AT_frame_base, record
it. */
attr = dwarf2_attr (die, DW_AT_frame_base, cu);
- if (attr)
+ if (attr != nullptr)
dwarf2_symbol_mark_computed (attr, newobj->name, cu, 1);
/* If there is a location for the static link, record it. */
newobj->static_link = NULL;
attr = dwarf2_attr (die, DW_AT_static_link, cu);
- if (attr)
+ if (attr != nullptr)
{
newobj->static_link
= XOBNEW (&objfile->objfile_obstack, struct dynamic_prop);
attr = dwarf2_attr (child_die, DW_AT_call_data_value, cu);
if (attr == NULL)
attr = dwarf2_attr (child_die, DW_AT_GNU_call_site_data_value, cu);
- if (attr)
+ if (attr != nullptr)
{
if (!attr_form_is_block (attr))
complaint (_("No DW_FORM_block* DW_AT_call_data_value for "
if (attr_high)
{
attr = dwarf2_attr (die, DW_AT_low_pc, cu);
- if (attr)
+ if (attr != nullptr)
{
low = attr_value_as_address (attr);
high = attr_value_as_address (attr_high);
if (attr_high)
{
attr = dwarf2_attr (die, DW_AT_low_pc, cu);
- if (attr)
+ if (attr != nullptr)
{
CORE_ADDR low = attr_value_as_address (attr);
CORE_ADDR high = attr_value_as_address (attr_high);
}
attr = dwarf2_attr (die, DW_AT_ranges, cu);
- if (attr)
+ if (attr != nullptr)
{
/* DW_AT_ranges_base does not apply to DIEs from the DWO skeleton.
We take advantage of the fact that DW_AT_ranges does not appear
fip->nfields++;
attr = dwarf2_attr (die, DW_AT_accessibility, cu);
- if (attr)
+ if (attr != nullptr)
new_field->accessibility = DW_UNSND (attr);
else
new_field->accessibility = dwarf2_default_access_attribute (die, cu);
fip->non_public_fields = 1;
attr = dwarf2_attr (die, DW_AT_virtuality, cu);
- if (attr)
+ if (attr != nullptr)
new_field->virtuality = DW_UNSND (attr);
else
new_field->virtuality = DW_VIRTUALITY_none;
/* Get bit size of field (zero if none). */
attr = dwarf2_attr (die, DW_AT_bit_size, cu);
- if (attr)
+ if (attr != nullptr)
{
FIELD_BITSIZE (*fp) = DW_UNSND (attr);
}
if (handle_data_member_location (die, cu, &offset))
SET_FIELD_BITPOS (*fp, offset * bits_per_byte);
attr = dwarf2_attr (die, DW_AT_bit_offset, cu);
- if (attr)
+ if (attr != nullptr)
{
if (gdbarch_bits_big_endian (gdbarch))
{
int bit_offset = DW_UNSND (attr);
attr = dwarf2_attr (die, DW_AT_byte_size, cu);
- if (attr)
+ if (attr != nullptr)
{
/* The size of the anonymous object containing
the bit field is explicit, so use the
/* Get accessibility. */
attr = dwarf2_attr (die, DW_AT_accessibility, cu);
- if (attr)
+ if (attr != nullptr)
accessibility = (enum dwarf_access_attribute) DW_UNSND (attr);
else
accessibility = dwarf2_default_access_attribute (die, cu);
to the object address. */
attr = dwarf2_attr (die, DW_AT_vtable_elem_location, cu);
- if (attr)
+ if (attr != nullptr)
{
if (attr_form_is_block (attr) && DW_BLOCK (attr)->size > 0)
{
Don't follow DW_AT_specification though, that will take us back up
the chain and we want to go down. */
attr = dwarf2_attr_no_follow (die, DW_AT_signature);
- if (attr)
+ if (attr != nullptr)
{
type = get_DW_AT_signature_type (die, attr, cu);
TYPE_DECLARED_CLASS (type) = 1;
attr = dwarf2_attr (die, DW_AT_byte_size, cu);
- if (attr)
+ if (attr != nullptr)
{
if (attr_form_is_constant (attr))
TYPE_LENGTH (type) = DW_UNSND (attr);
Don't follow DW_AT_specification though, that will take us back up
the chain and we want to go down. */
attr = dwarf2_attr_no_follow (die, DW_AT_signature);
- if (attr)
+ if (attr != nullptr)
{
type = get_DW_AT_signature_type (die, attr, cu);
}
attr = dwarf2_attr (die, DW_AT_byte_size, cu);
- if (attr)
+ if (attr != nullptr)
{
TYPE_LENGTH (type) = DW_UNSND (attr);
}
array and the vector variant is that vectors are passed by value
to functions. */
attr = dwarf2_attr (die, DW_AT_GNU_vector, cu);
- if (attr)
+ if (attr != nullptr)
make_vector_type (type);
/* The DIE may have DW_AT_byte_size set. For example an OpenCL
implementation may choose to implement triple vectors using this
attribute. */
attr = dwarf2_attr (die, DW_AT_byte_size, cu);
- if (attr)
+ if (attr != nullptr)
{
if (DW_UNSND (attr) >= TYPE_LENGTH (type))
TYPE_LENGTH (type) = DW_UNSND (attr);
attr = dwarf2_attr (die, DW_AT_ordering, cu);
- if (attr)
+ if (attr != nullptr)
return (enum dwarf_array_dim_ordering) DW_SND (attr);
/* GNU F77 is a special case, as at 08/2004 array type info is the
set_type = create_set_type (NULL, domain_type);
attr = dwarf2_attr (die, DW_AT_byte_size, cu);
- if (attr)
+ if (attr != nullptr)
TYPE_LENGTH (set_type) = DW_UNSND (attr);
maybe_set_alignment (cu, die, set_type);
struct attribute *attr;
attr = dwarf2_attr (die, DW_AT_location, cu);
- if (attr)
+ if (attr != nullptr)
{
/* Support the .debug_loc offsets. */
if (attr_form_is_block (attr))
else if (attr_form_is_constant (member_loc)
|| attr_form_is_block (member_loc))
{
- if (attr)
+ if (attr != nullptr)
mark_common_block_symbol_computed (sym, die, attr,
member_loc, cu);
}
type = lookup_reference_type (target_type, refcode);
attr = dwarf2_attr (die, DW_AT_byte_size, cu);
- if (attr)
+ if (attr != nullptr)
{
TYPE_LENGTH (type) = DW_UNSND (attr);
}
unsigned int length;
attr = dwarf2_attr (die, DW_AT_string_length, cu);
- if (attr)
+ if (attr != nullptr)
{
length = DW_UNSND (attr);
}
{
/* Check for the DW_AT_byte_size attribute. */
attr = dwarf2_attr (die, DW_AT_byte_size, cu);
- if (attr)
+ if (attr != nullptr)
{
length = DW_UNSND (attr);
}
the subroutine die. Otherwise set the calling convention to
the default value DW_CC_normal. */
attr = dwarf2_attr (die, DW_AT_calling_convention, cu);
- if (attr)
+ if (attr != nullptr)
TYPE_CALLING_CONVENTION (ftype) = DW_UNSND (attr);
else if (cu->producer && strstr (cu->producer, "IBM XL C for OpenCL"))
TYPE_CALLING_CONVENTION (ftype) = DW_CC_GDB_IBM_OpenCL;
DWARF version 3 added DW_AT_object_pointer, which GCC
4.5 does not yet generate. */
attr = dwarf2_attr (child_die, DW_AT_artificial, cu);
- if (attr)
+ if (attr != nullptr)
TYPE_FIELD_ARTIFICIAL (ftype, iparams) = DW_UNSND (attr);
else
TYPE_FIELD_ARTIFICIAL (ftype, iparams) = 0;
const char *name = dwarf2_name (child_die, cu);
attr = dwarf2_attr (die, DW_AT_object_pointer, cu);
- if (attr)
+ if (attr != nullptr)
{
/* If the compiler emits this, use it. */
if (follow_die_ref (die, attr, &arg_cu) == child_die)
const char *name;
attr = dwarf2_attr (die, DW_AT_encoding, cu);
- if (attr)
+ if (attr != nullptr)
{
encoding = DW_UNSND (attr);
}
attr = dwarf2_attr (die, DW_AT_byte_size, cu);
- if (attr)
+ if (attr != nullptr)
{
bits = DW_UNSND (attr) * TARGET_CHAR_BIT;
}
}
attr = dwarf2_attr (die, DW_AT_lower_bound, cu);
- if (attr)
+ if (attr != nullptr)
attr_to_dynamic_prop (attr, die, cu, &low, base_type);
else if (!low_default_is_valid)
complaint (_("Missing DW_AT_lower_bound "
TYPE_NAME (range_type) = name;
attr = dwarf2_attr (die, DW_AT_byte_size, cu);
- if (attr)
+ if (attr != nullptr)
TYPE_LENGTH (range_type) = DW_UNSND (attr);
maybe_set_alignment (cu, die, range_type);
attr = dwarf2_attr (die,
inlined_func ? DW_AT_call_line : DW_AT_decl_line,
cu);
- if (attr)
+ if (attr != nullptr)
{
SYMBOL_LINE (sym) = DW_UNSND (attr);
}
attr = dwarf2_attr (die,
inlined_func ? DW_AT_call_file : DW_AT_decl_file,
cu);
- if (attr)
+ if (attr != nullptr)
{
file_name_index file_index = (file_name_index) DW_UNSND (attr);
struct file_entry *fe;
{
case DW_TAG_label:
attr = dwarf2_attr (die, DW_AT_low_pc, cu);
- if (attr)
+ if (attr != nullptr)
{
CORE_ADDR addr;
gdb_assert (die_is_declaration (die, cu));
gdb_assert (attr);
}
- if (attr)
+ if (attr != nullptr)
{
dwarf2_const_value (attr, sym, cu);
attr2 = dwarf2_attr (die, DW_AT_external, cu);
break;
}
attr = dwarf2_attr (die, DW_AT_location, cu);
- if (attr)
+ if (attr != nullptr)
{
var_decode_location (attr, sym, cu);
attr2 = dwarf2_attr (die, DW_AT_external, cu);
if (curr != nullptr && curr->name != nullptr)
SYMBOL_IS_ARGUMENT (sym) = 1;
attr = dwarf2_attr (die, DW_AT_location, cu);
- if (attr)
+ if (attr != nullptr)
{
var_decode_location (attr, sym, cu);
}
attr = dwarf2_attr (die, DW_AT_const_value, cu);
- if (attr)
+ if (attr != nullptr)
{
dwarf2_const_value (attr, sym, cu);
}
break;
case DW_TAG_enumerator:
attr = dwarf2_attr (die, DW_AT_const_value, cu);
- if (attr)
+ if (attr != nullptr)
{
dwarf2_const_value (attr, sym, cu);
}
/* Set the language we're debugging. */
attr = dwarf2_attr (comp_unit_die, DW_AT_language, cu);
- if (attr)
+ if (attr != nullptr)
set_cu_language (DW_UNSND (attr), cu);
else
{