diff options
author | Eugene <Eugene.Zemtsov@microsoft.com> | 2015-09-17 19:07:37 -0700 |
---|---|---|
committer | Eugene <Eugene.Zemtsov@microsoft.com> | 2015-09-18 16:21:26 -0700 |
commit | ec040a9919ad20161f4f4aae37c9b49521a2bb57 (patch) | |
tree | a803764806853318b7b429e62a6a95f7c41e4c89 /src/debug/ee | |
parent | 793dfa9f3430b368833b4c28cc00359814ccb4f5 (diff) | |
download | coreclr-ec040a9919ad20161f4f4aae37c9b49521a2bb57.tar.gz coreclr-ec040a9919ad20161f4f4aae37c9b49521a2bb57.tar.bz2 coreclr-ec040a9919ad20161f4f4aae37c9b49521a2bb57.zip |
Fix debugger's funceval on Linux
Address issues which prevented funceval from working on Linux:
1. Invalid stack alignment in funceval hijacks
2. Using System V calling convention for funceval hijacks
3. Disable executability check that is not implemented on Linux
Diffstat (limited to 'src/debug/ee')
-rw-r--r-- | src/debug/ee/amd64/dbghelpers.S | 4 | ||||
-rw-r--r-- | src/debug/ee/controller.h | 2 | ||||
-rw-r--r-- | src/debug/ee/debugger.cpp | 4 |
3 files changed, 8 insertions, 2 deletions
diff --git a/src/debug/ee/amd64/dbghelpers.S b/src/debug/ee/amd64/dbghelpers.S index 6c2844046d..b358ca555a 100644 --- a/src/debug/ee/amd64/dbghelpers.S +++ b/src/debug/ee/amd64/dbghelpers.S @@ -12,7 +12,7 @@ NESTED_ENTRY FuncEvalHijack, _TEXT, UnhandledExceptionHandlerUnix // the stack should be aligned at this point, since we do not call this // function explicitly - alloc_stack 20h + alloc_stack 0x20 END_PROLOGUE mov [rsp], rdi @@ -46,7 +46,7 @@ NESTED_ENTRY ExceptionHijack, _TEXT, UnhandledExceptionHandlerUnix // So we allocate 4 stack slots as the outgoing argument home and just copy the // arguments set up by DacDbi into these stack slots. We will take a perf hit, // but this is not a perf critical code path anyway. - alloc_stack 20h + alloc_stack 0x20 END_PROLOGUE // We used to do an "alloc_stack 0h" because the stack has been allocated for us diff --git a/src/debug/ee/controller.h b/src/debug/ee/controller.h index 0cfeb096fa..4782565dfa 100644 --- a/src/debug/ee/controller.h +++ b/src/debug/ee/controller.h @@ -896,6 +896,7 @@ inline void VerifyExecutableAddress(const BYTE* address) // TODO: : when can we apply this to x86? #if defined(_WIN64) #if defined(_DEBUG) +#ifndef FEATURE_PAL MEMORY_BASIC_INFORMATION mbi; if (sizeof(mbi) == ClrVirtualQuery(address, &mbi, sizeof(mbi))) @@ -913,6 +914,7 @@ inline void VerifyExecutableAddress(const BYTE* address) ("VEA: address (0x%p) is not on an executable page.", address)); } } +#endif // !FEATURE_PAL #endif // _DEBUG #endif // _WIN64 } diff --git a/src/debug/ee/debugger.cpp b/src/debug/ee/debugger.cpp index cb757fa0bb..029c62aabe 100644 --- a/src/debug/ee/debugger.cpp +++ b/src/debug/ee/debugger.cpp @@ -15406,7 +15406,11 @@ HRESULT Debugger::FuncEvalSetup(DebuggerIPCE_FuncEvalInfo *pEvalInfo, #if defined(_TARGET_X86_) filterContext->Eax = (DWORD)pDE; #elif defined(_TARGET_AMD64_) +#ifdef UNIX_AMD64_ABI + filterContext->Rdi = (SIZE_T)pDE; +#else // UNIX_AMD64_ABI filterContext->Rcx = (SIZE_T)pDE; +#endif // !UNIX_AMD64_ABI #elif defined(_TARGET_ARM_) filterContext->R0 = (DWORD)pDE; #else |