- Dwarf_Attribute attr_frame_base;
- if (dwarf_attr_integrate(die, DW_AT_frame_base, &attr_frame_base))
- mc_dwarf_location_list_init(&frame->frame_base, info, die, &attr_frame_base);
+ // DW_AT_high_pc:
+ {
+ Dwarf_Attribute attr;
+ if(dwarf_attr_integrate(die, DW_AT_high_pc, &attr)) {
+ uint64_t high_pc;
+ Dwarf_Addr value;
+ if (dwarf_formaddr(&attr, &value) == 0)
+ high_pc = (uint64_t) value;
+ else
+ high_pc = 0;
+
+ int form = dwarf_whatform(&attr);
+ int klass = MC_dwarf_form_get_class(form);
+ if (klass == MC_DW_CLASS_CONSTANT)
+ frame->high_pc = (void*) ((Dwarf_Off)frame->low_pc + high_pc);
+ else if(klass == MC_DW_CLASS_ADDRESS)
+ frame->high_pc = ((char*) base) + high_pc;
+ else
+ xbt_die("Unexpected class for DW_AT_high_pc");
+ } else {
+ frame->high_pc = 0;
+ }
+ }
+
+ if(klass==mc_tag_subprogram) {
+ Dwarf_Attribute attr_frame_base;
+ if (dwarf_attr_integrate(die, DW_AT_frame_base, &attr_frame_base))
+ mc_dwarf_location_list_init(&frame->frame_base, info, die, &attr_frame_base);
+ }