X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/240c022643fcbac7a73b39f5cf007acf7e5f81f5..056b1668e0d3af35c8d35b88694a65c23fbbd6ca:/src/mc/remote/RemoteProcess.hpp diff --git a/src/mc/remote/RemoteProcess.hpp b/src/mc/remote/RemoteProcess.hpp index eda86d983f..a183c93266 100644 --- a/src/mc/remote/RemoteProcess.hpp +++ b/src/mc/remote/RemoteProcess.hpp @@ -12,8 +12,10 @@ #include "src/mc/AddressSpace.hpp" #include "src/mc/inspect/ObjectInformation.hpp" #include "src/mc/remote/RemotePtr.hpp" +#include "src/xbt/memory_map.hpp" #include "src/xbt/mmalloc/mmprivate.h" +#include #include namespace simgrid { @@ -75,7 +77,7 @@ private: public: explicit RemoteProcess(pid_t pid); ~RemoteProcess() override; - void init(xbt_mheap_t mmalloc_default_mdp, void* maxpid, void* actors, void* dead_actors); + void init(xbt_mheap_t mmalloc_default_mdp, unsigned long* maxpid, xbt_dynar_t actors, xbt_dynar_t dead_actors); RemoteProcess(RemoteProcess const&) = delete; RemoteProcess(RemoteProcess&&) = delete; @@ -166,9 +168,9 @@ public: /* ***************** */ private: // Cache the address of the variables we read directly in the memory of remote - void* maxpid_addr_; - void* actors_addr_; - void* dead_actors_addr_; + RemotePtr maxpid_addr_; + RemotePtr actors_addr_; + RemotePtr dead_actors_addr_; public: std::vector& actors(); @@ -200,8 +202,7 @@ public: return nullptr; } - unsigned long get_maxpid() const; - void get_actor_vectors(RemotePtr& actors, RemotePtr& dead_actors); + unsigned long get_maxpid() const { return this->read(maxpid_addr_); } void dump_stack() const; @@ -221,30 +222,28 @@ private: std::vector stack_areas_; std::vector ignored_heap_; -public: - // object info - // TODO, make private (first, objectify simgrid::mc::ObjectInformation*) - std::vector> object_infos; - std::shared_ptr binary_info; - // Copies of MCed SMX data structures - /** Copy of `simix_global->process_list` + /** Copy of `EngineImpl::actor_list_` * - * See mc_smx.c. + * See mc_smx.cpp. */ std::vector smx_actors_infos; - /** Copy of `simix_global->actors_to_destroy` + /** Copy of `EngineImpl::actors_to_destroy_` * - * See mc_smx.c. + * See mc_smx.cpp. */ std::vector smx_dead_actors_infos; -private: /** State of the cache (which variables are up to date) */ int cache_flags_ = RemoteProcess::cache_none; public: + // object info + // TODO, make private (first, objectify simgrid::mc::ObjectInformation*) + std::vector> object_infos; + std::shared_ptr binary_info; + /** Address of the heap structure in the MCed process. */ RemotePtr heap_address; @@ -271,7 +270,7 @@ public: * (with simgrid::mc::Process* / simgrid::mc::AddressSpace* * and unw_context_t). */ - unw_addr_space_t unw_addr_space; + unw_addr_space_t unw_addr_space = nullptr; /** Underlying libunwind address-space * @@ -279,11 +278,11 @@ public: * operations of the native MC address space is currently delegated * to this address space (either the local or a ptrace unwinder). */ - unw_addr_space_t unw_underlying_addr_space; + unw_addr_space_t unw_underlying_addr_space = nullptr; /** The corresponding context */ - void* unw_underlying_context; + void* unw_underlying_context = nullptr; }; /** Open a FD to a remote process memory (`/dev/$pid/mem`) */