Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Differ the creation of the RemoteProcessMemory to when we have enough information
[simgrid.git] / src / mc / sosp / RemoteProcessMemory.hpp
index db53549..eeff932 100644 (file)
@@ -32,14 +32,14 @@ struct IgnoredHeapRegion {
   std::size_t size;
 };
 
-/** The Application's process memory, seen from the Checker perspective
+/** The Application's process memory, seen from the Checker perspective. This class is not needed if you don't need to
+ * introspect the application process.
  *
- *  Responsibilities:
- *
- *  - reading from the process memory (`AddressSpace`);
- *  - accessing the system state of the process (heap, …);
- *  - stack unwinding;
- *  - etc.
+ *  Responsabilities:
+ *    - reading from the process memory (`AddressSpace`);
+ *    - accessing the system state of the process (heap, …);
+ *    - stack unwinding;
+ *    - etc.
  */
 class RemoteProcessMemory final : public AddressSpace {
 private:
@@ -50,20 +50,14 @@ private:
   static constexpr int cache_malloc = 2;
 
 public:
-  explicit RemoteProcessMemory(pid_t pid);
+  explicit RemoteProcessMemory(pid_t pid, xbt_mheap_t mmalloc_default_mdp);
   ~RemoteProcessMemory() override;
-  void init(xbt_mheap_t mmalloc_default_mdp);
 
   RemoteProcessMemory(RemoteProcessMemory const&)            = delete;
   RemoteProcessMemory(RemoteProcessMemory&&)                 = delete;
   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();
-
   /* ************* */
   /* Low-level API */
   /* ************* */
@@ -146,8 +140,7 @@ private:
   void refresh_heap();
   void refresh_malloc_info();
 
-  pid_t pid_    = -1;
-  bool running_ = false;
+  pid_t pid_ = -1;
   std::vector<xbt::VmMap> memory_map_;
   RemotePtr<void> maestro_stack_start_;
   RemotePtr<void> maestro_stack_end_;