Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Move handle_message from ModelChecker to RemoteProcessMemory
[simgrid.git] / src / mc / sosp / RemoteProcessMemory.hpp
index 1e3422a..b0eaeb6 100644 (file)
 
 namespace simgrid::mc {
 
-class ActorInformation {
-public:
-  /** MCed address of the process */
-  RemotePtr<kernel::actor::ActorImpl> address{nullptr};
-  Remote<kernel::actor::ActorImpl> copy;
-
-  /** Hostname (owned by `mc_model_checker->hostnames_`) */
-  const std::string* hostname = nullptr;
-  std::string name;
-
-  void clear()
-  {
-    name.clear();
-    address  = nullptr;
-    hostname = nullptr;
-  }
-};
-
 struct IgnoredRegion {
   std::uint64_t addr;
   std::size_t size;
@@ -56,7 +38,6 @@ struct IgnoredHeapRegion {
  *
  *  - reading from the process memory (`AddressSpace`);
  *  - accessing the system state of the process (heap, …);
- *  - privatization;
  *  - stack unwinding;
  *  - etc.
  */
@@ -78,6 +59,12 @@ public:
   RemoteProcessMemory& operator=(RemoteProcessMemory const&) = delete;
   RemoteProcessMemory& operator=(RemoteProcessMemory&&)      = delete;
 
+  pid_t pid() const { return pid_; }
+  bool running() const { return running_; }
+  void terminate() { running_ = false; }
+  void handle_waitpid();
+  bool handle_message(const char* buffer, ssize_t size);
+
   /* ************* */
   /* Low-level API */
   /* ************* */
@@ -115,8 +102,8 @@ public:
   // Heap access:
   xbt_mheap_t get_heap()
   {
-    if (not(this->cache_flags_ & RemoteProcessMemory::cache_heap))
-      this->refresh_heap();
+    if (not(cache_flags_ & RemoteProcessMemory::cache_heap))
+      refresh_heap();
     return this->heap.get();
   }
   const malloc_info* get_malloc_info()
@@ -133,17 +120,11 @@ public:
   std::vector<IgnoredRegion> const& ignored_regions() const { return ignored_regions_; }
   void ignore_region(std::uint64_t address, std::size_t size);
 
-  pid_t pid() const { return pid_; }
-
   bool in_maestro_stack(RemotePtr<void> p) const
   {
     return p >= this->maestro_stack_start_ && p < this->maestro_stack_end_;
   }
 
-  bool running() const { return running_; }
-
-  void terminate() { running_ = false; }
-
   void ignore_global_variable(const char* name) const
   {
     for (std::shared_ptr<ObjectInformation> const& info : this->object_infos)