static void MC_get_memory_regions(mc_snapshot_t snapshot)
{
- void *start_heap = ((xbt_mheap_t) std_heap)->base;
- void *end_heap = ((xbt_mheap_t) std_heap)->breakval;
+ void *start_heap = std_heap->base;
+ void *end_heap = std_heap->breakval;
MC_snapshot_add_region(snapshot, 0, start_heap, start_heap,
(char *) end_heap - (char *) start_heap);
snapshot->heap_bytes_used = mmalloc_get_bytes_used(std_heap);
mc_mem_region_t ref_reg =
mc_model_checker->parent_snapshot ? mc_model_checker->parent_snapshot->privatization_regions[i] : NULL;
snapshot->privatization_regions[i] =
- MC_region_new(-1, mc_binary_info->start_rw, mappings[i], size_data_exe, ref_reg);
+ MC_region_new(-1, mc_binary_info->start_rw, smpi_privatisation_regions[i].address, size_data_exe, ref_reg);
}
- snapshot->privatization_index = loaded_page;
+ snapshot->privatization_index = smpi_loaded_page;
snapshot->regions[2] = NULL;
} else
#endif
if (current_variable->address != NULL) {
new_var->address = current_variable->address;
} else if (current_variable->locations.size != 0) {
- new_var->address =
- (void *) mc_dwarf_resolve_locations(¤t_variable->locations,
+ s_mc_location_t location;
+ mc_dwarf_resolve_locations(&location, ¤t_variable->locations,
current_variable->object_info,
&(stack_frame->unw_cursor),
(void *) stack_frame->frame_base,
NULL, process_index);
+
+ switch(mc_get_location_type(&location)) {
+ case MC_LOCATION_TYPE_ADDRESS:
+ new_var->address = location.memory_location;
+ break;
+ case MC_LOCATION_TYPE_REGISTER:
+ default:
+ xbt_die("Cannot handle non-address variable");
+ }
+
} else {
xbt_die("No address");
}
parent_snapshot ? parent_snapshot->privatization_regions[i] : NULL);
}
}
- switch_data_segment(snapshot->privatization_index);
+ }
+ if(snapshot->privatization_index >= 0) {
+ smpi_switch_data_segment(snapshot->privatization_index);
}
#endif