-unw_accessors_t mc_unw_accessors =
- {
- .find_proc_info = &find_proc_info,
- .put_unwind_info = &put_unwind_info,
- .get_dyn_info_list_addr = &get_dyn_info_list_addr,
- .access_mem = &access_mem,
- .access_reg = &access_reg,
- .access_fpreg = &access_fpreg,
- .resume = &resume,
- .get_proc_name = &get_proc_name
- };
-
-// ***** Context management
-
-int mc_unw_init_context(
- mc_unw_context_t context, mc_process_t process, unw_context_t* c)
+/** Virtual table for our `libunwind` implementation
+ *
+ * Stack unwinding on a `simgrid::mc::Process*` (for memory, unwinding information)
+ * and `ucontext_t` (for processor registers).
+ *
+ * It works with the `simgrid::mc::UnwindContext` context.
+ */
+unw_accessors_t UnwindContext::accessors = {
+ &find_proc_info,
+ &put_unwind_info,
+ &get_dyn_info_list_addr,
+ &access_mem,
+ &access_reg,
+ &access_fpreg,
+ &resume,
+ &get_proc_name
+};
+
+unw_addr_space_t UnwindContext::createUnwindAddressSpace()
+{
+ return unw_create_addr_space(&UnwindContext::accessors, __BYTE_ORDER);
+}
+
+void UnwindContext::clear()
+{
+ addressSpace_ = nullptr;
+ process_ = nullptr;
+}
+
+void UnwindContext::initialize(simgrid::mc::Process* process, unw_context_t* c)