Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
MC: rename remote/RemoteProcess to sosp/RemoteProcessMemory
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 12 Mar 2023 21:16:16 +0000 (22:16 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 12 Mar 2023 21:25:49 +0000 (22:25 +0100)
28 files changed:
MANIFEST.in
src/mc/AddressSpace.hpp
src/mc/ModelChecker.cpp
src/mc/ModelChecker.hpp
src/mc/VisitedState.cpp
src/mc/api/RemoteApp.cpp
src/mc/api/RemoteApp.hpp
src/mc/compare.cpp
src/mc/explo/DFSExplorer.cpp
src/mc/explo/LivenessChecker.cpp
src/mc/explo/LivenessChecker.hpp
src/mc/inspect/ObjectInformation.hpp
src/mc/inspect/mc_dwarf.cpp
src/mc/inspect/mc_unw.cpp
src/mc/inspect/mc_unw.hpp
src/mc/inspect/mc_unw_vmread.cpp
src/mc/mc_base.cpp
src/mc/mc_forward.hpp
src/mc/remote/AppSide.cpp
src/mc/sosp/Region.cpp
src/mc/sosp/RemoteProcessMemory.cpp [moved from src/mc/remote/RemoteProcess.cpp with 86% similarity]
src/mc/sosp/RemoteProcessMemory.hpp [moved from src/mc/remote/RemoteProcess.hpp with 89% similarity]
src/mc/sosp/Snapshot.cpp
src/mc/sosp/Snapshot.hpp
src/mc/sosp/Snapshot_test.cpp
teshsuite/mc/dwarf-expression/dwarf-expression.cpp
teshsuite/mc/dwarf/dwarf.cpp
tools/cmake/DefinePackages.cmake

index 85bad9a..625f6cc 100644 (file)
@@ -2213,8 +2213,6 @@ include src/mc/remote/Channel.cpp
 include src/mc/remote/Channel.hpp
 include src/mc/remote/CheckerSide.cpp
 include src/mc/remote/CheckerSide.hpp
-include src/mc/remote/RemoteProcess.cpp
-include src/mc/remote/RemoteProcess.hpp
 include src/mc/remote/RemotePtr.hpp
 include src/mc/remote/mc_protocol.h
 include src/mc/sosp/ChunkedData.cpp
@@ -2224,6 +2222,8 @@ include src/mc/sosp/PageStore.hpp
 include src/mc/sosp/PageStore_test.cpp
 include src/mc/sosp/Region.cpp
 include src/mc/sosp/Region.hpp
+include src/mc/sosp/RemoteProcessMemory.cpp
+include src/mc/sosp/RemoteProcessMemory.hpp
 include src/mc/sosp/Snapshot.cpp
 include src/mc/sosp/Snapshot.hpp
 include src/mc/sosp/Snapshot_test.cpp
index 47980be..2ae6d4d 100644 (file)
@@ -83,17 +83,17 @@ public:
  */
 class AddressSpace {
 private:
-  RemoteProcess* remote_process_;
+  RemoteProcessMemory* remote_process_memory_;
 
 public:
-  explicit AddressSpace(RemoteProcess* process) : remote_process_(process) {}
+  explicit AddressSpace(RemoteProcessMemory* process) : remote_process_memory_(process) {}
   virtual ~AddressSpace() = default;
 
   /** The process of this address space
    *
    *  This is where we can get debug information, memory layout, etc.
    */
-  simgrid::mc::RemoteProcess* get_remote_process() const { return remote_process_; }
+  simgrid::mc::RemoteProcessMemory* get_remote_process_memory() const { return remote_process_memory_; }
 
   /** Read data from the address space
    *
index 243a22e..60f4970 100644 (file)
@@ -9,7 +9,7 @@
 #include "src/mc/mc_config.hpp"
 #include "src/mc/mc_exit.hpp"
 #include "src/mc/mc_private.hpp"
-#include "src/mc/remote/RemoteProcess.hpp"
+#include "src/mc/sosp/RemoteProcessMemory.hpp"
 #include "src/mc/transition/TransitionComm.hpp"
 #include "xbt/automaton.hpp"
 #include "xbt/system_error.hpp"
@@ -31,8 +31,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_ModelChecker, mc, "ModelChecker");
 
 namespace simgrid::mc {
 
-ModelChecker::ModelChecker(std::unique_ptr<RemoteProcess> remote_simulation, int sockfd)
-    : checker_side_(sockfd), remote_process_(std::move(remote_simulation))
+ModelChecker::ModelChecker(std::unique_ptr<RemoteProcessMemory> remote_memory, int sockfd)
+    : checker_side_(sockfd), remote_process_memory_(std::move(remote_memory))
 {
 }
 
@@ -64,7 +64,7 @@ void ModelChecker::start()
   int status;
 
   // The model-checked process SIGSTOP itself to signal it's ready:
-  const pid_t pid = remote_process_->pid();
+  const pid_t pid = remote_process_memory_->pid();
 
   xbt_assert(waitpid(pid, &status, WAITPID_CHECKED_FLAGS) == pid && WIFSTOPPED(status) && WSTOPSIG(status) == SIGSTOP,
              "Could not wait model-checked process");
@@ -97,7 +97,7 @@ static constexpr auto ignored_local_variables = {
 
 void ModelChecker::setup_ignore()
 {
-  const RemoteProcess& process = this->get_remote_process();
+  const RemoteProcessMemory& process = this->get_remote_process_memory();
   for (auto const& [var, frame] : ignored_local_variables)
     process.ignore_local_variable(var, frame);
 
@@ -109,7 +109,7 @@ void ModelChecker::shutdown()
 {
   XBT_DEBUG("Shutting down model-checker");
 
-  RemoteProcess& process = get_remote_process();
+  RemoteProcessMemory& process = get_remote_process_memory();
   if (process.running()) {
     XBT_DEBUG("Killing process");
     finalize_app(true);
@@ -122,7 +122,7 @@ void ModelChecker::resume()
 {
   if (checker_side_.get_channel().send(MessageType::CONTINUE) != 0)
     throw xbt::errno_error();
-  remote_process_->clear_cache();
+  remote_process_memory_->clear_cache();
 }
 
 static void MC_report_crash(Exploration* explorer, int status)
@@ -148,7 +148,7 @@ static void MC_report_crash(Exploration* explorer, int status)
       XBT_INFO("Stack trace not displayed because you passed --log=no_loc");
     } else {
       XBT_INFO("Stack trace:");
-      explorer->get_remote_app().get_remote_process().dump_stack();
+      explorer->get_remote_app().get_remote_process_memory().dump_stack();
     }
   }
 }
@@ -165,7 +165,7 @@ bool ModelChecker::handle_message(const char* buffer, ssize_t size)
       xbt_assert(size == sizeof(message), "Broken message. Got %d bytes instead of %d.", (int)size, (int)sizeof(message));
       memcpy(&message, buffer, sizeof(message));
 
-      get_remote_process().init(message.mmalloc_default_mdp);
+      get_remote_process_memory().init(message.mmalloc_default_mdp);
       break;
     }
 
@@ -179,7 +179,7 @@ bool ModelChecker::handle_message(const char* buffer, ssize_t size)
       region.fragment = message.fragment;
       region.address  = message.address;
       region.size     = message.size;
-      get_remote_process().ignore_heap(region);
+      get_remote_process_memory().ignore_heap(region);
       break;
     }
 
@@ -187,7 +187,7 @@ bool ModelChecker::handle_message(const char* buffer, ssize_t size)
       s_mc_message_ignore_memory_t message;
       xbt_assert(size == sizeof(message), "Broken message");
       memcpy(&message, buffer, sizeof(message));
-      get_remote_process().unignore_heap((void*)(std::uintptr_t)message.addr, message.size);
+      get_remote_process_memory().unignore_heap((void*)(std::uintptr_t)message.addr, message.size);
       break;
     }
 
@@ -195,7 +195,7 @@ bool ModelChecker::handle_message(const char* buffer, ssize_t size)
       s_mc_message_ignore_memory_t message;
       xbt_assert(size == sizeof(message), "Broken message");
       memcpy(&message, buffer, sizeof(message));
-      this->get_remote_process().ignore_region(message.addr, message.size);
+      this->get_remote_process_memory().ignore_region(message.addr, message.size);
       break;
     }
 
@@ -203,7 +203,7 @@ bool ModelChecker::handle_message(const char* buffer, ssize_t size)
       s_mc_message_stack_region_t message;
       xbt_assert(size == sizeof(message), "Broken message");
       memcpy(&message, buffer, sizeof(message));
-      this->get_remote_process().stack_areas().push_back(message.stack_region);
+      this->get_remote_process_memory().stack_areas().push_back(message.stack_region);
     } break;
 
     case MessageType::REGISTER_SYMBOL: {
@@ -213,7 +213,8 @@ bool ModelChecker::handle_message(const char* buffer, ssize_t size)
       xbt_assert(not message.callback, "Support for client-side function proposition is not implemented.");
       XBT_DEBUG("Received symbol: %s", message.name.data());
 
-      LivenessChecker::automaton_register_symbol(get_remote_process(), message.name.data(), remote((int*)message.data));
+      LivenessChecker::automaton_register_symbol(get_remote_process_memory(), message.name.data(),
+                                                 remote((int*)message.data));
       break;
     }
 
@@ -256,7 +257,7 @@ void ModelChecker::handle_waitpid()
     if (pid == -1) {
       if (errno == ECHILD) {
         // No more children:
-        xbt_assert(not this->get_remote_process().running(), "Inconsistent state");
+        xbt_assert(not this->get_remote_process_memory().running(), "Inconsistent state");
         break;
       } else {
         XBT_ERROR("Could not wait for pid");
@@ -264,16 +265,17 @@ void ModelChecker::handle_waitpid()
       }
     }
 
-    if (pid == this->get_remote_process().pid()) {
+    if (pid == this->get_remote_process_memory().pid()) {
       // From PTRACE_O_TRACEEXIT:
 #ifdef __linux__
       if (status>>8 == (SIGTRAP | (PTRACE_EVENT_EXIT<<8))) {
         unsigned long eventmsg;
-        xbt_assert(ptrace(PTRACE_GETEVENTMSG, remote_process_->pid(), 0, &eventmsg) != -1, "Could not get exit status");
+        xbt_assert(ptrace(PTRACE_GETEVENTMSG, get_remote_process_memory().pid(), 0, &eventmsg) != -1,
+                   "Could not get exit status");
         status = static_cast<int>(eventmsg);
         if (WIFSIGNALED(status)) {
           MC_report_crash(exploration_, status);
-          this->get_remote_process().terminate();
+          this->get_remote_process_memory().terminate();
           this->exit(SIMGRID_MC_EXIT_PROGRAM_CRASH);
         }
       }
@@ -284,20 +286,20 @@ void ModelChecker::handle_waitpid()
         XBT_DEBUG("Stopped with signal %i", (int) WSTOPSIG(status));
         errno = 0;
 #ifdef __linux__
-        ptrace(PTRACE_CONT, remote_process_->pid(), 0, WSTOPSIG(status));
+        ptrace(PTRACE_CONT, get_remote_process_memory().pid(), 0, WSTOPSIG(status));
 #elif defined BSD
-        ptrace(PT_CONTINUE, remote_process_->pid(), (caddr_t)1, WSTOPSIG(status));
+        ptrace(PT_CONTINUE, get_remote_process_memory().pid(), (caddr_t)1, WSTOPSIG(status));
 #endif
         xbt_assert(errno == 0, "Could not PTRACE_CONT");
       }
 
       else if (WIFSIGNALED(status)) {
         MC_report_crash(exploration_, status);
-        this->get_remote_process().terminate();
+        this->get_remote_process_memory().terminate();
         this->exit(SIMGRID_MC_EXIT_PROGRAM_CRASH);
       } else if (WIFEXITED(status)) {
         XBT_DEBUG("Child process is over");
-        this->get_remote_process().terminate();
+        this->get_remote_process_memory().terminate();
       }
     }
   }
@@ -306,7 +308,7 @@ void ModelChecker::handle_waitpid()
 void ModelChecker::wait_for_requests()
 {
   this->resume();
-  if (this->get_remote_process().running())
+  if (this->get_remote_process_memory().running())
     checker_side_.dispatch();
 }
 
@@ -318,8 +320,8 @@ Transition* ModelChecker::handle_simcall(aid_t aid, int times_considered, bool n
   m.times_considered_ = times_considered;
   checker_side_.get_channel().send(m);
 
-  this->remote_process_->clear_cache();
-  if (this->remote_process_->running())
+  this->remote_process_memory_->clear_cache();
+  if (this->remote_process_memory_->running())
     checker_side_.dispatch(); // The app may send messages while processing the transition
 
   s_mc_message_simcall_execute_answer_t answer;
index ccbee43..5f7c53b 100644 (file)
@@ -19,15 +19,15 @@ namespace simgrid::mc {
  */
 class ModelChecker {
   CheckerSide checker_side_;
-  std::unique_ptr<RemoteProcess> remote_process_;
+  std::unique_ptr<RemoteProcessMemory> remote_process_memory_;
   Exploration* exploration_ = nullptr;
 
 public:
   ModelChecker(ModelChecker const&) = delete;
   ModelChecker& operator=(ModelChecker const&) = delete;
-  explicit ModelChecker(std::unique_ptr<RemoteProcess> remote_simulation, int sockfd);
+  explicit ModelChecker(std::unique_ptr<RemoteProcessMemory> remote_simulation, int sockfd);
 
-  RemoteProcess& get_remote_process() { return *remote_process_; }
+  RemoteProcessMemory& get_remote_process_memory() { return *remote_process_memory_; }
   Channel& channel() { return checker_side_.get_channel(); }
 
   void start();
index ac9e191..3902d91 100644 (file)
@@ -19,7 +19,7 @@ namespace simgrid::mc {
 
 /** @brief Save the current state */
 VisitedState::VisitedState(unsigned long state_number, unsigned int actor_count, RemoteApp& remote_app)
-    : heap_bytes_used_(remote_app.get_remote_process().get_remote_heap_bytes())
+    : heap_bytes_used_(remote_app.get_remote_process_memory().get_remote_heap_bytes())
     , actor_count_(actor_count)
     , num_(state_number)
 {
index a5111d1..b31650f 100644 (file)
@@ -128,7 +128,7 @@ RemoteApp::RemoteApp(const std::vector<char*>& args)
 
   xbt_assert(mc_model_checker == nullptr, "Did you manage to start the MC twice in this process?");
 
-  auto process   = std::make_unique<simgrid::mc::RemoteProcess>(pid);
+  auto process   = std::make_unique<simgrid::mc::RemoteProcessMemory>(pid);
   model_checker_ = std::make_unique<simgrid::mc::ModelChecker>(std::move(process), sockets[1]);
 
   mc_model_checker = model_checker_.get();
@@ -151,7 +151,7 @@ RemoteApp::~RemoteApp()
 
 void RemoteApp::restore_initial_state() const
 {
-  this->initial_snapshot_->restore(&model_checker_->get_remote_process());
+  this->initial_snapshot_->restore(&model_checker_->get_remote_process_memory());
 }
 
 unsigned long RemoteApp::get_maxpid() const
index f920da6..975502e 100644 (file)
@@ -56,8 +56,8 @@ public:
   /* Get the list of actors that are ready to run at that step. Usually shorter than maxpid */
   void get_actors_status(std::map<aid_t, simgrid::mc::ActorState>& whereto) const;
 
-  /* Get the remote process */
-  RemoteProcess& get_remote_process() { return model_checker_->get_remote_process(); }
+  /* Get the memory of the remote process */
+  RemoteProcessMemory& get_remote_process_memory() { return model_checker_->get_remote_process_memory(); }
 
   PageStore& get_page_store() { return page_store_; }
 };
index 2c24b35..de5e31d 100644 (file)
@@ -137,7 +137,7 @@ static ssize_t heap_comparison_ignore_size(const std::vector<simgrid::mc::Ignore
   return (pos != ignore_list->end() && pos->address == address) ? pos->size : -1;
 }
 
-static bool is_stack(const simgrid::mc::RemoteProcess& process, const void* address)
+static bool is_stack(const simgrid::mc::RemoteProcessMemory& process, const void* address)
 {
   auto const& stack_areas = process.stack_areas();
   return std::any_of(stack_areas.begin(), stack_areas.end(),
@@ -145,7 +145,7 @@ static bool is_stack(const simgrid::mc::RemoteProcess& process, const void* addr
 }
 
 // TODO, this should depend on the snapshot?
-static bool is_block_stack(const simgrid::mc::RemoteProcess& process, int block)
+static bool is_block_stack(const simgrid::mc::RemoteProcessMemory& process, int block)
 {
   auto const& stack_areas = process.stack_areas();
   return std::any_of(stack_areas.begin(), stack_areas.end(),
@@ -183,7 +183,7 @@ int StateComparator::initHeapInformation(const s_xbt_mheap_t* heap1, const s_xbt
   if ((heap1->heaplimit != heap2->heaplimit) || (heap1->heapsize != heap2->heapsize))
     return -1;
   this->heaplimit     = heap1->heaplimit;
-  this->std_heap_copy = *mc_model_checker->get_remote_process().get_heap();
+  this->std_heap_copy = *mc_model_checker->get_remote_process_memory().get_heap();
   this->processStates[0].initHeapInformation(heap1, i1);
   this->processStates[1].initHeapInformation(heap2, i2);
   return 0;
@@ -198,9 +198,9 @@ static inline Region* MC_get_heap_region(const Snapshot& snapshot)
   xbt_die("No heap region");
 }
 
-static bool heap_area_differ(const RemoteProcess& process, StateComparator& state, const void* area1, const void* area2,
-                             const Snapshot& snapshot1, const Snapshot& snapshot2, HeapLocationPairs* previous,
-                             Type* type, int pointer_level);
+static bool heap_area_differ(const RemoteProcessMemory& process, StateComparator& state, const void* area1,
+                             const void* area2, const Snapshot& snapshot1, const Snapshot& snapshot2,
+                             HeapLocationPairs* previous, Type* type, int pointer_level);
 
 /* Compares the content of each heap fragment between the two states, at the bit level.
  *
@@ -233,7 +233,7 @@ static bool heap_area_differ(const RemoteProcess& process, StateComparator& stat
  * of the liveness model-checker, as state-equality is used to detect the loops that constitute the accepting states of
  * the verified property. So we could miss counter-examples to the verified property. Not good. Not good at all.
  */
-static bool mmalloc_heap_differ(const RemoteProcess& process, StateComparator& state, const Snapshot& snapshot1,
+static bool mmalloc_heap_differ(const RemoteProcessMemory& process, StateComparator& state, const Snapshot& snapshot1,
                                 const Snapshot& snapshot2)
 {
   /* Check busy blocks */
@@ -457,9 +457,10 @@ static bool mmalloc_heap_differ(const RemoteProcess& process, StateComparator& s
  * @param check_ignore
  * @return true when different, false otherwise (same or unknown)
  */
-static bool heap_area_differ_without_type(const RemoteProcess& process, StateComparator& state, const void* real_area1,
-                                          const void* real_area2, const Snapshot& snapshot1, const Snapshot& snapshot2,
-                                          HeapLocationPairs* previous, int size, int check_ignore)
+static bool heap_area_differ_without_type(const RemoteProcessMemory& process, StateComparator& state,
+                                          const void* real_area1, const void* real_area2, const Snapshot& snapshot1,
+                                          const Snapshot& snapshot2, HeapLocationPairs* previous, int size,
+                                          int check_ignore)
 {
   const Region* heap_region1  = MC_get_heap_region(snapshot1);
   const Region* heap_region2  = MC_get_heap_region(snapshot2);
@@ -520,7 +521,7 @@ static bool heap_area_differ_without_type(const RemoteProcess& process, StateCom
  * @param pointer_level
  * @return               true when different, false otherwise (same or unknown)
  */
-static bool heap_area_differ_with_type(const simgrid::mc::RemoteProcess& process, StateComparator& state,
+static bool heap_area_differ_with_type(const simgrid::mc::RemoteProcessMemory& process, StateComparator& state,
                                        const void* real_area1, const void* real_area2, const Snapshot& snapshot1,
                                        const Snapshot& snapshot2, HeapLocationPairs* previous, const Type* type,
                                        int area_size, int check_ignore, int pointer_level)
@@ -743,9 +744,9 @@ static Type* get_offset_type(void* real_base_address, Type* type, int offset, in
  * @param pointer_level
  * @return true when different, false otherwise (same or unknown)
  */
-static bool heap_area_differ(const RemoteProcess& process, StateComparator& state, const void* area1, const void* area2,
-                             const Snapshot& snapshot1, const Snapshot& snapshot2, HeapLocationPairs* previous,
-                             Type* type, int pointer_level)
+static bool heap_area_differ(const RemoteProcessMemory& process, StateComparator& state, const void* area1,
+                             const void* area2, const Snapshot& snapshot1, const Snapshot& snapshot2,
+                             HeapLocationPairs* previous, Type* type, int pointer_level)
 {
   ssize_t block1;
   ssize_t block2;
@@ -1016,7 +1017,7 @@ static bool heap_area_differ(const RemoteProcess& process, StateComparator& stat
 /************************** Snapshot comparison *******************************/
 /******************************************************************************/
 
-static bool areas_differ_with_type(const simgrid::mc::RemoteProcess& process, simgrid::mc::StateComparator& state,
+static bool areas_differ_with_type(const simgrid::mc::RemoteProcessMemory& process, simgrid::mc::StateComparator& state,
                                    const void* real_area1, const simgrid::mc::Snapshot& snapshot1,
                                    simgrid::mc::Region* region1, const void* real_area2,
                                    const simgrid::mc::Snapshot& snapshot2, simgrid::mc::Region* region2,
@@ -1143,7 +1144,8 @@ static bool areas_differ_with_type(const simgrid::mc::RemoteProcess& process, si
   return false;
 }
 
-static bool global_variables_differ(const simgrid::mc::RemoteProcess& process, simgrid::mc::StateComparator& state,
+static bool global_variables_differ(const simgrid::mc::RemoteProcessMemory& process,
+                                    simgrid::mc::StateComparator& state,
                                     const simgrid::mc::ObjectInformation* object_info, simgrid::mc::Region* r1,
                                     simgrid::mc::Region* r2, const simgrid::mc::Snapshot& snapshot1,
                                     const simgrid::mc::Snapshot& snapshot2)
@@ -1170,7 +1172,7 @@ static bool global_variables_differ(const simgrid::mc::RemoteProcess& process, s
   return false;
 }
 
-static bool local_variables_differ(const simgrid::mc::RemoteProcess& process, simgrid::mc::StateComparator& state,
+static bool local_variables_differ(const simgrid::mc::RemoteProcessMemory& process, simgrid::mc::StateComparator& state,
                                    const simgrid::mc::Snapshot& snapshot1, const simgrid::mc::Snapshot& snapshot2,
                                    const_mc_snapshot_stack_t stack1, const_mc_snapshot_stack_t stack2)
 {
@@ -1209,7 +1211,7 @@ bool Snapshot::operator==(const Snapshot& other)
   // TODO, make this a field of ModelChecker or something similar
   static StateComparator state_comparator;
 
-  const RemoteProcess& process = mc_model_checker->get_remote_process();
+  const RemoteProcessMemory& process = mc_model_checker->get_remote_process_memory();
 
   if (hash_ != other.hash_) {
     XBT_VERB("(%ld - %ld) Different hash: 0x%" PRIx64 "--0x%" PRIx64, this->num_state_, other.num_state_, this->hash_,
index 05b607b..d2aa4f4 100644 (file)
@@ -279,7 +279,7 @@ void DFSExplorer::backtrack()
     /* If asked to rollback on a state that has a snapshot, restore it */
     State* last_state = stack_.back().get();
     if (const auto* system_state = last_state->get_system_state()) {
-      system_state->restore(&get_remote_app().get_remote_process());
+      system_state->restore(&get_remote_app().get_remote_process_memory());
       on_restore_system_state_signal(last_state, get_remote_app());
       return;
     }
index c0929f1..6a43409 100644 (file)
@@ -26,7 +26,7 @@ VisitedPair::VisitedPair(int pair_num, xbt_automaton_state_t prop_state,
   this->app_state_ = std::move(app_state);
   if (not this->app_state_->get_system_state())
     this->app_state_->set_system_state(std::make_shared<Snapshot>(pair_num, remote_app.get_page_store()));
-  this->heap_bytes_used     = mc_model_checker->get_remote_process().get_remote_heap_bytes();
+  this->heap_bytes_used     = mc_model_checker->get_remote_process_memory().get_remote_heap_bytes();
   this->actor_count_        = app_state_->get_actor_count();
   this->other_num           = -1;
   this->atomic_propositions = std::move(atomic_propositions);
@@ -102,7 +102,7 @@ void LivenessChecker::replay()
   if (_sg_mc_checkpoint > 0) {
     const Pair* pair = exploration_stack_.back().get();
     if (const auto* system_state = pair->app_state_->get_system_state()) {
-      system_state->restore(&get_remote_app().get_remote_process());
+      system_state->restore(&get_remote_app().get_remote_process_memory());
       return;
     }
   }
@@ -241,7 +241,7 @@ xbt_automaton_state_t LivenessChecker::get_automaton_transition_dst(xbt_dynar_t
   const xbt_automaton_transition* transition = xbt_dynar_get_as(dynar, index, xbt_automaton_transition_t);
   return transition->dst;
 }
-void LivenessChecker::automaton_register_symbol(RemoteProcess const& remote_process, const char* name,
+void LivenessChecker::automaton_register_symbol(RemoteProcessMemory const& remote_process, const char* name,
                                                 RemotePtr<int> address)
 {
   if (property_automaton_ == nullptr)
index 0b366e8..532f639 100644 (file)
@@ -101,7 +101,8 @@ public:
   void set_property_automaton(xbt_automaton_state_t const& automaton_state) const;
   xbt_automaton_exp_label_t get_automaton_transition_label(xbt_dynar_t const& dynar, int index) const;
   xbt_automaton_state_t get_automaton_transition_dst(xbt_dynar_t const& dynar, int index) const;
-  static void automaton_register_symbol(RemoteProcess const& remote_process, const char* name, RemotePtr<int> addr);
+  static void automaton_register_symbol(RemoteProcessMemory const& remote_process, const char* name,
+                                        RemotePtr<int> addr);
 };
 
 } // namespace simgrid::mc
index bc59ee1..7d1dfa1 100644 (file)
@@ -163,7 +163,7 @@ XBT_PRIVATE std::shared_ptr<ObjectInformation> createObjectInformation(std::vect
                                                                        const char* name);
 
 /** Augment the current module with information about the other ones */
-XBT_PRIVATE void postProcessObjectInformation(const simgrid::mc::RemoteProcess* process,
+XBT_PRIVATE void postProcessObjectInformation(const simgrid::mc::RemoteProcessMemory* process,
                                               simgrid::mc::ObjectInformation* info);
 } // namespace simgrid::mc
 
index 93ff5f8..094635d 100644 (file)
@@ -13,7 +13,7 @@
 #include "src/mc/inspect/Variable.hpp"
 #include "src/mc/inspect/mc_dwarf.hpp"
 #include "src/mc/mc_private.hpp"
-#include "src/mc/remote/RemoteProcess.hpp"
+#include "src/mc/sosp/RemoteProcessMemory.hpp"
 
 #include <algorithm>
 #include <array>
@@ -1147,7 +1147,7 @@ std::shared_ptr<ObjectInformation> createObjectInformation(std::vector<xbt::VmMa
 
 /*************************************************************************/
 
-void postProcessObjectInformation(const RemoteProcess* process, ObjectInformation* info)
+void postProcessObjectInformation(const RemoteProcessMemory* process, ObjectInformation* info)
 {
   for (auto& [_, t] : info->types) {
     Type* type    = &t;
index 746fb31..1b66c85 100644 (file)
@@ -3,16 +3,14 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-/** \file
- *  Libunwind support for mc_address_space objects.
- */
+/** \file Libunwind support for mc_address_space objects. */
 
 // We need this for the register indices:
 // #define _GNU_SOURCE
 
 #include "src/mc/inspect/mc_unw.hpp"
 #include "src/mc/inspect/Frame.hpp"
-#include "src/mc/remote/RemoteProcess.hpp"
+#include "src/mc/sosp/RemoteProcessMemory.hpp"
 
 #include <cstring>
 
@@ -218,7 +216,7 @@ unw_addr_space_t UnwindContext::createUnwindAddressSpace()
   return unw_create_addr_space(&accessors, BYTE_ORDER);
 }
 
-void UnwindContext::initialize(simgrid::mc::RemoteProcess* process, unw_context_t* c)
+void UnwindContext::initialize(simgrid::mc::RemoteProcessMemory* process, unw_context_t* c)
 {
   this->address_space_ = process;
   this->process_      = process;
index ce9d39c..148591a 100644 (file)
@@ -40,12 +40,12 @@ XBT_PRIVATE void* create_context(unw_addr_space_t as, pid_t pid);
 namespace simgrid::mc {
 
 class UnwindContext {
-  simgrid::mc::AddressSpace* address_space_ = nullptr;
-  simgrid::mc::RemoteProcess* process_      = nullptr;
-  unw_context_t unwind_context_             = {};
+  simgrid::mc::AddressSpace* address_space_  = nullptr;
+  simgrid::mc::RemoteProcessMemory* process_ = nullptr;
+  unw_context_t unwind_context_              = {};
 
 public:
-  void initialize(simgrid::mc::RemoteProcess* process, unw_context_t* c);
+  void initialize(simgrid::mc::RemoteProcessMemory* process, unw_context_t* c);
   unw_cursor_t cursor();
 
 private: // Methods and virtual table for libunwind
index b9457da..21fc478 100644 (file)
@@ -6,7 +6,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/mc/inspect/mc_unw.hpp"
-#include "src/mc/remote/RemoteProcess.hpp"
+#include "src/mc/sosp/RemoteProcessMemory.hpp"
 
 #include <sys/types.h>
 #include <sys/uio.h>
index 64a2ae6..c400422 100644 (file)
@@ -15,7 +15,7 @@
 #include "src/mc/ModelChecker.hpp"
 #include "src/mc/api/RemoteApp.hpp"
 #include "src/mc/remote/AppSide.hpp"
-#include "src/mc/remote/RemoteProcess.hpp"
+#include "src/mc/sosp/RemoteProcessMemory.hpp"
 #endif
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(mc, "All MC categories");
index 4f97d16..b9da6df 100644 (file)
@@ -17,7 +17,7 @@ class PageStore;
 class ChunkedData;
 class ModelChecker;
 class AddressSpace;
-class RemoteProcess;
+class RemoteProcessMemory;
 class Snapshot;
 class ObjectInformation;
 class Member;
index b8ba57e..036fd29 100644 (file)
@@ -11,7 +11,7 @@
 #include "src/kernel/actor/SimcallObserver.hpp"
 #include "src/mc/mc_base.hpp"
 #include "src/mc/mc_config.hpp"
-#include "src/mc/remote/RemoteProcess.hpp"
+#include "src/mc/sosp/RemoteProcessMemory.hpp"
 #if HAVE_SMPI
 #include "src/smpi/include/private.hpp"
 #endif
index bb98737..538e12f 100644 (file)
@@ -7,7 +7,7 @@
 #include "src/mc/ModelChecker.hpp"
 #include "src/mc/mc_config.hpp"
 #include "src/mc/mc_forward.hpp"
-#include "src/mc/remote/RemoteProcess.hpp"
+#include "src/mc/sosp/RemoteProcessMemory.hpp"
 
 #include <cstdlib>
 #include <sys/mman.h>
@@ -22,8 +22,8 @@ Region::Region(PageStore& store, RegionType region_type, void* start_addr, size_
 {
   xbt_assert((((uintptr_t)start_addr) & (xbt_pagesize - 1)) == 0, "Start address not at the beginning of a page");
 
-  chunks_ =
-      ChunkedData(store, mc_model_checker->get_remote_process(), RemotePtr<void>(start_addr), mmu::chunk_count(size));
+  chunks_ = ChunkedData(store, mc_model_checker->get_remote_process_memory(), RemotePtr<void>(start_addr),
+                        mmu::chunk_count(size));
 }
 
 /** @brief Restore a region from a snapshot
@@ -38,7 +38,7 @@ void Region::restore() const
   for (size_t i = 0; i != get_chunks().page_count(); ++i) {
     auto* target_page       = (void*)simgrid::mc::mmu::join(i, (std::uintptr_t)(void*)start().address());
     const void* source_page = get_chunks().page(i);
-    mc_model_checker->get_remote_process().write_bytes(source_page, xbt_pagesize, remote(target_page));
+    mc_model_checker->get_remote_process_memory().write_bytes(source_page, xbt_pagesize, remote(target_page));
   }
 }
 
similarity index 86%
rename from src/mc/remote/RemoteProcess.cpp
rename to src/mc/sosp/RemoteProcessMemory.cpp
index fc4e89a..7fd28b0 100644 (file)
@@ -5,7 +5,7 @@
 
 #define _FILE_OFFSET_BITS 64 /* needed for pread_whole to work as expected on 32bits */
 
-#include "src/mc/remote/RemoteProcess.hpp"
+#include "src/mc/sosp/RemoteProcessMemory.hpp"
 
 #include "src/mc/sosp/Snapshot.hpp"
 #include "xbt/file.hpp"
@@ -101,11 +101,11 @@ int open_vm(pid_t pid, int flags)
   return open(buffer.c_str(), flags);
 }
 
-// ***** RemoteProcess
+// ***** RemoteProcessMemory
 
-RemoteProcess::RemoteProcess(pid_t pid) : AddressSpace(this), pid_(pid), running_(true) {}
+RemoteProcessMemory::RemoteProcessMemory(pid_t pid) : AddressSpace(this), pid_(pid), running_(true) {}
 
-void RemoteProcess::init(xbt_mheap_t mmalloc_default_mdp)
+void RemoteProcessMemory::init(xbt_mheap_t mmalloc_default_mdp)
 {
   this->heap_address = remote(mmalloc_default_mdp);
 
@@ -121,7 +121,7 @@ void RemoteProcess::init(xbt_mheap_t mmalloc_default_mdp)
   this->unw_underlying_context    = simgrid::unw::create_context(this->unw_underlying_addr_space, this->pid_);
 }
 
-RemoteProcess::~RemoteProcess()
+RemoteProcessMemory::~RemoteProcessMemory()
 {
   if (this->memory_file >= 0)
     close(this->memory_file);
@@ -141,11 +141,11 @@ RemoteProcess::~RemoteProcess()
  *  Do not use directly, this is used by the getters when appropriate
  *  in order to have fresh data.
  */
-void RemoteProcess::refresh_heap()
+void RemoteProcessMemory::refresh_heap()
 {
   // Read/dereference/refresh the std_heap pointer:
   this->read(this->heap.get(), this->heap_address);
-  this->cache_flags_ |= RemoteProcess::cache_heap;
+  this->cache_flags_ |= RemoteProcessMemory::cache_heap;
 }
 
 /** Refresh the information about the process
@@ -153,24 +153,24 @@ void RemoteProcess::refresh_heap()
  *  Do not use directly, this is used by the getters when appropriate
  *  in order to have fresh data.
  * */
-void RemoteProcess::refresh_malloc_info()
+void RemoteProcessMemory::refresh_malloc_info()
 {
   // Refresh process->heapinfo:
-  if (this->cache_flags_ & RemoteProcess::cache_malloc)
+  if (this->cache_flags_ & RemoteProcessMemory::cache_malloc)
     return;
   size_t count = this->heap->heaplimit + 1;
   if (this->heap_info.size() < count)
     this->heap_info.resize(count);
   this->read_bytes(this->heap_info.data(), count * sizeof(malloc_info), remote(this->heap->heapinfo));
-  this->cache_flags_ |= RemoteProcess::cache_malloc;
+  this->cache_flags_ |= RemoteProcessMemory::cache_malloc;
 }
-std::size_t RemoteProcess::get_remote_heap_bytes()
+std::size_t RemoteProcessMemory::get_remote_heap_bytes()
 {
   return mmalloc_get_bytes_used_remote(get_heap()->heaplimit, get_malloc_info());
 }
 
 /** @brief Finds the range of the different memory segments and binary paths */
-void RemoteProcess::init_memory_map_info()
+void RemoteProcessMemory::init_memory_map_info()
 {
   XBT_DEBUG("Get debug information ...");
   this->maestro_stack_start_ = nullptr;
@@ -231,7 +231,7 @@ void RemoteProcess::init_memory_map_info()
   XBT_DEBUG("Get debug information done !");
 }
 
-std::shared_ptr<simgrid::mc::ObjectInformation> RemoteProcess::find_object_info(RemotePtr<void> addr) const
+std::shared_ptr<simgrid::mc::ObjectInformation> RemoteProcessMemory::find_object_info(RemotePtr<void> addr) const
 {
   for (auto const& object_info : this->object_infos)
     if (addr.address() >= (std::uint64_t)object_info->start && addr.address() <= (std::uint64_t)object_info->end)
@@ -239,7 +239,7 @@ std::shared_ptr<simgrid::mc::ObjectInformation> RemoteProcess::find_object_info(
   return nullptr;
 }
 
-std::shared_ptr<ObjectInformation> RemoteProcess::find_object_info_exec(RemotePtr<void> addr) const
+std::shared_ptr<ObjectInformation> RemoteProcessMemory::find_object_info_exec(RemotePtr<void> addr) const
 {
   for (std::shared_ptr<ObjectInformation> const& info : this->object_infos)
     if (addr.address() >= (std::uint64_t)info->start_exec && addr.address() <= (std::uint64_t)info->end_exec)
@@ -247,7 +247,7 @@ std::shared_ptr<ObjectInformation> RemoteProcess::find_object_info_exec(RemotePt
   return nullptr;
 }
 
-std::shared_ptr<ObjectInformation> RemoteProcess::find_object_info_rw(RemotePtr<void> addr) const
+std::shared_ptr<ObjectInformation> RemoteProcessMemory::find_object_info_rw(RemotePtr<void> addr) const
 {
   for (std::shared_ptr<ObjectInformation> const& info : this->object_infos)
     if (addr.address() >= (std::uint64_t)info->start_rw && addr.address() <= (std::uint64_t)info->end_rw)
@@ -255,7 +255,7 @@ std::shared_ptr<ObjectInformation> RemoteProcess::find_object_info_rw(RemotePtr<
   return nullptr;
 }
 
-simgrid::mc::Frame* RemoteProcess::find_function(RemotePtr<void> ip) const
+simgrid::mc::Frame* RemoteProcessMemory::find_function(RemotePtr<void> ip) const
 {
   std::shared_ptr<simgrid::mc::ObjectInformation> info = this->find_object_info_exec(ip);
   return info ? info->find_function((void*)ip.address()) : nullptr;
@@ -263,7 +263,7 @@ simgrid::mc::Frame* RemoteProcess::find_function(RemotePtr<void> ip) const
 
 /** Find (one occurrence of) the named variable definition
  */
-const simgrid::mc::Variable* RemoteProcess::find_variable(const char* name) const
+const simgrid::mc::Variable* RemoteProcessMemory::find_variable(const char* name) const
 {
   // First lookup the variable in the executable shared object.
   // A global variable used directly by the executable code from a library
@@ -285,7 +285,7 @@ const simgrid::mc::Variable* RemoteProcess::find_variable(const char* name) cons
   return nullptr;
 }
 
-void RemoteProcess::read_variable(const char* name, void* target, size_t size) const
+void RemoteProcessMemory::read_variable(const char* name, void* target, size_t size) const
 {
   const simgrid::mc::Variable* var = this->find_variable(name);
   xbt_assert(var, "Variable %s not found", name);
@@ -301,7 +301,7 @@ void RemoteProcess::read_variable(const char* name, void* target, size_t size) c
   this->read_bytes(target, size, remote(var->address));
 }
 
-std::string RemoteProcess::read_string(RemotePtr<char> address) const
+std::string RemoteProcessMemory::read_string(RemotePtr<char> address) const
 {
   if (not address)
     return {};
@@ -324,7 +324,8 @@ std::string RemoteProcess::read_string(RemotePtr<char> address) const
   }
 }
 
-void* RemoteProcess::read_bytes(void* buffer, std::size_t size, RemotePtr<void> address, ReadOptions /*options*/) const
+void* RemoteProcessMemory::read_bytes(void* buffer, std::size_t size, RemotePtr<void> address,
+                                      ReadOptions /*options*/) const
 {
   xbt_assert(pread_whole(this->memory_file, buffer, size, (size_t)address.address()) != -1,
              "Read at %p from process %lli failed", (void*)address.address(), (long long)this->pid_);
@@ -337,7 +338,7 @@ void* RemoteProcess::read_bytes(void* buffer, std::size_t size, RemotePtr<void>
  *  @param len      data size
  *  @param address  target process memory address (target)
  */
-void RemoteProcess::write_bytes(const void* buffer, size_t len, RemotePtr<void> address) const
+void RemoteProcessMemory::write_bytes(const void* buffer, size_t len, RemotePtr<void> address) const
 {
   xbt_assert(pwrite_whole(this->memory_file, buffer, len, (size_t)address.address()) != -1,
              "Write to process %lli failed", (long long)this->pid_);
@@ -352,7 +353,7 @@ static void zero_buffer_init(const void** zero_buffer, size_t zero_buffer_size)
   close(fd);
 }
 
-void RemoteProcess::clear_bytes(RemotePtr<void> address, size_t len) const
+void RemoteProcessMemory::clear_bytes(RemotePtr<void> address, size_t len) const
 {
   static constexpr size_t zero_buffer_size = 10 * 4096;
   static const void* zero_buffer;
@@ -367,7 +368,7 @@ void RemoteProcess::clear_bytes(RemotePtr<void> address, size_t len) const
   }
 }
 
-void RemoteProcess::ignore_region(std::uint64_t addr, std::size_t size)
+void RemoteProcessMemory::ignore_region(std::uint64_t addr, std::size_t size)
 {
   IgnoredRegion region;
   region.addr = addr;
@@ -381,7 +382,7 @@ void RemoteProcess::ignore_region(std::uint64_t addr, std::size_t size)
     ignored_regions_.insert(pos, region);
 }
 
-void RemoteProcess::ignore_heap(IgnoredHeapRegion const& region)
+void RemoteProcessMemory::ignore_heap(IgnoredHeapRegion const& region)
 {
   // Binary search the position of insertion:
   auto pos = std::lower_bound(ignored_heap_.begin(), ignored_heap_.end(), region.address,
@@ -392,7 +393,7 @@ void RemoteProcess::ignore_heap(IgnoredHeapRegion const& region)
   }
 }
 
-void RemoteProcess::unignore_heap(void* address, size_t size)
+void RemoteProcessMemory::unignore_heap(void* address, size_t size)
 {
   // Binary search:
   auto pos = std::lower_bound(ignored_heap_.begin(), ignored_heap_.end(), address,
@@ -401,7 +402,7 @@ void RemoteProcess::unignore_heap(void* address, size_t size)
     ignored_heap_.erase(pos);
 }
 
-void RemoteProcess::ignore_local_variable(const char* var_name, const char* frame_name) const
+void RemoteProcessMemory::ignore_local_variable(const char* var_name, const char* frame_name) const
 {
   if (frame_name != nullptr && strcmp(frame_name, "*") == 0)
     frame_name = nullptr;
@@ -409,7 +410,7 @@ void RemoteProcess::ignore_local_variable(const char* var_name, const char* fram
     info->remove_local_variable(var_name, frame_name);
 }
 
-void RemoteProcess::dump_stack() const
+void RemoteProcessMemory::dump_stack() const
 {
   unw_addr_space_t as = unw_create_addr_space(&_UPT_accessors, BYTE_ORDER);
   if (as == nullptr) {
similarity index 89%
rename from src/mc/remote/RemoteProcess.hpp
rename to src/mc/sosp/RemoteProcessMemory.hpp
index b9dca02..1e3422a 100644 (file)
@@ -60,23 +60,23 @@ struct IgnoredHeapRegion {
  *  - stack unwinding;
  *  - etc.
  */
-class RemoteProcess final : public AddressSpace {
+class RemoteProcessMemory final : public AddressSpace {
 private:
   // Those flags are used to track down which cached information
   // is still up to date and which information needs to be updated.
-  static constexpr int cache_none            = 0;
-  static constexpr int cache_heap            = 1;
-  static constexpr int cache_malloc          = 2;
+  static constexpr int cache_none   = 0;
+  static constexpr int cache_heap   = 1;
+  static constexpr int cache_malloc = 2;
 
 public:
-  explicit RemoteProcess(pid_t pid);
-  ~RemoteProcess() override;
+  explicit RemoteProcessMemory(pid_t pid);
+  ~RemoteProcessMemory() override;
   void init(xbt_mheap_t mmalloc_default_mdp);
 
-  RemoteProcess(RemoteProcess const&) = delete;
-  RemoteProcess(RemoteProcess&&)      = delete;
-  RemoteProcess& operator=(RemoteProcess const&) = delete;
-  RemoteProcess& operator=(RemoteProcess&&) = delete;
+  RemoteProcessMemory(RemoteProcessMemory const&)            = delete;
+  RemoteProcessMemory(RemoteProcessMemory&&)                 = delete;
+  RemoteProcessMemory& operator=(RemoteProcessMemory const&) = delete;
+  RemoteProcessMemory& operator=(RemoteProcessMemory&&)      = delete;
 
   /* ************* */
   /* Low-level API */
@@ -115,20 +115,20 @@ public:
   // Heap access:
   xbt_mheap_t get_heap()
   {
-    if (not(this->cache_flags_ & RemoteProcess::cache_heap))
+    if (not(this->cache_flags_ & RemoteProcessMemory::cache_heap))
       this->refresh_heap();
     return this->heap.get();
   }
   const malloc_info* get_malloc_info()
   {
-    if (not(this->cache_flags_ & RemoteProcess::cache_malloc))
+    if (not(this->cache_flags_ & RemoteProcessMemory::cache_malloc))
       this->refresh_malloc_info();
     return this->heap_info.data();
   }
   /* Get the amount of memory mallocated in the remote process (requires mmalloc) */
   std::size_t get_remote_heap_bytes();
 
-  void clear_cache() { this->cache_flags_ = RemoteProcess::cache_none; }
+  void clear_cache() { this->cache_flags_ = RemoteProcessMemory::cache_none; }
 
   std::vector<IgnoredRegion> const& ignored_regions() const { return ignored_regions_; }
   void ignore_region(std::uint64_t address, std::size_t size);
@@ -177,7 +177,7 @@ private:
   std::vector<IgnoredHeapRegion> ignored_heap_;
 
   /** State of the cache (which variables are up to date) */
-  int cache_flags_ = RemoteProcess::cache_none;
+  int cache_flags_ = RemoteProcessMemory::cache_none;
 
 public:
   // object info
index afe91c6..be64dff 100644 (file)
@@ -13,7 +13,7 @@ namespace simgrid::mc {
 /************************************* Take Snapshot ************************************/
 /****************************************************************************************/
 
-void Snapshot::snapshot_regions(RemoteProcess* process)
+void Snapshot::snapshot_regions(RemoteProcessMemory* process)
 {
   snapshot_regions_.clear();
 
@@ -74,7 +74,7 @@ static void fill_local_variables_values(mc_stack_frame_t stack_frame, Frame* sco
     else if (not current_variable.location_list.empty()) {
       dwarf::Location location = simgrid::dwarf::resolve(current_variable.location_list, current_variable.object_info,
                                                          &(stack_frame->unw_cursor), (void*)stack_frame->frame_base,
-                                                         &mc_model_checker->get_remote_process());
+                                                         &mc_model_checker->get_remote_process_memory());
 
       xbt_assert(location.in_memory(), "Cannot handle non-address variable");
       new_var.address = location.address();
@@ -99,7 +99,7 @@ static std::vector<s_local_variable_t> get_local_variables_values(std::vector<s_
 
 static std::vector<s_mc_stack_frame_t> unwind_stack_frames(UnwindContext* stack_context)
 {
-  const RemoteProcess* process = &mc_model_checker->get_remote_process();
+  const RemoteProcessMemory* process = &mc_model_checker->get_remote_process_memory();
   std::vector<s_mc_stack_frame_t> result;
 
   unw_cursor_t c = stack_context->cursor();
@@ -149,7 +149,7 @@ static std::vector<s_mc_stack_frame_t> unwind_stack_frames(UnwindContext* stack_
   return result;
 }
 
-void Snapshot::snapshot_stacks(RemoteProcess* process)
+void Snapshot::snapshot_stacks(RemoteProcessMemory* process)
 {
   for (auto const& stack : process->stack_areas()) {
     s_mc_snapshot_stack_t st;
@@ -174,30 +174,31 @@ void Snapshot::snapshot_stacks(RemoteProcess* process)
 
 void Snapshot::handle_ignore()
 {
-  xbt_assert(get_remote_process());
+  xbt_assert(get_remote_process_memory());
 
   // Copy the memory:
-  for (auto const& region : get_remote_process()->ignored_regions()) {
+  for (auto const& region : get_remote_process_memory()->ignored_regions()) {
     s_mc_snapshot_ignored_data_t ignored_data;
     ignored_data.start = (void*)region.addr;
     ignored_data.data.resize(region.size);
     // TODO, we should do this once per privatization segment:
-    get_remote_process()->read_bytes(ignored_data.data.data(), region.size, remote(region.addr));
+    get_remote_process_memory()->read_bytes(ignored_data.data.data(), region.size, remote(region.addr));
     ignored_data_.push_back(std::move(ignored_data));
   }
 
   // Zero the memory:
-  for (auto const& region : get_remote_process()->ignored_regions())
-    get_remote_process()->clear_bytes(remote(region.addr), region.size);
+  for (auto const& region : get_remote_process_memory()->ignored_regions())
+    get_remote_process_memory()->clear_bytes(remote(region.addr), region.size);
 }
 
 void Snapshot::ignore_restore() const
 {
   for (auto const& ignored_data : ignored_data_)
-    get_remote_process()->write_bytes(ignored_data.data.data(), ignored_data.data.size(), remote(ignored_data.start));
+    get_remote_process_memory()->write_bytes(ignored_data.data.data(), ignored_data.data.size(),
+                                             remote(ignored_data.start));
 }
 
-Snapshot::Snapshot(long num_state, PageStore& store, RemoteProcess* process)
+Snapshot::Snapshot(long num_state, PageStore& store, RemoteProcessMemory* process)
     : AddressSpace(process), page_store_(store), num_state_(num_state)
 {
   XBT_DEBUG("Taking snapshot %ld", num_state);
@@ -241,7 +242,7 @@ void* Snapshot::read_bytes(void* buffer, std::size_t size, RemotePtr<void> addre
       return buffer;
     }
   } else
-    return this->get_remote_process()->read_bytes(buffer, size, address, options);
+    return this->get_remote_process_memory()->read_bytes(buffer, size, address, options);
 }
 /** @brief Find the snapshotted region from a pointer
  *
@@ -270,7 +271,7 @@ Region* Snapshot::get_region(const void* addr, Region* hinted_region) const
     return get_region(addr);
 }
 
-void Snapshot::restore(RemoteProcess* process) const
+void Snapshot::restore(RemoteProcessMemory* process) const
 {
   XBT_DEBUG("Restore snapshot %ld", num_state_);
 
index baf06f5..8f8c437 100644 (file)
@@ -8,8 +8,8 @@
 
 #include "src/mc/ModelChecker.hpp"
 #include "src/mc/inspect/mc_unw.hpp"
-#include "src/mc/remote/RemoteProcess.hpp"
 #include "src/mc/sosp/Region.hpp"
+#include "src/mc/sosp/RemoteProcessMemory.hpp"
 
 // ***** MC Snapshot
 
@@ -62,12 +62,13 @@ class XBT_PRIVATE Snapshot final : public AddressSpace {
 
 public:
   /* Initialization */
-  Snapshot(long num_state, PageStore& store, RemoteProcess* process = &mc_model_checker->get_remote_process());
+  Snapshot(long num_state, PageStore& store,
+           RemoteProcessMemory* process = &mc_model_checker->get_remote_process_memory());
 
   /* Regular use */
   bool on_heap(const void* address) const
   {
-    const s_xbt_mheap_t* heap = get_remote_process()->get_heap();
+    const s_xbt_mheap_t* heap = get_remote_process_memory()->get_heap();
     return address >= heap->heapbase && address < heap->breakval;
   }
 
@@ -75,7 +76,7 @@ public:
                    ReadOptions options = ReadOptions::none()) const override;
   Region* get_region(const void* addr) const;
   Region* get_region(const void* addr, Region* hinted_region) const;
-  void restore(RemoteProcess* process) const;
+  void restore(RemoteProcessMemory* process) const;
 
   bool operator==(const Snapshot& other);
   bool operator!=(const Snapshot& other) { return not(*this == other); }
@@ -92,8 +93,8 @@ public:
 
 private:
   void add_region(RegionType type, ObjectInformation* object_info, void* start_addr, std::size_t size);
-  void snapshot_regions(RemoteProcess* process);
-  void snapshot_stacks(RemoteProcess* process);
+  void snapshot_regions(RemoteProcessMemory* process);
+  void snapshot_stacks(RemoteProcessMemory* process);
   void handle_ignore();
   void ignore_restore() const;
   hash_type do_hash() const;
index 6c52fb6..95c10a0 100644 (file)
@@ -40,11 +40,11 @@ public:
     mc_model_checker = nullptr;
   }
 
-  static std::unique_ptr<simgrid::mc::RemoteProcess> process;
+  static std::unique_ptr<simgrid::mc::RemoteProcessMemory> process;
 };
 
 // static member variables init.
-std::unique_ptr<simgrid::mc::RemoteProcess> snap_test_helper::process = nullptr;
+std::unique_ptr<simgrid::mc::RemoteProcessMemory> snap_test_helper::process = nullptr;
 simgrid::mc::PageStore snap_test_helper::page_store_(500);
 
 void snap_test_helper::init_memory(void* mem, size_t size)
@@ -60,7 +60,7 @@ void snap_test_helper::Init()
   REQUIRE(xbt_pagesize == getpagesize());
   REQUIRE(1 << xbt_pagebits == xbt_pagesize);
 
-  process = std::make_unique<simgrid::mc::RemoteProcess>(getpid());
+  process = std::make_unique<simgrid::mc::RemoteProcessMemory>(getpid());
   process->init(nullptr);
   mc_model_checker = new ::simgrid::mc::ModelChecker(std::move(process), -1);
 }
index a9f639d..2e50663 100644 (file)
@@ -12,7 +12,7 @@
 #include "src/mc/inspect/ObjectInformation.hpp"
 #include "src/mc/inspect/Type.hpp"
 #include "src/mc/inspect/Variable.hpp"
-#include "src/mc/remote/RemoteProcess.hpp"
+#include "src/mc/sosp/RemoteProcessMemory.hpp"
 
 #include <array>
 #include <cassert>
@@ -148,7 +148,7 @@ static void test_deref(simgrid::dwarf::ExpressionContext const& state)
 
 int main()
 {
-  auto* process = new simgrid::mc::RemoteProcess(getpid());
+  auto* process = new simgrid::mc::RemoteProcessMemory(getpid());
   process->init(nullptr);
 
   simgrid::dwarf::ExpressionContext state;
index 39aec32..b564b1c 100644 (file)
@@ -16,7 +16,7 @@
 #include "src/mc/inspect/ObjectInformation.hpp"
 #include "src/mc/inspect/Type.hpp"
 #include "src/mc/inspect/Variable.hpp"
-#include "src/mc/remote/RemoteProcess.hpp"
+#include "src/mc/sosp/RemoteProcessMemory.hpp"
 
 #include <cassert>
 #include <cstring>
@@ -78,7 +78,7 @@ static void test_local_variable(simgrid::mc::ObjectInformation* info, const char
   xbt_assert(location.address() == address, "Bad resolution of local variable %s of %s", variable, function);
 }
 
-static const simgrid::mc::Variable* test_global_variable(const simgrid::mc::RemoteProcess& process,
+static const simgrid::mc::Variable* test_global_variable(const simgrid::mc::RemoteProcessMemory& process,
                                                          simgrid::mc::ObjectInformation* info, const char* name,
                                                          void* address, long byte_size)
 {
@@ -110,7 +110,7 @@ struct s_foo {
   int i;
 };
 
-static void test_type_by_name(const simgrid::mc::RemoteProcess& process, s_foo /*my_foo*/)
+static void test_type_by_name(const simgrid::mc::RemoteProcessMemory& process, s_foo /*my_foo*/)
 {
   assert(process.binary_info->full_types_by_name.find("struct s_foo") != process.binary_info->full_types_by_name.end());
 }
@@ -122,7 +122,7 @@ int main(int argc, char** argv)
   const simgrid::mc::Variable* var;
   simgrid::mc::Type* type;
 
-  simgrid::mc::RemoteProcess process(getpid());
+  simgrid::mc::RemoteProcessMemory process(getpid());
   process.init(nullptr);
 
   test_global_variable(process, process.binary_info.get(), "some_local_variable", &some_local_variable, sizeof(int));
index a573f98..bcb5bdc 100644 (file)
@@ -570,17 +570,17 @@ set(MC_SRC
   src/mc/remote/Channel.hpp
   src/mc/remote/CheckerSide.cpp
   src/mc/remote/CheckerSide.hpp
-  src/mc/remote/RemoteProcess.cpp
-  src/mc/remote/RemoteProcess.hpp
   src/mc/remote/RemotePtr.hpp
   src/mc/remote/mc_protocol.h
-
+  
   src/mc/sosp/ChunkedData.cpp
   src/mc/sosp/ChunkedData.hpp
   src/mc/sosp/PageStore.cpp
   src/mc/sosp/PageStore.hpp
   src/mc/sosp/Region.cpp
   src/mc/sosp/Region.hpp
+  src/mc/sosp/RemoteProcessMemory.cpp
+  src/mc/sosp/RemoteProcessMemory.hpp
   src/mc/sosp/Snapshot.cpp
   src/mc/sosp/Snapshot.hpp