X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/bfc956026c22595af39ca5c73b7e250e16d85aea..43c98702056fac491ffe054cdba3f36e4c8dbf3a:/src/mc/mc_checkpoint.c diff --git a/src/mc/mc_checkpoint.c b/src/mc/mc_checkpoint.c index 244982166c..07e80ab57c 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); @@ -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"); } @@ -669,7 +679,13 @@ void MC_restore_snapshot(mc_snapshot_t snapshot) } } if(snapshot->privatization_index >= 0) { - smpi_switch_data_segment(snapshot->privatization_index); + // We just rewrote the global variables. + // The privatisation segment SMPI thinks + // is mapped might be inconsistent with the segment which + // is really mapped in memory (kernel state). + // We ask politely SMPI to map the segment anyway, + // even if it thinks it is the current one: + smpi_really_switch_data_segment(snapshot->privatization_index); } #endif