- case DW_OP_deref_size:
- element->type = e_dw_deref;
- element->location.deref_size = (unsigned int short) op->number;
- break;
- case DW_OP_deref:
- element->type = e_dw_deref;
- element->location.deref_size = sizeof(void *);
- break;
- case DW_OP_constu:
- element->type = e_dw_uconstant;
- element->location.uconstant.bytes = 1;
- element->location.uconstant.value = (unsigned long int) op->number;
- break;
- case DW_OP_consts:
- element->type = e_dw_sconstant;
- element->location.uconstant.bytes = 1;
- element->location.uconstant.value = (unsigned long int) op->number;
- break;
-
- case DW_OP_const1u:
- element->type = e_dw_uconstant;
- element->location.uconstant.bytes = 1;
- element->location.uconstant.value = (unsigned long int) op->number;
- break;
- case DW_OP_const2u:
- element->type = e_dw_uconstant;
- element->location.uconstant.bytes = 2;
- element->location.uconstant.value = (unsigned long int) op->number;
- break;
- case DW_OP_const4u:
- element->type = e_dw_uconstant;
- element->location.uconstant.bytes = 4;
- element->location.uconstant.value = (unsigned long int) op->number;
- break;
- case DW_OP_const8u:
- element->type = e_dw_uconstant;
- element->location.uconstant.bytes = 8;
- element->location.uconstant.value = (unsigned long int) op->number;
- break;
-
- case DW_OP_const1s:
- element->type = e_dw_sconstant;
- element->location.uconstant.bytes = 1;
- element->location.uconstant.value = (unsigned long int) op->number;
- break;
- case DW_OP_const2s:
- element->type = e_dw_sconstant;
- element->location.uconstant.bytes = 2;
- element->location.uconstant.value = (unsigned long int) op->number;
- break;
- case DW_OP_const4s:
- element->type = e_dw_sconstant;
- element->location.uconstant.bytes = 4;
- element->location.uconstant.value = (unsigned long int) op->number;
- break;
- case DW_OP_const8s:
- element->type = e_dw_sconstant;
- element->location.uconstant.bytes = 8;
- element->location.uconstant.value = (unsigned long int) op->number;
- break;
- default:
- element->type = e_dw_unsupported;
- break;
- }
- return element;
-}
-
-/** \brief Convert libdw location expresion into native one */
-static dw_location_t MC_dwarf_get_expression(Dwarf_Op* expr, size_t len) {
- dw_location_t loc = xbt_new0(s_dw_location_t, 1);
- loc->type = e_dw_compose;
- loc->location.compose = xbt_dynar_new(sizeof(dw_location_t), NULL);
-
- int i;
- for (i=0; i!=len; ++i) {
- dw_location_t element = MC_dwarf_get_expression_element(expr+i);
- if (element)
- xbt_dynar_push(loc->location.compose, &element);
- }
-
- return loc;
-}
-
-static dw_variable_t MC_die_to_variable(mc_object_info_t info, Dwarf_Die* die, Dwarf_Die* unit, dw_frame_t frame) {
- // Drop declaration:
- if (MC_dwarf_attr_flag(die, DW_AT_declaration, false))