- struct s_mc_expression location;
- int offset;
-
- dw_type_t subtype; // DW_AT_type
- dw_type_t full_type; // The same (but more complete) type
+ simgrid::mc::DwarfExpression location_expression;
+
+ mc_type_t subtype; // DW_AT_type
+ mc_type_t full_type; // The same (but more complete) type
+
+ bool has_offset_location() const
+ {
+ return location_expression.size() == 1 &&
+ location_expression[0].atom == DW_OP_plus_uconst;
+ }
+
+ // TODO, check if this shortcut is really necessary
+ int offset() const
+ {
+ xbt_assert(this->has_offset_location());
+ return this->location_expression[0].number;
+ }
+
+ void offset(int new_offset)
+ {
+ Dwarf_Op op;
+ op.atom = DW_OP_plus_uconst;
+ op.number = new_offset;
+ this->location_expression = { op };
+ }