Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Replace void* used for RemoteProcess pointers.
[simgrid.git] / src / mc / remote / RemoteProcess.cpp
index 491efb7985943c8171ddd357858033cef9783431..eb8275f763e0f0525b186ac834937c5a12ce8914 100644 (file)
@@ -217,12 +217,13 @@ int open_vm(pid_t pid, int flags)
 
 RemoteProcess::RemoteProcess(pid_t pid) : AddressSpace(this), pid_(pid), running_(true) {}
 
-void RemoteProcess::init(xbt_mheap_t mmalloc_default_mdp, void* maxpid, void* actors, void* dead_actors)
+void RemoteProcess::init(xbt_mheap_t mmalloc_default_mdp, unsigned long* maxpid, xbt_dynar_t actors,
+                         xbt_dynar_t dead_actors)
 {
-  this->heap_address      = mmalloc_default_mdp;
-  this->maxpid_addr_      = maxpid;
-  this->actors_addr_      = actors;
-  this->dead_actors_addr_ = dead_actors;
+  this->heap_address      = remote(mmalloc_default_mdp);
+  this->maxpid_addr_      = remote(maxpid);
+  this->actors_addr_      = remote(actors);
+  this->dead_actors_addr_ = remote(dead_actors);
 
   this->memory_map_ = simgrid::xbt::get_memory_map(this->pid_);
   this->init_memory_map_info();
@@ -263,7 +264,7 @@ 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->read(this->heap.get(), this->heap_address);
   this->cache_flags_ |= RemoteProcess::cache_heap;
 }
 
@@ -567,18 +568,5 @@ void RemoteProcess::dump_stack() const
   _UPT_destroy(context);
   unw_destroy_addr_space(as);
 }
-
-unsigned long RemoteProcess::get_maxpid() const
-{
-  unsigned long maxpid;
-  this->read_bytes(&maxpid, sizeof(unsigned long), remote(maxpid_addr_));
-  return maxpid;
-}
-
-void RemoteProcess::get_actor_vectors(RemotePtr<s_xbt_dynar_t>& actors, RemotePtr<s_xbt_dynar_t>& dead_actors)
-{
-  actors      = remote(static_cast<s_xbt_dynar_t*>(actors_addr_));
-  dead_actors = remote(static_cast<s_xbt_dynar_t*>(dead_actors_addr_));
-}
 } // namespace mc
 } // namespace simgrid