Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
MC: cosmetics (fight the mc_model_checker singleton)
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 30 May 2019 10:45:55 +0000 (12:45 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 30 May 2019 10:45:55 +0000 (12:45 +0200)
src/mc/sosp/RegionSnapshot.cpp
src/mc/sosp/mc_snapshot.cpp

index 055b582..3e1e1aa 100644 (file)
@@ -39,7 +39,6 @@ RegionSparse::RegionSparse(RegionType region_type, void* start_addr, void* perma
     : RegionSnapshot(region_type, start_addr, permanent_addr, size)
 {
   simgrid::mc::RemoteClient* process = &mc_model_checker->process();
-  assert(process != nullptr);
 
   xbt_assert((((uintptr_t)start_addr) & (xbt_pagesize - 1)) == 0, "Start address not at the beginning of a page");
   xbt_assert((((uintptr_t)permanent_addr) & (xbt_pagesize - 1)) == 0,
index 757c46a..fbe1a42 100644 (file)
@@ -233,9 +233,9 @@ void simgrid::mc::Snapshot::snapshot_stacks(simgrid::mc::RemoteClient* process)
 
     // Read the context from remote process:
     unw_context_t context;
-    mc_model_checker->process().read_bytes(&context, sizeof(context), remote(stack.context));
+    process->read_bytes(&context, sizeof(context), remote(stack.context));
 
-    st.context.initialize(&mc_model_checker->process(), &context);
+    st.context.initialize(process, &context);
 
     st.stack_frames    = unwind_stack_frames(&st.context);
     st.local_variables = get_local_variables_values(st.stack_frames);
@@ -254,7 +254,7 @@ static void snapshot_handle_ignore(simgrid::mc::Snapshot* snapshot)
   xbt_assert(snapshot->process());
 
   // Copy the memory:
-  for (auto const& region : mc_model_checker->process().ignored_regions()) {
+  for (auto const& region : snapshot->process()->ignored_regions()) {
     s_mc_snapshot_ignored_data_t ignored_data;
     ignored_data.start = (void*)region.addr;
     ignored_data.data.resize(region.size);
@@ -264,7 +264,7 @@ static void snapshot_handle_ignore(simgrid::mc::Snapshot* snapshot)
   }
 
   // Zero the memory:
-  for (auto const& region : mc_model_checker->process().ignored_regions())
+  for (auto const& region : snapshot->process()->ignored_regions())
     snapshot->process()->clear_bytes(remote(region.addr), region.size);
 }
 static void snapshot_ignore_restore(simgrid::mc::Snapshot* snapshot)