case DW_FORM_block:
case DW_FORM_block1:
return MC_DW_CLASS_BLOCK;
+ case DW_FORM_data1:
case DW_FORM_data2:
case DW_FORM_data4:
case DW_FORM_data8:
// The attribute is a reference to a location list entry:
case DW_FORM_sec_offset:
+ case DW_FORM_data1:
case DW_FORM_data2:
case DW_FORM_data4:
case DW_FORM_data8:
Dwarf_Attribute attr;
dwarf_attr_integrate(child, DW_AT_data_member_location, &attr);
- int klass = MC_dwarf_form_get_class(dwarf_whatform(&attr));
+ int form = dwarf_whatform(&attr);
+ int klass = MC_dwarf_form_get_class(form);
switch (klass) {
case MC_DW_CLASS_EXPRLOC:
case MC_DW_CLASS_BLOCK:
// It's supposed to be possible in DWARF2 but I couldn't find its semantic
// in the spec.
default:
- xbt_die("Can't handle form class 0x%x (%i) as DW_AT_member_location", klass, klass);
+ xbt_die(
+ "Can't handle form class (%i) / form 0x%x as DW_AT_member_location",
+ klass, form);
}
}
variable->name = xbt_strdup(MC_dwarf_attr_string(die, DW_AT_name));
variable->type_origin = MC_dwarf_at_type(die);
- int klass = MC_dwarf_form_get_class(dwarf_whatform(&attr_location));
+ int form = dwarf_whatform(&attr_location);
+ int klass = form == DW_FORM_sec_offset ? MC_DW_CLASS_CONSTANT : MC_dwarf_form_get_class(form);
switch (klass) {
case MC_DW_CLASS_EXPRLOC:
case MC_DW_CLASS_BLOCK:
variable->location = MC_dwarf_get_location_list(info, die, &attr_location);
break;
default:
- xbt_die("Unexpected calss 0x%x (%i) list for location in <%p>%s",
- klass, klass, (void*) variable->dwarf_offset, variable->name);
+ xbt_die("Unexpected form 0x%x (%i), class 0x%x (%i) list for location in <%p>%s",
+ form, form, klass, klass, (void*) variable->dwarf_offset, variable->name);
}
// The current code needs a variable name,
Dwarf_Die die;
if(dwarf_offdie(dwarf, offset+length, &die)!=NULL) {
-
- // Skip C++ for now (we will add support for it soon):
- int lang = dwarf_srclang(&die);
- if((lang==DW_LANG_C_plus_plus) || (lang==DW_LANG_ObjC_plus_plus)) {
- offset = next_offset;
- continue;
- }
-
MC_dwarf_handle_die(info, &die, &die, NULL);
}
offset = next_offset;