X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5ed37babb2fa9097abe82df299c0aa259ed84d5a..0e6e9a9dade4d5272159ab2a5cfd7496a62eaa18:/src/mc/remote/AppSide.hpp diff --git a/src/mc/remote/AppSide.hpp b/src/mc/remote/AppSide.hpp index 6c1afb8526..3941ffae0c 100644 --- a/src/mc/remote/AppSide.hpp +++ b/src/mc/remote/AppSide.hpp @@ -22,23 +22,29 @@ class XBT_PUBLIC AppSide { private: Channel channel_; static std::unique_ptr instance_; + bool need_memory_info_ = false; /* by default we don't send memory info, unless we got a NEED_MEMINFO */ + std::unordered_map child_statuses_; public: AppSide(); explicit AppSide(int fd) : channel_(fd) {} - void handle_messages() const; + void handle_messages(); private: void handle_deadlock_check(const s_mc_message_t* msg) const; void handle_simcall_execute(const s_mc_message_simcall_execute_t* message) const; void handle_finalize(const s_mc_message_int_t* msg) const; + void handle_fork(const s_mc_message_fork_t* msg); + void handle_wait_child(const s_mc_message_int_t* msg); + void handle_need_meminfo(); void handle_actors_status() const; + void handle_actors_maxpid() const; public: Channel const& get_channel() const { return channel_; } Channel& get_channel() { return channel_; } - XBT_ATTRIB_NORETURN void main_loop() const; - void report_assertion_failure() const; + XBT_ATTRIB_NORETURN void main_loop(); + void report_assertion_failure(); void ignore_memory(void* addr, std::size_t size) const; void ignore_heap(void* addr, std::size_t size) const; void unignore_heap(void* addr, std::size_t size) const; @@ -47,10 +53,8 @@ public: void declare_stack(void* stack, size_t size, ucontext_t* context) const; #endif - // Singleton :/ // TODO, remove the singleton antipattern. - static AppSide* initialize(); - static AppSide* get() { return instance_.get(); } + static AppSide* get(); }; } // namespace simgrid::mc