From b526db29df9345208db3853c9e496958d66a9051 Mon Sep 17 00:00:00 2001 From: Gabriel Corona Date: Fri, 27 Mar 2015 11:44:50 +0100 Subject: [PATCH] [mc] Read context from remote process in MC_take_snapshot_stacks() --- src/mc/mc_checkpoint.c | 7 +++++-- src/mc/mc_global.c | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) 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); -- 2.20.1