Background and motivation
Currently, Marshal.GetExceptionPointers is not supported in native AOT.
See the environment control flag in runtime:
|
public static bool IsMarshalGetExceptionPointersSupported => !IsMonoRuntime && !IsNativeAot; |
See open-telemetry/opentelemetry-dotnet#5374 (comment) on how this could be achieved.
API Proposal
Currently, getting in-flight exception is not supported in native AOT:
|
FCIMPL0(EXCEPTION_POINTERS*, ExceptionNative::GetExceptionPointers) |
I propose to enable this feature in native AOT:
FCIMPL0(EXCEPTION_POINTERS*, ExceptionNative::GetExceptionPointers)
{
FCALL_CONTRACT;
EXCEPTION_POINTERS* retVal = NULL;
Thread *pThread = GetThread();
if (pThread->IsExceptionInProgress())
{
retVal = pThread->GetExceptionState()->GetExceptionPointers();
}
return retVal;
}
FCIMPLEND
API Usage
See this issue: open-telemetry/opentelemetry-dotnet#5358
Alternative Designs
No response
Risks
No response
Background and motivation
Currently, Marshal.GetExceptionPointers is not supported in native AOT.
See the environment control flag in runtime:
runtime/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs
Line 97 in b80048e
See open-telemetry/opentelemetry-dotnet#5374 (comment) on how this could be achieved.
API Proposal
Currently, getting in-flight exception is not supported in native AOT:
runtime/src/coreclr/vm/comutilnative.cpp
Line 394 in b80048e
I propose to enable this feature in native AOT:
API Usage
See this issue: open-telemetry/opentelemetry-dotnet#5358
Alternative Designs
No response
Risks
No response