diff options
Diffstat (limited to 'winsup/utils/profiler.cc')
-rw-r--r-- | winsup/utils/profiler.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/winsup/utils/profiler.cc b/winsup/utils/profiler.cc index b5ce16c..04c6b3e 100644 --- a/winsup/utils/profiler.cc +++ b/winsup/utils/profiler.cc @@ -33,6 +33,7 @@ typedef uint16_t u_int16_t; // Non-standard sized type needed by ancient gmon.h #define NO_GLOBALS_H #include "gmon.h" #include "path.h" +#include "register.h" /* Undo this #define from winsup.h. */ #ifdef ExitThread @@ -193,11 +194,7 @@ sample (CONTEXT *context, HANDLE h) return 0ULL; } else -#ifdef __x86_64__ - return context->Rip; -#else -#error unimplemented for this target -#endif + return context->_CX_instPtr; } void @@ -503,8 +500,10 @@ find_text_section (LPVOID base, HANDLE h) read_child ((void *) &machine, sizeof (machine), &inth->FileHeader.Machine, h); -#ifdef __x86_64__ +#if defined(__x86_64__) if (machine != IMAGE_FILE_MACHINE_AMD64) +#elif defined(__aarch64__) + if (machine != IMAGE_FILE_MACHINE_ARM64) #else #error unimplemented for this target #endif |