From: Gabriel Corona Date: Fri, 27 Mar 2015 10:44:50 +0000 (+0100) Subject: [mc] Read context from remote process in MC_take_snapshot_stacks() X-Git-Tag: v3_12~732^2~77 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/b526db29df9345208db3853c9e496958d66a9051 [mc] Read context from remote process in MC_take_snapshot_stacks() --- diff --git a/src/mc/mc_checkpoint.c b/src/mc/mc_checkpoint.c index 6c06f80cc8..b2a0538787 100644 --- a/src/mc/mc_checkpoint.c +++ b/src/mc/mc_checkpoint.c @@ -536,11 +536,14 @@ static xbt_dynar_t MC_take_snapshot_stacks(mc_snapshot_t * snapshot) xbt_dynar_foreach(stacks_areas, cursor, current_stack) { mc_snapshot_stack_t st = xbt_new(s_mc_snapshot_stack_t, 1); - unw_context_t* original_context = (unw_context_t*) current_stack->context; + // Read the context from remote process: + unw_context_t context; + MC_process_read_simple(&mc_model_checker->process, + &context, (unw_context_t*) current_stack->context, sizeof(context)); st->context = xbt_new0(s_mc_unw_context_t, 1); if (mc_unw_init_context(st->context, &mc_model_checker->process, - original_context) < 0) { + &context) < 0) { xbt_die("Could not initialise the libunwind context."); } diff --git a/src/mc/mc_global.c b/src/mc/mc_global.c index 10f95d265a..da02e1d763 100644 --- a/src/mc/mc_global.c +++ b/src/mc/mc_global.c @@ -766,6 +766,7 @@ void MC_automaton_new_propositional_symbol_callback(const char* id, mmalloc_set_current_heap(heap); } +// TODO, fix cross-process access (this function is not used) void MC_dump_stacks(FILE* file) { xbt_mheap_t heap = mmalloc_set_current_heap(mc_heap);