class Variable {
public:
Variable() {}
- unsigned dwarf_offset = 0; /* Global offset of the field. */
- int global = 0;
+ std::uint32_t id = 0;
+ bool global = false;
std::string name;
unsigned type_id = 0;
simgrid::mc::Type* type = nullptr;
- // Use either of:
- simgrid::dwarf::LocationList location_list;
+
+ /** Address of the variable -if it is fixed) */
void* address = nullptr;
+
+ /** Description of the location of the variable if it's not fixed */
+ simgrid::dwarf::LocationList location_list;
+
+ /** Offset of validity of the variable (DW_AT_start_scope)
+ *
+ * This variable is not valid since the beginning of its scope.
+ */
std::size_t start_scope = 0;
+
simgrid::mc::ObjectInformation* object_info = nullptr;
};
std::unique_ptr<simgrid::mc::Variable> variable =
std::unique_ptr<simgrid::mc::Variable>(new simgrid::mc::Variable());
- variable->dwarf_offset = dwarf_dieoffset(die);
+ variable->id = dwarf_dieoffset(die);
variable->global = frame == nullptr; // Can be override base on DW_AT_location
variable->object_info = info;
xbt_die(
"Could not read location expression in DW_AT_location "
"of variable <%" PRIx64 ">%s",
- (uint64_t) variable->dwarf_offset,
+ (uint64_t) variable->id,
variable->name.c_str());
}
if (len == 1 && expr[0].atom == DW_OP_addr) {
- variable->global = 1;
+ variable->global = true;
uintptr_t offset = (uintptr_t) expr[0].number;
uintptr_t base = (uintptr_t) info->base_address();
variable->address = (void *) (base + offset);
xbt_die("Unexpected form 0x%x (%i), class 0x%x (%i) list for location "
"in <%" PRIx64 ">%s",
form, form, (int) form_class, (int) form_class,
- (uint64_t) variable->dwarf_offset,
+ (uint64_t) variable->id,
variable->name.c_str());
}