Frame Support Matrix
|
x86 |
x64 |
arm |
arm64 |
| ResumableFrame |
✅ |
✅ |
✅ |
✅ |
| TransitionFrame |
✅ |
✅ |
✅ |
✅ |
| FaultingExceptionFrame |
✅ |
✅ |
✅ |
✅ |
| SoftwareExceptionFrame |
✅ |
✅ |
✅ |
✅ |
| FuncEvalFrame |
✅ |
✅ |
✅ |
✅ |
| HijackFrame |
✅ |
✅ |
✅ |
✅ |
| InlinedCallFrame |
✅ |
✅ |
✅ |
✅ |
| TailCallFrame |
✅ |
- |
- |
- |
| InterpreterFrame |
|
|
|
|
Key
|
|
| ✅ |
Verified |
| - |
Not applicable for platform |
Information on Frames
- Support all Frames with
NeedsUpdateRegDisplay()==true
class RedirectedThreadFrame
{
public volatile bool flag;
public volatile int num;
public RedirectedThreadFrame()
{
}
// Configure WinDBG to break on clr exceptions
// (sxe clr)
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
public void Test()
{
var cts = new CancellationTokenSource();
cts.CancelAfter(500);
// use ControlledExecution with a cancellation token to trigger a
// thread abort with a try/catch
ControlledExecution.Run(Work, cts.Token);
while (!flag)
{
TestLoop();
}
}
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)]
public void TestLoop()
{
for (int i = 0; i < 20; i++)
{
num++;
}
}
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
public void Work()
{
try
{
while (!flag)
{
TestLoop();
}
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
class FaultingExceptionTest
{
public volatile bool flag;
public volatile int num;
public FaultingExceptionTest()
{
}
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
public void Test()
{
// bu coreclr!ThrowControlForThread
Console.ReadLine();
var cts = new CancellationTokenSource();
cts.CancelAfter(500);
ControlledExecution.Run(Work, cts.Token);
while (!flag)
{
TestLoop();
}
}
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)]
public void TestLoop()
{
for (int i = 0; i < 20; i++)
{
if (num > 10000)
{
Console.WriteLine("num is greater than 10000");
}
num++;
}
}
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
public void Work()
{
try
{
while (!flag)
{
TestLoop();
}
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
class HijackTest()
{
public volatile bool flag;
public volatile int num;
// Set breakpoint at ThreadSuspend::SuspendEE then step out and look at the main thread stack
// (bu coreclr!ThreadSuspend::SuspendEE)
// Note: HijackFrames are not used on Windows if CET is enabled. Either test on non-Windows
// or disable CET by modifying Thread::AreShadowStacksEnabled to return false.
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
public void Test()
{
// start other thread that will force a GC collection.
Task.Run(Work);
// run loop checking volatile variable to generate non-interruptible code.
while (!flag)
{
TestLoop();
}
}
public void Work()
{
Thread.Sleep(500);
GC.Collect();
}
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)]
public void TestLoop()
{
num++; num++; num++; num++; num++;
num++; num++; num++; num++; num++;
num++; num++; num++; num++; num++;
num++; num++; num++; num++; num++;
num++; num++; num++; num++; num++;
num++; num++; num++; num++; num++;
}
}
Mostly implemented in #111759 and #112997
Frame Support Matrix
Key
Information on Frames
NeedsUpdateRegDisplay()==trueResumableFrame[cDAC] Stack walk support more Frame types #112997PTR_CONTEXTTransitionFrame[cDAC] Stack walk support more Frame types #112997TransitionBlockPrestubMethodFrameFaultingExceptionFrame[cDAC] Stack walk support more Frame types #112997T_CONTEXTThrowControlForThreadafter it callsInitAndLink. Invoke with a two threaded process where one thread is doing work (loop checking volatile variable) and is cancelled using the following API: Implement ControlledExecution API #71661THROW_CONTROL_FOR_THREAD_FUNCTIONSoftwareExceptionFrame- [cDAC] Implement core stackwalking #111759T_CONTEXTFuncEvalFrame[cDAC] Stack walk support more Frame types #112997Console.ReadLine()while it is executing create a dump. Use OS to create a dump (or WinDBG as a non-invasive attach on the debugged process).HelperMethodFrameLazyMachStateHijackFrame[cDAC] Stack walk support more Frame types #112997InlinedCallFrame- [cDAC] Implement core stackwalking #111759TailCallFrame(Windows x86 only)Mostly implemented in #111759 and #112997