X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/eb76c314c5e0c828488a417403ae9f410ccfce8e..652cac70b147e9868fc5bf60608ee0c327adaf30:/src/mc/mc_checkpoint.c diff --git a/src/mc/mc_checkpoint.c b/src/mc/mc_checkpoint.c index a5b3e20db9..5bc84646fa 100644 --- a/src/mc/mc_checkpoint.c +++ b/src/mc/mc_checkpoint.c @@ -171,8 +171,8 @@ static void MC_snapshot_add_region(mc_snapshot_t snapshot, int type, 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); @@ -193,9 +193,9 @@ static void MC_get_memory_regions(mc_snapshot_t snapshot) 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 @@ -389,12 +389,22 @@ static void mc_fill_local_variables_values(mc_stack_frame_t stack_frame, 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"); } @@ -667,7 +677,9 @@ void MC_restore_snapshot(mc_snapshot_t snapshot) 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