#include <xbt/dynar.h>
#include <xbt/mmalloc.h>
-#ifdef HAVE_MC
+#if HAVE_MC
#include "src/xbt/mmalloc/mmprivate.h"
#endif
namespace simgrid {
namespace mc {
+class SimixProcessInformation {
+public:
+ /** MCed address of the process */
+ void* address = nullptr;
+ union {
+ /** (Flat) Copy of the process data structure */
+ struct s_smx_process copy;
+ };
+ /** Hostname (owned by `mc_modelchecker->hostnames`) */
+ const char* hostname = nullptr;
+ std::string name;
+
+ void clear()
+ {
+ name.clear();
+ address = nullptr;
+ hostname = nullptr;
+ }
+};
+
struct IgnoredRegion {
std::uint64_t addr;
std::size_t size;
};
/** 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:
void ignore_local_variable(const char *var_name, const char *frame_name);
int socket() { return socket_; }
+ std::vector<simgrid::mc::SimixProcessInformation>& simix_processes();
+ std::vector<simgrid::mc::SimixProcessInformation>& old_simix_processes();
private:
void init_memory_map_info();
void refresh_heap();
void refresh_malloc_info();
+ void refresh_simix();
private:
pid_t pid_ = -1;
*
* See mc_smx.c.
*/
- xbt_dynar_t smx_process_infos = nullptr;
+ std::vector<SimixProcessInformation> smx_process_infos;
/** Copy of `simix_global->process_to_destroy`
*
* See mc_smx.c.
*/
- xbt_dynar_t smx_old_process_infos = nullptr;
+ std::vector<SimixProcessInformation> 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;