X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e709643ef0c5b61c6c878016c418bffa2b1b20cd..c6d6e5b87aed9c7080c981b11f91f2d0205623c3:/src/mc/inspect/mc_unw.hpp diff --git a/src/mc/inspect/mc_unw.hpp b/src/mc/inspect/mc_unw.hpp index f6c291c4ef..6291c1ce4d 100644 --- a/src/mc/inspect/mc_unw.hpp +++ b/src/mc/inspect/mc_unw.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2015-2020. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2015-2023. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -9,7 +9,7 @@ /** @file * Libunwind implementation for the model-checker * - * Libunwind provides an pluggable stack unwinding API: the way the current + * Libunwind provides a pluggable stack unwinding API: the way the current * registers and memory is accessed, the way unwinding information is found * is pluggable. * @@ -31,24 +31,21 @@ #include #include -namespace simgrid { -namespace unw { +namespace simgrid::unw { XBT_PRIVATE unw_addr_space_t create_addr_space(); XBT_PRIVATE void* create_context(unw_addr_space_t as, pid_t pid); -} // namespace unw -} // namespace simgrid +} // namespace simgrid::unw -namespace simgrid { -namespace mc { +namespace simgrid::mc { class UnwindContext { - simgrid::mc::AddressSpace* address_space_ = nullptr; - simgrid::mc::RemoteSimulation* process_ = nullptr; - unw_context_t unwind_context_; + simgrid::mc::AddressSpace* address_space_ = nullptr; + simgrid::mc::RemoteProcessMemory* process_ = nullptr; + unw_context_t unwind_context_ = {}; public: - void initialize(simgrid::mc::RemoteSimulation* process, unw_context_t* c); + void initialize(simgrid::mc::RemoteProcessMemory& process, const unw_context_t* c); unw_cursor_t cursor(); private: // Methods and virtual table for libunwind @@ -61,7 +58,6 @@ private: // Methods and virtual table for libunwind static int access_reg(unw_addr_space_t as, unw_regnum_t regnum, unw_word_t* valp, int write, void* arg) noexcept; static int get_proc_name(unw_addr_space_t as, unw_word_t addr, char* bufp, size_t buf_len, unw_word_t* offp, void* arg) noexcept; - static unw_accessors_t accessors; public: // Create a libunwind address space: @@ -69,7 +65,6 @@ public: }; void dumpStack(FILE* file, unw_cursor_t* cursor); -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif