Skip to content

Commit

Permalink
A x86_64 architecture would use RIP rather than EIP as program counte…
Browse files Browse the repository at this point in the history
…r in sqWin32VMProfile (by mimetism with linux branch).
  • Loading branch information
nicolas-cellier-aka-nice committed Jul 6, 2016
1 parent bf1daf6 commit 232dd06
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions platforms/win32/vm/sqWin32VMProfile.c
Expand Up @@ -242,7 +242,13 @@ profileStateMachine(void *ignored)
pctype pc;
VMContext.ContextFlags = CONTEXT_CONTROL | THREAD_GET_CONTEXT;
GetThreadContext(VMThread, &VMContext);
# if defined(_M_I386) || defined(_X86_) || defined(i386) || defined(__i386__)
pc = VMContext.Eip;
#elif defined(x86_64) || defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(__amd64__) || defined(x64) || defined(_M_X64)
pc = VMContext.Rip;
#else
#error "unknown architecture, cannot pick program counter"
#endif
pc_buffer[pc_buffer_index] = pc;
if (++pc_buffer_index >= pc_buffer_size) {
pc_buffer_index = 0;
Expand Down

0 comments on commit 232dd06

Please sign in to comment.