Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Move another function of ModelChecker to RemoteProcessMemory
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 12 Mar 2023 23:05:42 +0000 (00:05 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 12 Mar 2023 23:05:42 +0000 (00:05 +0100)
src/mc/ModelChecker.cpp
src/mc/ModelChecker.hpp
src/mc/sosp/RemoteProcessMemory.cpp

index a59b3aa..10f0ba3 100644 (file)
@@ -69,8 +69,6 @@ void ModelChecker::start()
   xbt_assert(waitpid(pid, &status, WAITPID_CHECKED_FLAGS) == pid && WIFSTOPPED(status) && WSTOPSIG(status) == SIGSTOP,
              "Could not wait model-checked process");
 
-  setup_ignore();
-
   errno = 0;
 #ifdef __linux__
   ptrace(PTRACE_SETOPTIONS, pid, nullptr, PTRACE_O_TRACEEXIT);
@@ -87,24 +85,6 @@ void ModelChecker::start()
              errno);
 }
 
-static constexpr auto ignored_local_variables = {
-    std::make_pair("e", "*"),
-    std::make_pair("_log_ev", "*"),
-
-    /* Ignore local variable about time used for tracing */
-    std::make_pair("start_time", "*"),
-};
-
-void ModelChecker::setup_ignore()
-{
-  const RemoteProcessMemory& process = this->get_remote_process_memory();
-  for (auto const& [var, frame] : ignored_local_variables)
-    process.ignore_local_variable(var, frame);
-
-  /* Static variable used for tracing */
-  process.ignore_global_variable("counter");
-}
-
 bool ModelChecker::handle_message(const char* buffer, ssize_t size)
 {
   s_mc_message_t base_message;
index 40ad462..0d51e9e 100644 (file)
@@ -40,7 +40,6 @@ public:
   void set_exploration(Exploration* exploration) { exploration_ = exploration; }
 
 private:
-  void setup_ignore();
   bool handle_message(const char* buffer, ssize_t size);
   void handle_waitpid();
 };
index 7fd28b0..2ebe51b 100644 (file)
@@ -119,6 +119,18 @@ void RemoteProcessMemory::init(xbt_mheap_t mmalloc_default_mdp)
   this->unw_addr_space            = simgrid::mc::UnwindContext::createUnwindAddressSpace();
   this->unw_underlying_addr_space = simgrid::unw::create_addr_space();
   this->unw_underlying_context    = simgrid::unw::create_context(this->unw_underlying_addr_space, this->pid_);
+
+  auto ignored_local_variables = {
+      std::make_pair("e", "*"),
+      std::make_pair("_log_ev", "*"),
+
+      /* Ignore local variable about time used for tracing */
+      std::make_pair("start_time", "*"),
+  };
+  for (auto const& [var, frame] : ignored_local_variables)
+    ignore_local_variable(var, frame);
+
+  ignore_global_variable("counter"); // Static variable used for tracing
 }
 
 RemoteProcessMemory::~RemoteProcessMemory()