mirror of
https://github.com/VSadov/Satori.git
synced 2025-06-09 09:34:49 +09:00
Remove managed EH code frames from stack trace (#108831)
When StackTrace is created inside of an exception filter, it contains stack frames of the managed exception handling code, like System.Runtime.EH.RhThrowEx System.Runtime.EH.DispatchEx System.Runtime.EH.FindFirstPassHandler These should not occur on the stack trace as they are internal implementation detail of the new EH. This change fixes it by adding [StackTraceHidden] attribute to these methods. Close #107995 Co-authored-by: Jan Vorlicek <janvorli@microsoft.com> Co-authored-by: Jeff Schwartz <jeffschw@microsoft.com>
This commit is contained in:
parent
066cfa7e12
commit
cf1c582931
1 changed files with 6 additions and 0 deletions
|
@ -550,6 +550,7 @@ namespace System.Runtime
|
|||
#if NATIVEAOT
|
||||
[RuntimeExport("RhThrowHwEx")]
|
||||
#endif
|
||||
[StackTraceHidden]
|
||||
public static void RhThrowHwEx(uint exceptionCode, ref ExInfo exInfo)
|
||||
{
|
||||
#if NATIVEAOT
|
||||
|
@ -624,6 +625,7 @@ namespace System.Runtime
|
|||
#if NATIVEAOT
|
||||
[RuntimeExport("RhThrowEx")]
|
||||
#endif
|
||||
[StackTraceHidden]
|
||||
public static void RhThrowEx(object exceptionObj, ref ExInfo exInfo)
|
||||
{
|
||||
#if NATIVEAOT
|
||||
|
@ -705,6 +707,7 @@ namespace System.Runtime
|
|||
#if NATIVEAOT
|
||||
[RuntimeExport("RhRethrow")]
|
||||
#endif
|
||||
[StackTraceHidden]
|
||||
public static void RhRethrow(ref ExInfo activeExInfo, ref ExInfo exInfo)
|
||||
{
|
||||
#if NATIVEAOT
|
||||
|
@ -722,6 +725,7 @@ namespace System.Runtime
|
|||
FallbackFailFast(RhFailFastReason.InternalError, null);
|
||||
}
|
||||
|
||||
[StackTraceHidden]
|
||||
private static void DispatchEx(scoped ref StackFrameIterator frameIter, ref ExInfo exInfo)
|
||||
{
|
||||
Debug.Assert(exInfo._passNumber == 1, "expected asm throw routine to set the pass");
|
||||
|
@ -977,6 +981,7 @@ namespace System.Runtime
|
|||
prevFramePtr = curFramePtr;
|
||||
}
|
||||
|
||||
[StackTraceHidden]
|
||||
private static bool FindFirstPassHandler(object exception, uint idxStart,
|
||||
ref StackFrameIterator frameIter, out uint tryRegionIdx, out byte* pHandler)
|
||||
{
|
||||
|
@ -1134,6 +1139,7 @@ namespace System.Runtime
|
|||
{
|
||||
InvokeSecondPass(ref exInfo, idxStart, MaxTryRegionIdx);
|
||||
}
|
||||
|
||||
private static void InvokeSecondPass(ref ExInfo exInfo, uint idxStart, uint idxLimit)
|
||||
{
|
||||
EHEnum ehEnum;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue