X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/96e9a8e891b426a1bcd3214322f34bb40ba2b33e..3db47603316610f1878cb48634c357b75bbbed9d:/src/mc/Process.hpp diff --git a/src/mc/Process.hpp b/src/mc/Process.hpp index 7c4c983d00..a2cef8542e 100644 --- a/src/mc/Process.hpp +++ b/src/mc/Process.hpp @@ -14,18 +14,15 @@ #include #include -#include - #include #include #include #include -#include #include -#ifdef HAVE_MC +#if HAVE_MC #include "src/xbt/mmalloc/mmprivate.h" #endif @@ -62,7 +59,14 @@ public: }; /** Hostname (owned by `mc_modelchecker->hostnames`) */ const char* hostname = nullptr; - char* name = nullptr; + std::string name; + + void clear() + { + name.clear(); + address = nullptr; + hostname = nullptr; + } }; struct IgnoredRegion { @@ -78,6 +82,19 @@ struct IgnoredHeapRegion { }; /** Representation of a process + * + * This class is mixing a lot of differents responsabilities and is tied + * to SIMIX. It should probably split into different classes. + * + * Responsabilities: + * + * - reading from the process memory (`AddressSpace`); + * - accessing the system state of the porcess (heap, …); + * - storing the SIMIX state of the process; + * - privatization; + * - communication with the model-checked process; + * - stack unwinding; + * - etc. */ class Process final : public AddressSpace { public: @@ -210,12 +227,14 @@ public: void ignore_local_variable(const char *var_name, const char *frame_name); int socket() { return socket_; } - simgrid::xbt::DynarRange simix_processes(); + std::vector& simix_processes(); + std::vector& old_simix_processes(); private: void init_memory_map_info(); void refresh_heap(); void refresh_malloc_info(); + void refresh_simix(); private: pid_t pid_ = -1; @@ -242,13 +261,13 @@ public: // Copies of MCed SMX data structures * * See mc_smx.c. */ - xbt_dynar_t smx_process_infos = nullptr; + std::vector smx_process_infos; /** Copy of `simix_global->process_to_destroy` * * See mc_smx.c. */ - xbt_dynar_t smx_old_process_infos = nullptr; + std::vector smx_old_process_infos; /** State of the cache (which variables are up to date) */ mc_process_cache_flags_t cache_flags = MC_PROCESS_CACHE_FLAG_NONE;