+ // TODO, support DW_AT_ranges
+ uint64_t low_pc = MC_dwarf_attr_integrate_addr(die, DW_AT_low_pc);
+ frame->low_pc = low_pc ? ((char*) base) + low_pc : 0;
+ if(low_pc) {
+ // DW_AT_high_pc:
+ Dwarf_Attribute attr;
+ if(!dwarf_attr_integrate(die, DW_AT_high_pc, &attr)) {
+ xbt_die("Missing DW_AT_high_pc matching with DW_AT_low_pc");
+ }
+
+ Dwarf_Sword offset;
+ Dwarf_Addr high_pc;
+
+ switch(MC_dwarf_form_get_class(dwarf_whatform(&attr))) {
+
+ // DW_AT_high_pc if an offset from the low_pc:
+ case MC_DW_CLASS_CONSTANT:
+
+ if (dwarf_formsdata(&attr, &offset) !=0)
+ xbt_die("Could not read constant");
+ frame->high_pc = (void*) ((char*)frame->low_pc + offset);
+ break;
+
+ // DW_AT_high_pc is a relocatable address:
+ case MC_DW_CLASS_ADDRESS:
+ if (dwarf_formaddr(&attr, &high_pc) != 0)
+ xbt_die("Could not read address");
+ frame->high_pc = ((char*) base) + high_pc;
+ break;