diff options
author | Sergiy Kuryata <sergeyk@microsoft.com> | 2015-02-27 11:50:16 -0800 |
---|---|---|
committer | Sergiy Kuryata <sergeyk@microsoft.com> | 2015-02-27 11:56:27 -0800 |
commit | ec08192bfea5fb25dd60c9fdfd813951ab865ebf (patch) | |
tree | d3d8a75b91ae861880982b51042f2c38373f8e61 /src/vm/stackwalk.cpp | |
parent | 63976a08fbe6ece34a2936ebccdf735ea32044a2 (diff) | |
download | coreclr-ec08192bfea5fb25dd60c9fdfd813951ab865ebf.tar.gz coreclr-ec08192bfea5fb25dd60c9fdfd813951ab865ebf.tar.bz2 coreclr-ec08192bfea5fb25dd60c9fdfd813951ab865ebf.zip |
Implement basic support for managed exception handling.
Implementation of the managed exception handling in this change is by far not yet complete but it is a good starting point that we can build on top of it. Basically this code allows managed exceptions to be thrown and caught. The finally blocks and nested try/catch works too. But re-throwing an exception from a catch block and many other corner cases do not work yet.
In addition, RtlRestoreContext needs to be properly implemented. This change introduces a very simply implementation that works only in those cases where XMM registers are not used in the code that handles the exception so they don’t need to be restored. I have created a separate issue to track it (https://github.com/dotnet/coreclr/issues/360).
This change also fixes an issue in JIT where JIT was incorrectly passing arguments in the RCX and RDX registers to the finally and catch funclets.
Diffstat (limited to 'src/vm/stackwalk.cpp')
-rw-r--r-- | src/vm/stackwalk.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/vm/stackwalk.cpp b/src/vm/stackwalk.cpp index e677cef7e9..627765a996 100644 --- a/src/vm/stackwalk.cpp +++ b/src/vm/stackwalk.cpp @@ -606,10 +606,11 @@ PCODE Thread::VirtualUnwindCallFrame(T_CONTEXT* pContext, ARM_ONLY((DWORD*))(&uImageBase), NULL); #else // !FEATURE_PAL - // For PAL, this method should never be called without valid pCodeInfo, since there is no - // other way to get the function entry. - pFunctionEntry = NULL; - UNREACHABLE_MSG("VirtualUnwindCallFrame called with NULL pCodeInfo"); + EECodeInfo codeInfo; + + codeInfo.Init(uControlPc); + pFunctionEntry = codeInfo.GetFunctionEntry(); + uImageBase = (UINT_PTR)codeInfo.GetModuleBase(); #endif // !FEATURE_PAL } else |