From: Martin Quinson Date: Sun, 12 Mar 2023 23:05:42 +0000 (+0100) Subject: Move another function of ModelChecker to RemoteProcessMemory X-Git-Tag: v3.34~335 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/4249cbf34db972e00df34d98ec89cca899ac0a73 Move another function of ModelChecker to RemoteProcessMemory --- diff --git a/src/mc/ModelChecker.cpp b/src/mc/ModelChecker.cpp index a59b3aa892..10f0ba30c6 100644 --- a/src/mc/ModelChecker.cpp +++ b/src/mc/ModelChecker.cpp @@ -69,8 +69,6 @@ void ModelChecker::start() xbt_assert(waitpid(pid, &status, WAITPID_CHECKED_FLAGS) == pid && WIFSTOPPED(status) && WSTOPSIG(status) == SIGSTOP, "Could not wait model-checked process"); - setup_ignore(); - errno = 0; #ifdef __linux__ ptrace(PTRACE_SETOPTIONS, pid, nullptr, PTRACE_O_TRACEEXIT); @@ -87,24 +85,6 @@ void ModelChecker::start() errno); } -static constexpr auto ignored_local_variables = { - std::make_pair("e", "*"), - std::make_pair("_log_ev", "*"), - - /* Ignore local variable about time used for tracing */ - std::make_pair("start_time", "*"), -}; - -void ModelChecker::setup_ignore() -{ - const RemoteProcessMemory& process = this->get_remote_process_memory(); - for (auto const& [var, frame] : ignored_local_variables) - process.ignore_local_variable(var, frame); - - /* Static variable used for tracing */ - process.ignore_global_variable("counter"); -} - bool ModelChecker::handle_message(const char* buffer, ssize_t size) { s_mc_message_t base_message; diff --git a/src/mc/ModelChecker.hpp b/src/mc/ModelChecker.hpp index 40ad462760..0d51e9e236 100644 --- a/src/mc/ModelChecker.hpp +++ b/src/mc/ModelChecker.hpp @@ -40,7 +40,6 @@ public: void set_exploration(Exploration* exploration) { exploration_ = exploration; } private: - void setup_ignore(); bool handle_message(const char* buffer, ssize_t size); void handle_waitpid(); }; diff --git a/src/mc/sosp/RemoteProcessMemory.cpp b/src/mc/sosp/RemoteProcessMemory.cpp index 7fd28b0abb..2ebe51beb6 100644 --- a/src/mc/sosp/RemoteProcessMemory.cpp +++ b/src/mc/sosp/RemoteProcessMemory.cpp @@ -119,6 +119,18 @@ void RemoteProcessMemory::init(xbt_mheap_t mmalloc_default_mdp) this->unw_addr_space = simgrid::mc::UnwindContext::createUnwindAddressSpace(); this->unw_underlying_addr_space = simgrid::unw::create_addr_space(); this->unw_underlying_context = simgrid::unw::create_context(this->unw_underlying_addr_space, this->pid_); + + auto ignored_local_variables = { + std::make_pair("e", "*"), + std::make_pair("_log_ev", "*"), + + /* Ignore local variable about time used for tracing */ + std::make_pair("start_time", "*"), + }; + for (auto const& [var, frame] : ignored_local_variables) + ignore_local_variable(var, frame); + + ignore_global_variable("counter"); // Static variable used for tracing } RemoteProcessMemory::~RemoteProcessMemory()