Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rename mc::RemoteSimulation into mc::RemoteProcess
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 13 Mar 2021 23:19:04 +0000 (00:19 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 13 Mar 2021 23:42:50 +0000 (00:42 +0100)
26 files changed:
MANIFEST.in
src/mc/AddressSpace.hpp
src/mc/ModelChecker.cpp
src/mc/ModelChecker.hpp
src/mc/Session.cpp
src/mc/api.cpp
src/mc/compare.cpp
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/mc_request.cpp
src/mc/mc_smx.cpp
src/mc/remote/AppSide.cpp
src/mc/remote/RemoteProcess.cpp [moved from src/mc/remote/RemoteSimulation.cpp with 88% similarity]
src/mc/remote/RemoteProcess.hpp [moved from src/mc/remote/RemoteSimulation.hpp with 92% similarity]
src/mc/sosp/Region.cpp
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 c4d738f..b1bc14f 100644 (file)
@@ -2280,9 +2280,9 @@ 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/RemoteSimulation.cpp
-include src/mc/remote/RemoteSimulation.hpp
 include src/mc/remote/mc_protocol.h
 include src/mc/sosp/ChunkedData.cpp
 include src/mc/sosp/ChunkedData.hpp
index f05725b..fd136eb 100644 (file)
@@ -84,17 +84,17 @@ public:
  */
 class AddressSpace {
 private:
-  RemoteSimulation* remote_simulation_;
+  RemoteProcess* remote_process_;
 
 public:
-  explicit AddressSpace(RemoteSimulation* remote_simulation) : remote_simulation_(remote_simulation) {}
+  explicit AddressSpace(RemoteProcess* remote_simulation) : remote_process_(remote_simulation) {}
   virtual ~AddressSpace() = default;
 
   /** The process of this address space
    *
    *  This is where we can get debug information, memory layout, etc.
    */
-  simgrid::mc::RemoteSimulation* get_remote_simulation() const { return remote_simulation_; }
+  simgrid::mc::RemoteProcess* get_remote_simulation() const { return remote_process_; }
 
   /** Read data from the address space
    *
index 141400a..5da95f6 100644 (file)
@@ -10,7 +10,7 @@
 #include "src/mc/mc_config.hpp"
 #include "src/mc/mc_exit.hpp"
 #include "src/mc/mc_private.hpp"
-#include "src/mc/remote/RemoteSimulation.hpp"
+#include "src/mc/remote/RemoteProcess.hpp"
 #include "xbt/automaton.hpp"
 #include "xbt/system_error.hpp"
 
@@ -33,8 +33,8 @@ using simgrid::mc::remote;
 namespace simgrid {
 namespace mc {
 
-ModelChecker::ModelChecker(std::unique_ptr<RemoteSimulation> remote_simulation, int sockfd)
-    : checker_side_(sockfd), remote_simulation_(std::move(remote_simulation))
+ModelChecker::ModelChecker(std::unique_ptr<RemoteProcess> remote_simulation, int sockfd)
+    : checker_side_(sockfd), remote_process_(std::move(remote_simulation))
 {
 }
 
@@ -62,13 +62,13 @@ void ModelChecker::start()
   int status;
 
   // The model-checked process SIGSTOP itself to signal it's ready:
-  const pid_t pid = remote_simulation_->pid();
+  const pid_t pid = remote_process_->pid();
 
   pid_t res = waitpid(pid, &status, WAITPID_CHECKED_FLAGS);
   if (res < 0 || not WIFSTOPPED(status) || WSTOPSIG(status) != SIGSTOP)
     xbt_die("Could not wait model-checked process");
 
-  remote_simulation_->init();
+  remote_process_->init();
 
   if (not _sg_mc_dot_output_file.get().empty())
     MC_init_dot_output();
@@ -95,7 +95,7 @@ static constexpr auto ignored_local_variables = {
 
 void ModelChecker::setup_ignore()
 {
-  const RemoteSimulation& process = this->get_remote_simulation();
+  const RemoteProcess& process = this->get_remote_simulation();
   for (auto const& var : ignored_local_variables)
     process.ignore_local_variable(var.first, var.second);
 
@@ -107,7 +107,7 @@ void ModelChecker::shutdown()
 {
   XBT_DEBUG("Shutting down model-checker");
 
-  RemoteSimulation* process = &this->get_remote_simulation();
+  RemoteProcess* process = &this->get_remote_simulation();
   if (process->running()) {
     XBT_DEBUG("Killing process");
     kill(process->pid(), SIGKILL);
@@ -115,7 +115,7 @@ void ModelChecker::shutdown()
   }
 }
 
-void ModelChecker::resume(RemoteSimulation& process)
+void ModelChecker::resume(RemoteProcess& process)
 {
   int res = checker_side_.get_channel().send(MessageType::CONTINUE);
   if (res)
@@ -213,7 +213,7 @@ bool ModelChecker::handle_message(const char* buffer, ssize_t size)
       if (property_automaton == nullptr)
         property_automaton = xbt_automaton_new();
 
-      const RemoteSimulation* process = &this->get_remote_simulation();
+      const RemoteProcess* process    = &this->get_remote_simulation();
       RemotePtr<int> address          = remote((int*)message.data);
       xbt::add_proposition(property_automaton, message.name.data(),
                            [process, address]() { return process->read(address); });
@@ -264,8 +264,7 @@ void ModelChecker::handle_waitpid()
       // From PTRACE_O_TRACEEXIT:
 #ifdef __linux__
       if (status>>8 == (SIGTRAP | (PTRACE_EVENT_EXIT<<8))) {
-        xbt_assert(ptrace(PTRACE_GETEVENTMSG, remote_simulation_->pid(), 0, &status) != -1,
-                   "Could not get exit status");
+        xbt_assert(ptrace(PTRACE_GETEVENTMSG, remote_process_->pid(), 0, &status) != -1, "Could not get exit status");
         if (WIFSIGNALED(status)) {
           MC_report_crash(status);
           mc_model_checker->exit(SIMGRID_MC_EXIT_PROGRAM_CRASH);
@@ -278,9 +277,9 @@ void ModelChecker::handle_waitpid()
         XBT_DEBUG("Stopped with signal %i", (int) WSTOPSIG(status));
         errno = 0;
 #ifdef __linux__
-        ptrace(PTRACE_CONT, remote_simulation_->pid(), 0, WSTOPSIG(status));
+        ptrace(PTRACE_CONT, remote_process_->pid(), 0, WSTOPSIG(status));
 #elif defined BSD
-        ptrace(PT_CONTINUE, remote_simulation_->pid(), (caddr_t)1, WSTOPSIG(status));
+        ptrace(PT_CONTINUE, remote_process_->pid(), (caddr_t)1, WSTOPSIG(status));
 #endif
         xbt_assert(errno == 0, "Could not PTRACE_CONT");
       }
@@ -311,8 +310,8 @@ void ModelChecker::handle_simcall(Transition const& transition)
   m.pid_              = transition.pid_;
   m.times_considered_ = transition.times_considered_;
   checker_side_.get_channel().send(m);
-  this->remote_simulation_->clear_cache();
-  if (this->remote_simulation_->running())
+  this->remote_process_->clear_cache();
+  if (this->remote_process_->running())
     checker_side_.dispatch();
 }
 bool ModelChecker::simcall_is_visible(int aid)
@@ -336,7 +335,7 @@ bool ModelChecker::simcall_is_visible(int aid)
 
   XBT_DEBUG("is_visible(%d) is returning %s", aid, answer.value ? "true" : "false");
 
-  this->remote_simulation_->clear_cache();
+  this->remote_process_->clear_cache();
   return answer.value;
 }
 
index 99aa60d..aade1c2 100644 (file)
@@ -25,7 +25,7 @@ class ModelChecker {
   std::set<xbt::string, std::less<>> hostnames_;
   // This is the parent snapshot of the current state:
   PageStore page_store_{500};
-  std::unique_ptr<RemoteSimulation> remote_simulation_;
+  std::unique_ptr<RemoteProcess> remote_process_;
   Checker* checker_ = nullptr;
 
   // Expect MessageType::SIMCALL_TO_STRING or MessageType::SIMCALL_DOT_LABEL
@@ -34,9 +34,9 @@ class ModelChecker {
 public:
   ModelChecker(ModelChecker const&) = delete;
   ModelChecker& operator=(ModelChecker const&) = delete;
-  explicit ModelChecker(std::unique_ptr<RemoteSimulation> remote_simulation, int sockfd);
+  explicit ModelChecker(std::unique_ptr<RemoteProcess> remote_simulation, int sockfd);
 
-  RemoteSimulation& get_remote_simulation() { return *remote_simulation_; }
+  RemoteProcess& get_remote_simulation() { return *remote_process_; }
   Channel& channel() { return checker_side_.get_channel(); }
   PageStore& page_store()
   {
@@ -50,7 +50,7 @@ public:
 
   void start();
   void shutdown();
-  void resume(simgrid::mc::RemoteSimulation& get_remote_simulation);
+  void resume(simgrid::mc::RemoteProcess& get_remote_simulation);
   void wait_for_requests();
   void handle_simcall(Transition const& transition);
 
index 0677662..401346b 100644 (file)
@@ -86,7 +86,7 @@ Session::Session(const std::function<void()>& code)
 
   xbt_assert(mc_model_checker == nullptr, "Did you manage to start the MC twice in this process?");
 
-  auto process = std::make_unique<simgrid::mc::RemoteSimulation>(pid);
+  auto process   = std::make_unique<simgrid::mc::RemoteProcess>(pid);
   model_checker_ = std::make_unique<simgrid::mc::ModelChecker>(std::move(process), sockets[1]);
 
   mc_model_checker = model_checker_.get();
index 6831053..f95a8b2 100644 (file)
@@ -9,7 +9,7 @@
 #include "src/mc/mc_exit.hpp"
 #include "src/mc/mc_pattern.hpp"
 #include "src/mc/mc_private.hpp"
-#include "src/mc/remote/RemoteSimulation.hpp"
+#include "src/mc/remote/RemoteProcess.hpp"
 
 #include <xbt/asserts.h>
 #include <xbt/log.h>
@@ -333,7 +333,7 @@ xbt::string const& Api::get_actor_host_name(smx_actor_t actor) const
   if (mc_model_checker == nullptr)
     return actor->get_host()->get_name();
 
-  const simgrid::mc::RemoteSimulation* process = &mc_model_checker->get_remote_simulation();
+  const simgrid::mc::RemoteProcess* process = &mc_model_checker->get_remote_simulation();
 
   // Read the simgrid::xbt::string in the MCed process:
   simgrid::mc::ActorInformation* info = actor_info_cast(actor);
@@ -354,7 +354,7 @@ std::string Api::get_actor_name(smx_actor_t actor) const
 
   simgrid::mc::ActorInformation* info = actor_info_cast(actor);
   if (info->name.empty()) {
-    const simgrid::mc::RemoteSimulation* process = &mc_model_checker->get_remote_simulation();
+    const simgrid::mc::RemoteProcess* process = &mc_model_checker->get_remote_simulation();
 
     simgrid::xbt::string_data string_data = simgrid::xbt::string::to_string_data(actor->name_);
     info->name = process->read_string(remote(string_data.data), string_data.len);
@@ -540,7 +540,7 @@ smx_actor_t Api::get_dst_actor(RemotePtr<kernel::activity::CommImpl> const& comm
 
 std::size_t Api::get_remote_heap_bytes() const
 {
-  RemoteSimulation& process = mc_model_checker->get_remote_simulation();
+  RemoteProcess& process    = mc_model_checker->get_remote_simulation();
   auto heap_bytes_used      = mmalloc_get_bytes_used_remote(process.get_heap()->heaplimit, process.get_malloc_info());
   return heap_bytes_used;
 }
index f97b598..15cecb7 100644 (file)
@@ -207,7 +207,7 @@ static bool heap_area_differ(StateComparator& state, const void* area1, const vo
 
 static bool mmalloc_heap_differ(StateComparator& state, const Snapshot& snapshot1, const Snapshot& snapshot2)
 {
-  const RemoteSimulation& process = mc_model_checker->get_remote_simulation();
+  const RemoteProcess& process = mc_model_checker->get_remote_simulation();
 
   /* Check busy blocks */
   size_t i1 = 1;
@@ -435,7 +435,7 @@ static bool heap_area_differ_without_type(StateComparator& state, const void* re
                                           const Snapshot& snapshot1, const Snapshot& snapshot2,
                                           HeapLocationPairs* previous, int size, int check_ignore)
 {
-  const RemoteSimulation& process = mc_model_checker->get_remote_simulation();
+  const RemoteProcess& process = mc_model_checker->get_remote_simulation();
   const Region* heap_region1  = MC_get_heap_region(snapshot1);
   const Region* heap_region2  = MC_get_heap_region(snapshot2);
 
@@ -721,7 +721,7 @@ static Type* get_offset_type(void* real_base_address, Type* type, int offset, in
 static bool heap_area_differ(StateComparator& state, const void* area1, const void* area2, const Snapshot& snapshot1,
                              const Snapshot& snapshot2, HeapLocationPairs* previous, Type* type, int pointer_level)
 {
-  const simgrid::mc::RemoteSimulation& process = mc_model_checker->get_remote_simulation();
+  const simgrid::mc::RemoteProcess& process = mc_model_checker->get_remote_simulation();
 
   ssize_t block1;
   ssize_t block2;
@@ -1188,7 +1188,7 @@ bool snapshot_equal(const Snapshot* s1, const Snapshot* s2)
   // TODO, make this a field of ModelChecker or something similar
   static StateComparator state_comparator;
 
-  const RemoteSimulation& process = mc_model_checker->get_remote_simulation();
+  const RemoteProcess& process = mc_model_checker->get_remote_simulation();
 
   if (s1->hash_ != s2->hash_) {
     XBT_VERB("(%d - %d) Different hash: 0x%" PRIx64 "--0x%" PRIx64, s1->num_state_, s2->num_state_, s1->hash_,
index 9586e55..eb5e219 100644 (file)
@@ -157,7 +157,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::RemoteSimulation* process,
+XBT_PRIVATE void postProcessObjectInformation(const simgrid::mc::RemoteProcess* process,
                                               simgrid::mc::ObjectInformation* info);
 } // namespace mc
 } // namespace simgrid
index 646ecc1..a11a069 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/RemoteSimulation.hpp"
+#include "src/mc/remote/RemoteProcess.hpp"
 
 #include <algorithm>
 #include <array>
@@ -1164,7 +1164,7 @@ std::shared_ptr<ObjectInformation> createObjectInformation(std::vector<xbt::VmMa
 
 /*************************************************************************/
 
-void postProcessObjectInformation(const RemoteSimulation* process, ObjectInformation* info)
+void postProcessObjectInformation(const RemoteProcess* process, ObjectInformation* info)
 {
   for (auto& t : info->types) {
     Type* type    = &(t.second);
index 8f37ddb..b5c5a07 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "src/mc/inspect/mc_unw.hpp"
 #include "src/mc/inspect/Frame.hpp"
-#include "src/mc/remote/RemoteSimulation.hpp"
+#include "src/mc/remote/RemoteProcess.hpp"
 
 #include <cstring>
 
@@ -221,7 +221,7 @@ unw_addr_space_t UnwindContext::createUnwindAddressSpace()
   return unw_create_addr_space(&accessors, BYTE_ORDER);
 }
 
-void UnwindContext::initialize(simgrid::mc::RemoteSimulation* process, unw_context_t* c)
+void UnwindContext::initialize(simgrid::mc::RemoteProcess* process, unw_context_t* c)
 {
   this->address_space_ = process;
   this->process_      = process;
index 4dc94d6..462486a 100644 (file)
@@ -44,11 +44,11 @@ namespace mc {
 
 class UnwindContext {
   simgrid::mc::AddressSpace* address_space_ = nullptr;
-  simgrid::mc::RemoteSimulation* process_   = nullptr;
+  simgrid::mc::RemoteProcess* process_      = nullptr;
   unw_context_t unwind_context_             = {};
 
 public:
-  void initialize(simgrid::mc::RemoteSimulation* process, unw_context_t* c);
+  void initialize(simgrid::mc::RemoteProcess* process, unw_context_t* c);
   unw_cursor_t cursor();
 
 private: // Methods and virtual table for libunwind
index b79000a..935b8ae 100644 (file)
@@ -4,7 +4,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/RemoteSimulation.hpp"
+#include "src/mc/remote/RemoteProcess.hpp"
 
 #include <sys/types.h>
 #include <sys/uio.h>
index 21c2e8c..b456467 100644 (file)
@@ -17,7 +17,7 @@
 #if SIMGRID_HAVE_MC
 #include "src/mc/ModelChecker.hpp"
 #include "src/mc/Session.hpp"
-#include "src/mc/remote/RemoteSimulation.hpp"
+#include "src/mc/remote/RemoteProcess.hpp"
 
 using simgrid::mc::remote;
 #endif
index 4dfc4d5..48d6b2f 100644 (file)
@@ -18,7 +18,7 @@ class PageStore;
 class ChunkedData;
 class ModelChecker;
 class AddressSpace;
-class RemoteSimulation;
+class RemoteProcess;
 class Snapshot;
 class ObjectInformation;
 class Member;
index 6c271aa..479bcb6 100644 (file)
@@ -9,7 +9,7 @@
 #include "src/kernel/activity/MutexImpl.hpp"
 #include "src/mc/ModelChecker.hpp"
 #include "src/mc/checker/SimcallObserver.hpp"
-#include "src/mc/remote/RemoteSimulation.hpp"
+#include "src/mc/remote/RemoteProcess.hpp"
 
 #include <array>
 
index a1b7d6c..abb9d42 100644 (file)
@@ -6,7 +6,7 @@
 #include "simgrid/s4u/Host.hpp"
 
 #include "src/mc/ModelChecker.hpp"
-#include "src/mc/remote/RemoteSimulation.hpp"
+#include "src/mc/remote/RemoteProcess.hpp"
 
 using simgrid::mc::remote;
 /** @file
@@ -35,7 +35,7 @@ using simgrid::mc::remote;
  *  @param target       Local vector (to be filled with copies of `s_smx_actor_t`)
  *  @param remote_dynar Address of the process dynar in the remote list
  */
-static void MC_process_refresh_simix_actor_dynar(const simgrid::mc::RemoteSimulation* process,
+static void MC_process_refresh_simix_actor_dynar(const simgrid::mc::RemoteProcess* process,
                                                  std::vector<simgrid::mc::ActorInformation>& target,
                                                  simgrid::mc::RemotePtr<s_xbt_dynar_t> remote_dynar)
 {
@@ -61,9 +61,9 @@ static void MC_process_refresh_simix_actor_dynar(const simgrid::mc::RemoteSimula
 namespace simgrid {
 namespace mc {
 
-void RemoteSimulation::refresh_simix()
+void RemoteProcess::refresh_simix()
 {
-  if (this->cache_flags_ & RemoteSimulation::cache_simix_processes)
+  if (this->cache_flags_ & RemoteProcess::cache_simix_processes)
     return;
 
   // TODO, avoid to reload `&simix_global`, `simix_global`, `*simix_global`
@@ -85,7 +85,7 @@ void RemoteSimulation::refresh_simix()
   MC_process_refresh_simix_actor_dynar(this, this->smx_dead_actors_infos,
                                        remote(simix_global.get_buffer()->dead_actors_vector));
 
-  this->cache_flags_ |= RemoteSimulation::cache_simix_processes;
+  this->cache_flags_ |= RemoteProcess::cache_simix_processes;
 }
 
 }
index 91be2f5..7448d7c 100644 (file)
@@ -7,7 +7,7 @@
 #include "src/internal_config.h"
 #include "src/kernel/actor/ActorImpl.hpp"
 #include "src/mc/checker/SimcallObserver.hpp"
-#include "src/mc/remote/RemoteSimulation.hpp"
+#include "src/mc/remote/RemoteProcess.hpp"
 #include <simgrid/modelchecker.h>
 
 #include <cerrno>
similarity index 88%
rename from src/mc/remote/RemoteSimulation.cpp
rename to src/mc/remote/RemoteProcess.cpp
index 2d6d919..0899bd7 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/RemoteSimulation.hpp"
+#include "src/mc/remote/RemoteProcess.hpp"
 
 #include "src/mc/sosp/Snapshot.hpp"
 #include "xbt/file.hpp"
@@ -227,11 +227,11 @@ int open_vm(pid_t pid, int flags)
   return open(buffer.c_str(), flags);
 }
 
-// ***** RemoteSimulation
+// ***** RemoteProcess
 
-RemoteSimulation::RemoteSimulation(pid_t pid) : AddressSpace(this), pid_(pid), running_(true) {}
+RemoteProcess::RemoteProcess(pid_t pid) : AddressSpace(this), pid_(pid), running_(true) {}
 
-void RemoteSimulation::init()
+void RemoteProcess::init()
 {
   this->memory_map_ = simgrid::xbt::get_memory_map(this->pid_);
   this->init_memory_map_info();
@@ -253,7 +253,7 @@ void RemoteSimulation::init()
   this->unw_underlying_context    = simgrid::unw::create_context(this->unw_underlying_addr_space, this->pid_);
 }
 
-RemoteSimulation::~RemoteSimulation()
+RemoteProcess::~RemoteProcess()
 {
   if (this->memory_file >= 0)
     close(this->memory_file);
@@ -273,13 +273,13 @@ RemoteSimulation::~RemoteSimulation()
  *  Do not use directly, this is used by the getters when appropriate
  *  in order to have fresh data.
  */
-void RemoteSimulation::refresh_heap()
+void RemoteProcess::refresh_heap()
 {
   // Read/dereference/refresh the std_heap pointer:
   if (not this->heap)
     this->heap = std::make_unique<s_xbt_mheap_t>();
   this->read_bytes(this->heap.get(), sizeof(mdesc), remote(this->heap_address));
-  this->cache_flags_ |= RemoteSimulation::cache_heap;
+  this->cache_flags_ |= RemoteProcess::cache_heap;
 }
 
 /** Refresh the information about the process
@@ -287,26 +287,26 @@ void RemoteSimulation::refresh_heap()
  *  Do not use directly, this is used by the getters when appropriate
  *  in order to have fresh data.
  * */
-void RemoteSimulation::refresh_malloc_info()
+void RemoteProcess::refresh_malloc_info()
 {
   // Refresh process->heapinfo:
-  if (this->cache_flags_ & RemoteSimulation::cache_malloc)
+  if (this->cache_flags_ & RemoteProcess::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_ |= RemoteSimulation::cache_malloc;
+  this->cache_flags_ |= RemoteProcess::cache_malloc;
 }
 
 /** @brief Finds the range of the different memory segments and binary paths */
-void RemoteSimulation::init_memory_map_info()
+void RemoteProcess::init_memory_map_info()
 {
   XBT_DEBUG("Get debug information ...");
   this->maestro_stack_start_ = nullptr;
   this->maestro_stack_end_   = nullptr;
   this->object_infos.resize(0);
-  this->binary_info     = nullptr;
+  this->binary_info = nullptr;
 
   std::vector<simgrid::xbt::VmMap> const& maps = this->memory_map_;
 
@@ -367,7 +367,7 @@ void RemoteSimulation::init_memory_map_info()
   XBT_DEBUG("Get debug information done !");
 }
 
-std::shared_ptr<simgrid::mc::ObjectInformation> RemoteSimulation::find_object_info(RemotePtr<void> addr) const
+std::shared_ptr<simgrid::mc::ObjectInformation> RemoteProcess::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)
@@ -375,7 +375,7 @@ std::shared_ptr<simgrid::mc::ObjectInformation> RemoteSimulation::find_object_in
   return nullptr;
 }
 
-std::shared_ptr<ObjectInformation> RemoteSimulation::find_object_info_exec(RemotePtr<void> addr) const
+std::shared_ptr<ObjectInformation> RemoteProcess::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)
@@ -383,7 +383,7 @@ std::shared_ptr<ObjectInformation> RemoteSimulation::find_object_info_exec(Remot
   return nullptr;
 }
 
-std::shared_ptr<ObjectInformation> RemoteSimulation::find_object_info_rw(RemotePtr<void> addr) const
+std::shared_ptr<ObjectInformation> RemoteProcess::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)
@@ -391,7 +391,7 @@ std::shared_ptr<ObjectInformation> RemoteSimulation::find_object_info_rw(RemoteP
   return nullptr;
 }
 
-simgrid::mc::Frame* RemoteSimulation::find_function(RemotePtr<void> ip) const
+simgrid::mc::Frame* RemoteProcess::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;
@@ -399,7 +399,7 @@ simgrid::mc::Frame* RemoteSimulation::find_function(RemotePtr<void> ip) const
 
 /** Find (one occurrence of) the named variable definition
  */
-const simgrid::mc::Variable* RemoteSimulation::find_variable(const char* name) const
+const simgrid::mc::Variable* RemoteProcess::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
@@ -421,7 +421,7 @@ const simgrid::mc::Variable* RemoteSimulation::find_variable(const char* name) c
   return nullptr;
 }
 
-void RemoteSimulation::read_variable(const char* name, void* target, size_t size) const
+void RemoteProcess::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);
@@ -432,7 +432,7 @@ void RemoteSimulation::read_variable(const char* name, void* target, size_t size
   this->read_bytes(target, size, remote(var->address));
 }
 
-std::string RemoteSimulation::read_string(RemotePtr<char> address) const
+std::string RemoteProcess::read_string(RemotePtr<char> address) const
 {
   if (not address)
     return {};
@@ -456,8 +456,7 @@ std::string RemoteSimulation::read_string(RemotePtr<char> address) const
   }
 }
 
-void* RemoteSimulation::read_bytes(void* buffer, std::size_t size, RemotePtr<void> address,
-                                   ReadOptions /*options*/) const
+void* RemoteProcess::read_bytes(void* buffer, std::size_t size, RemotePtr<void> address, ReadOptions /*options*/) const
 {
   if (pread_whole(this->memory_file, buffer, size, (size_t)address.address()) < 0)
     xbt_die("Read at %p from process %lli failed", (void*)address.address(), (long long)this->pid_);
@@ -470,13 +469,13 @@ void* RemoteSimulation::read_bytes(void* buffer, std::size_t size, RemotePtr<voi
  *  @param len      data size
  *  @param address  target process memory address (target)
  */
-void RemoteSimulation::write_bytes(const void* buffer, size_t len, RemotePtr<void> address) const
+void RemoteProcess::write_bytes(const void* buffer, size_t len, RemotePtr<void> address) const
 {
   if (pwrite_whole(this->memory_file, buffer, len, (size_t)address.address()) < 0)
     xbt_die("Write to process %lli failed", (long long)this->pid_);
 }
 
-void RemoteSimulation::clear_bytes(RemotePtr<void> address, size_t len) const
+void RemoteProcess::clear_bytes(RemotePtr<void> address, size_t len) const
 {
   pthread_once(&zero_buffer_flag, zero_buffer_init);
   while (len) {
@@ -487,7 +486,7 @@ void RemoteSimulation::clear_bytes(RemotePtr<void> address, size_t len) const
   }
 }
 
-void RemoteSimulation::ignore_region(std::uint64_t addr, std::size_t size)
+void RemoteProcess::ignore_region(std::uint64_t addr, std::size_t size)
 {
   IgnoredRegion region;
   region.addr = addr;
@@ -501,7 +500,7 @@ void RemoteSimulation::ignore_region(std::uint64_t addr, std::size_t size)
     ignored_regions_.insert(pos, region);
 }
 
-void RemoteSimulation::ignore_heap(IgnoredHeapRegion const& region)
+void RemoteProcess::ignore_heap(IgnoredHeapRegion const& region)
 {
   // Binary search the position of insertion:
   auto pos = std::lower_bound(ignored_heap_.begin(), ignored_heap_.end(), region.address,
@@ -512,7 +511,7 @@ void RemoteSimulation::ignore_heap(IgnoredHeapRegion const& region)
   }
 }
 
-void RemoteSimulation::unignore_heap(void* address, size_t size)
+void RemoteProcess::unignore_heap(void* address, size_t size)
 {
   // Binary search:
   auto pos = std::lower_bound(ignored_heap_.begin(), ignored_heap_.end(), address,
@@ -521,7 +520,7 @@ void RemoteSimulation::unignore_heap(void* address, size_t size)
     ignored_heap_.erase(pos);
 }
 
-void RemoteSimulation::ignore_local_variable(const char* var_name, const char* frame_name) const
+void RemoteProcess::ignore_local_variable(const char* var_name, const char* frame_name) const
 {
   if (frame_name != nullptr && strcmp(frame_name, "*") == 0)
     frame_name = nullptr;
@@ -529,19 +528,19 @@ void RemoteSimulation::ignore_local_variable(const char* var_name, const char* f
     info->remove_local_variable(var_name, frame_name);
 }
 
-std::vector<simgrid::mc::ActorInformation>& RemoteSimulation::actors()
+std::vector<simgrid::mc::ActorInformation>& RemoteProcess::actors()
 {
   this->refresh_simix();
   return smx_actors_infos;
 }
 
-std::vector<simgrid::mc::ActorInformation>& RemoteSimulation::dead_actors()
+std::vector<simgrid::mc::ActorInformation>& RemoteProcess::dead_actors()
 {
   this->refresh_simix();
   return smx_dead_actors_infos;
 }
 
-void RemoteSimulation::dump_stack() const
+void RemoteProcess::dump_stack() const
 {
   unw_addr_space_t as = unw_create_addr_space(&_UPT_accessors, BYTE_ORDER);
   if (as == nullptr) {
similarity index 92%
rename from src/mc/remote/RemoteSimulation.hpp
rename to src/mc/remote/RemoteProcess.hpp
index fc50761..3e35f7f 100644 (file)
@@ -63,7 +63,7 @@ struct IgnoredHeapRegion {
  *  - stack unwinding;
  *  - etc.
  */
-class RemoteSimulation final : public AddressSpace {
+class RemoteProcess 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.
@@ -73,14 +73,14 @@ private:
   static constexpr int cache_simix_processes = 4;
 
 public:
-  explicit RemoteSimulation(pid_t pid);
-  ~RemoteSimulation() override;
+  explicit RemoteProcess(pid_t pid);
+  ~RemoteProcess() override;
   void init();
 
-  RemoteSimulation(RemoteSimulation const&) = delete;
-  RemoteSimulation(RemoteSimulation&&)      = delete;
-  RemoteSimulation& operator=(RemoteSimulation const&) = delete;
-  RemoteSimulation& operator=(RemoteSimulation&&) = delete;
+  RemoteProcess(RemoteProcess const&) = delete;
+  RemoteProcess(RemoteProcess&&)      = delete;
+  RemoteProcess& operator=(RemoteProcess const&) = delete;
+  RemoteProcess& operator=(RemoteProcess&&) = delete;
 
   // Read memory:
   void* read_bytes(void* buffer, std::size_t size, RemotePtr<void> address,
@@ -115,18 +115,18 @@ public:
   // Heap access:
   xbt_mheap_t get_heap()
   {
-    if (not(this->cache_flags_ & RemoteSimulation::cache_heap))
+    if (not(this->cache_flags_ & RemoteProcess::cache_heap))
       this->refresh_heap();
     return this->heap.get();
   }
   const malloc_info* get_malloc_info()
   {
-    if (not(this->cache_flags_ & RemoteSimulation::cache_malloc))
+    if (not(this->cache_flags_ & RemoteProcess::cache_malloc))
       this->refresh_malloc_info();
     return this->heap_info.data();
   }
 
-  void clear_cache() { this->cache_flags_ = RemoteSimulation::cache_none; }
+  void clear_cache() { this->cache_flags_ = RemoteProcess::cache_none; }
 
   std::vector<IgnoredRegion> const& ignored_regions() const { return ignored_regions_; }
   void ignore_region(std::uint64_t address, std::size_t size);
@@ -224,7 +224,7 @@ public:
 
 private:
   /** State of the cache (which variables are up to date) */
-  int cache_flags_ = RemoteSimulation::cache_none;
+  int cache_flags_ = RemoteProcess::cache_none;
 
 public:
   /** Address of the heap structure in the MCed process. */
index 86d3452..1a43ee4 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/RemoteSimulation.hpp"
+#include "src/mc/remote/RemoteProcess.hpp"
 
 #include <cstdlib>
 #include <sys/mman.h>
index 96ee900..ec69ce5 100644 (file)
@@ -15,7 +15,7 @@ namespace mc {
 /************************************* Take Snapshot ************************************/
 /****************************************************************************************/
 
-void Snapshot::snapshot_regions(RemoteSimulation* process)
+void Snapshot::snapshot_regions(RemoteProcess* process)
 {
   snapshot_regions_.clear();
 
@@ -96,7 +96,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 RemoteSimulation* process = &mc_model_checker->get_remote_simulation();
+  const RemoteProcess* process = &mc_model_checker->get_remote_simulation();
   std::vector<s_mc_stack_frame_t> result;
 
   unw_cursor_t c = stack_context->cursor();
@@ -148,7 +148,7 @@ static std::vector<s_mc_stack_frame_t> unwind_stack_frames(UnwindContext* stack_
   return result;
 }
 
-void Snapshot::snapshot_stacks(RemoteSimulation* process)
+void Snapshot::snapshot_stacks(RemoteProcess* process)
 {
   for (auto const& stack : process->stack_areas()) {
     s_mc_snapshot_stack_t st;
@@ -197,7 +197,7 @@ static void snapshot_ignore_restore(const simgrid::mc::Snapshot* snapshot)
                                                    remote(ignored_data.start));
 }
 
-Snapshot::Snapshot(int num_state, RemoteSimulation* process) : AddressSpace(process), num_state_(num_state)
+Snapshot::Snapshot(int num_state, RemoteProcess* process) : AddressSpace(process), num_state_(num_state)
 {
   XBT_DEBUG("Taking snapshot %i", num_state);
 
@@ -272,7 +272,7 @@ Region* Snapshot::get_region(const void* addr, Region* hinted_region) const
     return get_region(addr);
 }
 
-void Snapshot::restore(RemoteSimulation* process) const
+void Snapshot::restore(RemoteProcess* process) const
 {
   XBT_DEBUG("Restore snapshot %i", num_state_);
 
index fbcf185..2dfc05b 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "src/mc/ModelChecker.hpp"
 #include "src/mc/inspect/mc_unw.hpp"
-#include "src/mc/remote/RemoteSimulation.hpp"
+#include "src/mc/remote/RemoteProcess.hpp"
 #include "src/mc/sosp/Region.hpp"
 
 // ***** MC Snapshot
@@ -60,7 +60,7 @@ namespace mc {
 class XBT_PRIVATE Snapshot final : public AddressSpace {
 public:
   /* Initialization */
-  Snapshot(int num_state, RemoteSimulation* get_remote_simulation = &mc_model_checker->get_remote_simulation());
+  Snapshot(int num_state, RemoteProcess* get_remote_simulation = &mc_model_checker->get_remote_simulation());
 
   /* Regular use */
   bool on_heap(const void* address) const
@@ -73,7 +73,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(RemoteSimulation* get_remote_simulation) const;
+  void restore(RemoteProcess* get_remote_simulation) const;
 
   // To be private
   int num_state_;
@@ -88,8 +88,8 @@ public:
 
 private:
   void add_region(RegionType type, ObjectInformation* object_info, void* start_addr, std::size_t size);
-  void snapshot_regions(RemoteSimulation* get_remote_simulation);
-  void snapshot_stacks(RemoteSimulation* get_remote_simulation);
+  void snapshot_regions(RemoteProcess* get_remote_simulation);
+  void snapshot_stacks(RemoteProcess* get_remote_simulation);
 };
 } // namespace mc
 } // namespace simgrid
index c5efb09..47350be 100644 (file)
@@ -38,11 +38,11 @@ public:
     mc_model_checker = nullptr;
   }
 
-  static std::unique_ptr<simgrid::mc::RemoteSimulation> process;
+  static std::unique_ptr<simgrid::mc::RemoteProcess> process;
 };
 
 // static member variables init.
-std::unique_ptr<simgrid::mc::RemoteSimulation> snap_test_helper::process = nullptr;
+std::unique_ptr<simgrid::mc::RemoteProcess> snap_test_helper::process = nullptr;
 
 void snap_test_helper::init_memory(void* mem, size_t size)
 {
@@ -57,7 +57,7 @@ void snap_test_helper::Init()
   REQUIRE(xbt_pagesize == getpagesize());
   REQUIRE(1 << xbt_pagebits == xbt_pagesize);
 
-  process = std::make_unique<simgrid::mc::RemoteSimulation>(getpid());
+  process = std::make_unique<simgrid::mc::RemoteProcess>(getpid());
   process->init();
   mc_model_checker = new ::simgrid::mc::ModelChecker(std::move(process), -1);
 }
index 3cb50f5..23b7b3d 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/RemoteSimulation.hpp"
+#include "src/mc/remote/RemoteProcess.hpp"
 
 #include <array>
 #include <cassert>
@@ -145,7 +145,7 @@ static void test_deref(simgrid::dwarf::ExpressionContext const& state)
 
 int main()
 {
-  auto* process = new simgrid::mc::RemoteSimulation(getpid());
+  auto* process = new simgrid::mc::RemoteProcess(getpid());
   process->init();
 
   simgrid::dwarf::ExpressionContext state;
index 0ca7ff3..78cff65 100644 (file)
@@ -15,7 +15,7 @@
 #include "src/mc/inspect/ObjectInformation.hpp"
 #include "src/mc/inspect/Type.hpp"
 #include "src/mc/inspect/Variable.hpp"
-#include "src/mc/remote/RemoteSimulation.hpp"
+#include "src/mc/remote/RemoteProcess.hpp"
 
 #include <cassert>
 #include <cstring>
@@ -72,7 +72,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::RemoteSimulation& process,
+static const simgrid::mc::Variable* test_global_variable(const simgrid::mc::RemoteProcess& process,
                                                          const simgrid::mc::ObjectInformation* info, const char* name,
                                                          void* address, long byte_size)
 {
@@ -104,7 +104,7 @@ struct s_foo {
   int i;
 };
 
-static void test_type_by_name(const simgrid::mc::RemoteSimulation& process, s_foo /*my_foo*/)
+static void test_type_by_name(const simgrid::mc::RemoteProcess& 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());
 }
@@ -116,7 +116,7 @@ int main(int argc, char** argv)
   const simgrid::mc::Variable* var;
   simgrid::mc::Type* type;
 
-  simgrid::mc::RemoteSimulation process(getpid());
+  simgrid::mc::RemoteProcess process(getpid());
   process.init();
 
   test_global_variable(process, process.binary_info.get(), "some_local_variable", &some_local_variable, sizeof(int));
index a0746a7..f3969f4 100644 (file)
@@ -620,8 +620,8 @@ set(MC_SRC
   src/mc/remote/Channel.hpp
   src/mc/remote/CheckerSide.cpp
   src/mc/remote/CheckerSide.hpp
-  src/mc/remote/RemoteSimulation.hpp
-  src/mc/remote/RemoteSimulation.cpp
+  src/mc/remote/RemoteProcess.hpp
+  src/mc/remote/RemoteProcess.cpp
   src/mc/remote/RemotePtr.hpp
   src/mc/remote/mc_protocol.h