-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-NativeAOT-coreclrneeds-author-actionAn issue or pull request that requires more info or actions from the author.An issue or pull request that requires more info or actions from the author.
Description
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:
runtime/src/coreclr/vm/comutilnative.cpp
Line 394 in b80048e
| 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;
}
FCIMPLENDAPI Usage
See this issue: open-telemetry/opentelemetry-dotnet#5358
Alternative Designs
No response
Risks
No response
Metadata
Metadata
Assignees
Labels
api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-NativeAOT-coreclrneeds-author-actionAn issue or pull request that requires more info or actions from the author.An issue or pull request that requires more info or actions from the author.
Type
Projects
Status
No status