X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/31a461643fe82c00e0fe4efc8941eee20b0838ea..3db47603316610f1878cb48634c357b75bbbed9d:/src/mc/mc_unw.cpp diff --git a/src/mc/mc_unw.cpp b/src/mc/mc_unw.cpp index 899b4039e2..b172da927b 100644 --- a/src/mc/mc_unw.cpp +++ b/src/mc/mc_unw.cpp @@ -18,10 +18,9 @@ #include -#include "mc_object_info.h" -#include "mc_process.h" -#include "mc_unw.h" -#include "mc/Frame.hpp" +#include "src/mc/Process.hpp" +#include "src/mc/mc_unw.h" +#include "src/mc/Frame.hpp" using simgrid::mc::remote; @@ -110,10 +109,10 @@ static void* get_reg(unw_context_t* context, unw_regnum_t regnum) case UNW_X86_64_R14: return &mcontext->gregs[REG_R14]; case UNW_X86_64_R15: return &mcontext->gregs[REG_R15]; case UNW_X86_64_RIP: return &mcontext->gregs[REG_RIP]; - default: return NULL; + default: return nullptr; } #else - return NULL; + return nullptr; #endif } @@ -168,7 +167,7 @@ static int get_proc_name(unw_addr_space_t as, simgrid::mc::Frame* frame = context->process->find_function(remote(addr)); if (!frame) return - UNW_ENOINFO; - *offp = (unw_word_t) frame->low_pc - addr; + *offp = (unw_word_t) frame->range.begin() - addr; strncpy(bufp, frame->name.c_str(), buf_len); if (bufp[buf_len - 1]) { @@ -203,7 +202,7 @@ int mc_unw_init_context( // Take a copy of the context for our own purpose: context->context = *c; -#if defined(PROCESSOR_x86_64) || defined(PROCESSOR_i686) +#if SIMGRID_PROCESSOR_x86_64 || SIMGRID_PROCESSOR_i686 // On x86_64, ucontext_t contains a pointer to itself for FP registers. // We don't really need support for FR registers as they are caller saved // and probably never use those fields as libunwind-x86_64 does not read @@ -224,12 +223,6 @@ int mc_unw_init_cursor(unw_cursor_t *cursor, mc_unw_context_t context) { if (!context->process || !context->address_space) return -UNW_EUNSPEC; - simgrid::mc::AddressSpace* as = context->address_space; - - simgrid::mc::Process* process = dynamic_cast(as); - if (process && process->is_self()) - return unw_init_local(cursor, &context->context); - return unw_init_remote(cursor, context->process->unw_addr_space, context); }