path: root/src/pal/src/exception/seh-unwind.cpp
diff options
authorMike McLaughlin <>2015-11-19 18:13:25 -0800
committerMike McLaughlin <>2015-12-02 16:07:18 -0800
commitaa78a2773ffe573c705caa11dd66467ae6c82781 (patch)
tree8da63f171dcf97bbdb796a3b961d53b40be00d65 /src/pal/src/exception/seh-unwind.cpp
parentb3a45c0a4db6989f9ba6e4cc9db849d0558e961f (diff)
Some SOS fixes/cleanup (bpmd, setclrpath, setsostid).
Enable the module load notification when no module or methods are found. setclrpath/setsostid print the current path/tid if no arguments. "setsostid -clear" now clears the tid/os id mapping. Added better exception hook to sos plugin to catch special CLRN exception. Before multiple lldb "Exception breakpoints" where set each time bpmd added a new bp. Added a "DoNotDeleteOrDisable" message to the exception breakpoint created. Fix bpmd on release builds. RtlpRaiseException was being inlined and the ExceptionRecord parameter was being optimized away causing the GetLastEventInformation api to failed and the special CLRN exception to be ignored. Add sos help support. "soshelp" displays help about a command.
Diffstat (limited to 'src/pal/src/exception/seh-unwind.cpp')
1 files changed, 10 insertions, 14 deletions
diff --git a/src/pal/src/exception/seh-unwind.cpp b/src/pal/src/exception/seh-unwind.cpp
index f0749e7b29..dde7ba87fc 100644
--- a/src/pal/src/exception/seh-unwind.cpp
+++ b/src/pal/src/exception/seh-unwind.cpp
@@ -556,9 +556,16 @@ Note:
The name of this function and the name of the ExceptionRecord
parameter is used in the sos lldb plugin code to read the exception
record. See coreclr\src\ToolBox\SOS\lldbplugin\debugclient.cpp.
+ This function must not be inlined or optimized so the below PAL_VirtualUnwind
+ calls end up with RaiseException caller's context and so the above debugger
+ code finds the function and ExceptionRecord parameter.
-static void RtlpRaiseException(EXCEPTION_RECORD *ExceptionRecord)
+static void
+RtlpRaiseException(EXCEPTION_RECORD *ExceptionRecord)
// Capture the context of RtlpRaiseException.
CONTEXT ContextRecord;
@@ -572,6 +579,7 @@ static void RtlpRaiseException(EXCEPTION_RECORD *ExceptionRecord)
// The frame we're looking at now is RaiseException. We have to unwind one
// level further to get the actual context user code could be resumed at.
PAL_VirtualUnwind(&ContextRecord, NULL);
#if defined(_X86_)
ExceptionRecord->ExceptionAddress = (void *) ContextRecord.Eip;
#elif defined(_AMD64_)
@@ -582,19 +590,7 @@ static void RtlpRaiseException(EXCEPTION_RECORD *ExceptionRecord)
#error unsupported architecture
- pointers.ExceptionRecord = ExceptionRecord;
- pointers.ContextRecord = &ContextRecord;
- SEHRaiseException(InternalGetCurrentThread(), &pointers, 0);
-void SEHRaiseException(CPalThread *pthrCurrent,
- PEXCEPTION_POINTERS lpExceptionPointers,
- int signal_code)
- throw PAL_SEHException(lpExceptionPointers->ExceptionRecord, lpExceptionPointers->ContextRecord);
+ throw PAL_SEHException(ExceptionRecord, &ContextRecord);