Browse Source

Adjust debugger test cases to new DefaultResolvedMethod.ToString() implementation.

Enable lazy-loading for the debugger type system.
newNRvisualizers
Daniel Grunwald 14 years ago
parent
commit
dfaab95005
  1. 1
      src/AddIns/Debugger/Debugger.Core/TypeSystemExtensions.cs
  2. 12
      src/AddIns/Debugger/Debugger.Tests/Tests/ControlFlow_MainThreadExit.cs
  3. 12
      src/AddIns/Debugger/Debugger.Tests/Tests/StackFrame_Callstack.cs
  4. 16
      src/AddIns/Debugger/Debugger.Tests/Tests/StackFrame_Lifetime.cs
  5. 12
      src/AddIns/Debugger/Debugger.Tests/Tests/Thread_Tests.cs

1
src/AddIns/Debugger/Debugger.Core/TypeSystemExtensions.cs

@ -61,6 +61,7 @@ namespace Debugger
{ {
CecilLoader loader = new CecilLoader(true); CecilLoader loader = new CecilLoader(true);
loader.IncludeInternalMembers = true; loader.IncludeInternalMembers = true;
loader.LazyLoad = true;
var asm = loader.LoadAssemblyFile(name); var asm = loader.LoadAssemblyFile(name);
var moduleMetadataInfo = new ModuleMetadataInfo(module); var moduleMetadataInfo = new ModuleMetadataInfo(module);
foreach (var typeDef in asm.GetAllTypeDefinitions()) { foreach (var typeDef in asm.GetAllTypeDefinitions()) {

12
src/AddIns/Debugger/Debugger.Tests/Tests/ControlFlow_MainThreadExit.cs

@ -62,20 +62,20 @@ namespace Debugger.Tests {
Count="2"> Count="2">
<Item> <Item>
<Thread <Thread
Callstack="{[Method Debugger.Tests.ControlFlow_MainThreadExit.Main]}" Callstack="{[Method Debugger.Tests.ControlFlow_MainThreadExit.Main():System.Void]}"
IsAtSafePoint="True" IsAtSafePoint="True"
IsInValidState="True" IsInValidState="True"
MostRecentStackFrame="[Method Debugger.Tests.ControlFlow_MainThreadExit.Main]" MostRecentStackFrame="[Method Debugger.Tests.ControlFlow_MainThreadExit.Main():System.Void]"
Name="" Name=""
Priority="Normal" Priority="Normal"
RuntimeValue="{System.Threading.Thread}" /> RuntimeValue="{System.Threading.Thread}" />
</Item> </Item>
<Item> <Item>
<Thread <Thread
Callstack="{[Method System.Threading.WaitHandle.InternalWaitOne], [Method System.Threading.WaitHandle.WaitOne], [Method System.Threading.WaitHandle.WaitOne], [Method Debugger.Tests.ControlFlow_MainThreadExit.WaitForALongTime], [Method System.Threading.ThreadHelper.ThreadStart_Context], [Method System.Threading.ExecutionContext.RunInternal], [Method System.Threading.ExecutionContext.Run], [Method System.Threading.ExecutionContext.Run], [Method System.Threading.ThreadHelper.ThreadStart]}" Callstack="{[Method System.Threading.WaitHandle.InternalWaitOne(waitableSafeHandle:System.Runtime.InteropServices.SafeHandle, millisecondsTimeout:System.Int64, hasThreadAffinity:System.Boolean, exitContext:System.Boolean):System.Boolean], [Method System.Threading.WaitHandle.WaitOne(millisecondsTimeout:System.Int32, exitContext:System.Boolean):System.Boolean], [Method System.Threading.WaitHandle.WaitOne():System.Boolean], [Method Debugger.Tests.ControlFlow_MainThreadExit.WaitForALongTime():System.Void], [Method System.Threading.ThreadHelper.ThreadStart_Context(state:System.Object):System.Void], [Method System.Threading.ExecutionContext.RunInternal(executionContext:System.Threading.ExecutionContext, callback:System.Threading.ContextCallback, state:System.Object, preserveSyncCtx:System.Boolean):System.Void], [Method System.Threading.ExecutionContext.Run(executionContext:System.Threading.ExecutionContext, callback:System.Threading.ContextCallback, state:System.Object, preserveSyncCtx:System.Boolean):System.Void], [Method System.Threading.ExecutionContext.Run(executionContext:System.Threading.ExecutionContext, callback:System.Threading.ContextCallback, state:System.Object):System.Void], [Method System.Threading.ThreadHelper.ThreadStart():System.Void]}"
IsAtSafePoint="True" IsAtSafePoint="True"
IsInValidState="True" IsInValidState="True"
MostRecentStackFrame="[Method System.Threading.WaitHandle.InternalWaitOne]" MostRecentStackFrame="[Method System.Threading.WaitHandle.InternalWaitOne(waitableSafeHandle:System.Runtime.InteropServices.SafeHandle, millisecondsTimeout:System.Int64, hasThreadAffinity:System.Boolean, exitContext:System.Boolean):System.Boolean]"
Name="Worker thread" Name="Worker thread"
Priority="Normal" Priority="Normal"
RuntimeValue="{System.Threading.Thread}" /> RuntimeValue="{System.Threading.Thread}" />
@ -93,10 +93,10 @@ namespace Debugger.Tests {
</Item> </Item>
<Item> <Item>
<Thread <Thread
Callstack="{[Method System.Threading.WaitHandle.InternalWaitOne], [Method System.Threading.WaitHandle.WaitOne], [Method System.Threading.WaitHandle.WaitOne], [Method Debugger.Tests.ControlFlow_MainThreadExit.WaitForALongTime], [Method System.Threading.ThreadHelper.ThreadStart_Context], [Method System.Threading.ExecutionContext.RunInternal], [Method System.Threading.ExecutionContext.Run], [Method System.Threading.ExecutionContext.Run], [Method System.Threading.ThreadHelper.ThreadStart]}" Callstack="{[Method System.Threading.WaitHandle.InternalWaitOne(waitableSafeHandle:System.Runtime.InteropServices.SafeHandle, millisecondsTimeout:System.Int64, hasThreadAffinity:System.Boolean, exitContext:System.Boolean):System.Boolean], [Method System.Threading.WaitHandle.WaitOne(millisecondsTimeout:System.Int32, exitContext:System.Boolean):System.Boolean], [Method System.Threading.WaitHandle.WaitOne():System.Boolean], [Method Debugger.Tests.ControlFlow_MainThreadExit.WaitForALongTime():System.Void], [Method System.Threading.ThreadHelper.ThreadStart_Context(state:System.Object):System.Void], [Method System.Threading.ExecutionContext.RunInternal(executionContext:System.Threading.ExecutionContext, callback:System.Threading.ContextCallback, state:System.Object, preserveSyncCtx:System.Boolean):System.Void], [Method System.Threading.ExecutionContext.Run(executionContext:System.Threading.ExecutionContext, callback:System.Threading.ContextCallback, state:System.Object, preserveSyncCtx:System.Boolean):System.Void], [Method System.Threading.ExecutionContext.Run(executionContext:System.Threading.ExecutionContext, callback:System.Threading.ContextCallback, state:System.Object):System.Void], [Method System.Threading.ThreadHelper.ThreadStart():System.Void]}"
IsAtSafePoint="True" IsAtSafePoint="True"
IsInValidState="True" IsInValidState="True"
MostRecentStackFrame="[Method System.Threading.WaitHandle.InternalWaitOne]" MostRecentStackFrame="[Method System.Threading.WaitHandle.InternalWaitOne(waitableSafeHandle:System.Runtime.InteropServices.SafeHandle, millisecondsTimeout:System.Int64, hasThreadAffinity:System.Boolean, exitContext:System.Boolean):System.Boolean]"
Name="Worker thread" Name="Worker thread"
Priority="Normal" Priority="Normal"
RuntimeValue="{System.Threading.Thread}" /> RuntimeValue="{System.Threading.Thread}" />

12
src/AddIns/Debugger/Debugger.Tests/Tests/StackFrame_Callstack.cs

@ -60,7 +60,7 @@ namespace Debugger.Tests {
ChainIndex="1" ChainIndex="1"
FrameIndex="2" FrameIndex="2"
HasSymbols="True" HasSymbols="True"
MethodInfo="[Method Debugger.Tests.StackFrame_Callstack.Sub2]" MethodInfo="[Method Debugger.Tests.StackFrame_Callstack.Sub2():System.Void]"
NextStatement="StackFrame_Callstack.cs:22,4-22,40" NextStatement="StackFrame_Callstack.cs:22,4-22,40"
Thread="Thread Name = Suspended = False" /> Thread="Thread Name = Suspended = False" />
</Item> </Item>
@ -69,7 +69,7 @@ namespace Debugger.Tests {
ChainIndex="1" ChainIndex="1"
FrameIndex="1" FrameIndex="1"
HasSymbols="True" HasSymbols="True"
MethodInfo="[Method Debugger.Tests.StackFrame_Callstack.Sub1]" MethodInfo="[Method Debugger.Tests.StackFrame_Callstack.Sub1():System.Void]"
NextStatement="StackFrame_Callstack.cs:17,4-17,11" NextStatement="StackFrame_Callstack.cs:17,4-17,11"
Thread="Thread Name = Suspended = False" /> Thread="Thread Name = Suspended = False" />
</Item> </Item>
@ -77,7 +77,7 @@ namespace Debugger.Tests {
<StackFrame <StackFrame
ChainIndex="1" ChainIndex="1"
HasSymbols="True" HasSymbols="True"
MethodInfo="[Method Debugger.Tests.StackFrame_Callstack.Main]" MethodInfo="[Method Debugger.Tests.StackFrame_Callstack.Main():System.Void]"
NextStatement="StackFrame_Callstack.cs:12,4-12,11" NextStatement="StackFrame_Callstack.cs:12,4-12,11"
Thread="Thread Name = Suspended = False" /> Thread="Thread Name = Suspended = False" />
</Item> </Item>
@ -89,7 +89,7 @@ namespace Debugger.Tests {
ChainIndex="1" ChainIndex="1"
FrameIndex="1" FrameIndex="1"
HasSymbols="True" HasSymbols="True"
MethodInfo="[Method Debugger.Tests.StackFrame_Callstack.Sub1]" MethodInfo="[Method Debugger.Tests.StackFrame_Callstack.Sub1():System.Void]"
NextStatement="StackFrame_Callstack.cs:17,4-17,11" NextStatement="StackFrame_Callstack.cs:17,4-17,11"
Thread="Thread Name = Suspended = False" /> Thread="Thread Name = Suspended = False" />
</Item> </Item>
@ -97,7 +97,7 @@ namespace Debugger.Tests {
<StackFrame <StackFrame
ChainIndex="1" ChainIndex="1"
HasSymbols="True" HasSymbols="True"
MethodInfo="[Method Debugger.Tests.StackFrame_Callstack.Main]" MethodInfo="[Method Debugger.Tests.StackFrame_Callstack.Main():System.Void]"
NextStatement="StackFrame_Callstack.cs:12,4-12,11" NextStatement="StackFrame_Callstack.cs:12,4-12,11"
Thread="Thread Name = Suspended = False" /> Thread="Thread Name = Suspended = False" />
</Item> </Item>
@ -108,7 +108,7 @@ namespace Debugger.Tests {
<StackFrame <StackFrame
ChainIndex="1" ChainIndex="1"
HasSymbols="True" HasSymbols="True"
MethodInfo="[Method Debugger.Tests.StackFrame_Callstack.Main]" MethodInfo="[Method Debugger.Tests.StackFrame_Callstack.Main():System.Void]"
NextStatement="StackFrame_Callstack.cs:12,4-12,11" NextStatement="StackFrame_Callstack.cs:12,4-12,11"
Thread="Thread Name = Suspended = False" /> Thread="Thread Name = Suspended = False" />
</Item> </Item>

16
src/AddIns/Debugger/Debugger.Tests/Tests/StackFrame_Lifetime.cs

@ -73,7 +73,7 @@ namespace Debugger.Tests {
ChainIndex="1" ChainIndex="1"
FrameIndex="1" FrameIndex="1"
HasSymbols="True" HasSymbols="True"
MethodInfo="[Method Debugger.Tests.StackFrame_Lifetime.Function]" MethodInfo="[Method Debugger.Tests.StackFrame_Lifetime.Function(i:System.Int32):System.Void]"
NextStatement="StackFrame_Lifetime.cs:18,4-18,40" NextStatement="StackFrame_Lifetime.cs:18,4-18,40"
Thread="Thread Name = Suspended = False" /> Thread="Thread Name = Suspended = False" />
</SelectedStackFrame> </SelectedStackFrame>
@ -84,7 +84,7 @@ namespace Debugger.Tests {
ChainIndex="1" ChainIndex="1"
FrameIndex="1" FrameIndex="1"
HasSymbols="True" HasSymbols="True"
MethodInfo="[Method Debugger.Tests.StackFrame_Lifetime.Function]" MethodInfo="[Method Debugger.Tests.StackFrame_Lifetime.Function(i:System.Int32):System.Void]"
NextStatement="StackFrame_Lifetime.cs:19,4-19,18" NextStatement="StackFrame_Lifetime.cs:19,4-19,18"
Thread="Thread Name = Suspended = False" /> Thread="Thread Name = Suspended = False" />
</Old_StackFrame> </Old_StackFrame>
@ -93,7 +93,7 @@ namespace Debugger.Tests {
ChainIndex="1" ChainIndex="1"
FrameIndex="2" FrameIndex="2"
HasSymbols="True" HasSymbols="True"
MethodInfo="[Method Debugger.Tests.StackFrame_Lifetime.SubFunction]" MethodInfo="[Method Debugger.Tests.StackFrame_Lifetime.SubFunction():System.Void]"
NextStatement="StackFrame_Lifetime.cs:25,4-25,40" NextStatement="StackFrame_Lifetime.cs:25,4-25,40"
Thread="Thread Name = Suspended = False" /> Thread="Thread Name = Suspended = False" />
</SelectedStackFrame> </SelectedStackFrame>
@ -104,7 +104,7 @@ namespace Debugger.Tests {
ChainIndex="1" ChainIndex="1"
FrameIndex="1" FrameIndex="1"
HasSymbols="True" HasSymbols="True"
MethodInfo="[Method Debugger.Tests.StackFrame_Lifetime.Function]" MethodInfo="[Method Debugger.Tests.StackFrame_Lifetime.Function(i:System.Int32):System.Void]"
NextStatement="StackFrame_Lifetime.cs:20,4-20,40" NextStatement="StackFrame_Lifetime.cs:20,4-20,40"
Thread="Thread Name = Suspended = False" /> Thread="Thread Name = Suspended = False" />
</Old_StackFrame> </Old_StackFrame>
@ -114,7 +114,7 @@ namespace Debugger.Tests {
ChainIndex="1" ChainIndex="1"
FrameIndex="1" FrameIndex="1"
HasSymbols="True" HasSymbols="True"
MethodInfo="[Method Debugger.Tests.StackFrame_Lifetime.Function]" MethodInfo="[Method Debugger.Tests.StackFrame_Lifetime.Function(i:System.Int32):System.Void]"
NextStatement="StackFrame_Lifetime.cs:20,4-20,40" NextStatement="StackFrame_Lifetime.cs:20,4-20,40"
Thread="Thread Name = Suspended = False" /> Thread="Thread Name = Suspended = False" />
</SelectedStackFrame> </SelectedStackFrame>
@ -123,7 +123,7 @@ namespace Debugger.Tests {
<StackFrame <StackFrame
ChainIndex="1" ChainIndex="1"
HasSymbols="True" HasSymbols="True"
MethodInfo="[Method Debugger.Tests.StackFrame_Lifetime.Main]" MethodInfo="[Method Debugger.Tests.StackFrame_Lifetime.Main():System.Void]"
NextStatement="StackFrame_Lifetime.cs:13,4-13,40" NextStatement="StackFrame_Lifetime.cs:13,4-13,40"
Thread="Thread Name = Suspended = False" /> Thread="Thread Name = Suspended = False" />
</Main> </Main>
@ -134,7 +134,7 @@ namespace Debugger.Tests {
FrameIndex="1" FrameIndex="1"
HasSymbols="True" HasSymbols="True"
IsInvalid="True" IsInvalid="True"
MethodInfo="[Method Debugger.Tests.StackFrame_Lifetime.Function]" MethodInfo="[Method Debugger.Tests.StackFrame_Lifetime.Function(i:System.Int32):System.Void]"
NextStatement="{Exception: The requested frame index is too big}" NextStatement="{Exception: The requested frame index is too big}"
Thread="Thread Name = Suspended = False" /> Thread="Thread Name = Suspended = False" />
</Old_StackFrame> </Old_StackFrame>
@ -142,7 +142,7 @@ namespace Debugger.Tests {
<StackFrame <StackFrame
ChainIndex="1" ChainIndex="1"
HasSymbols="True" HasSymbols="True"
MethodInfo="[Method Debugger.Tests.StackFrame_Lifetime.Main]" MethodInfo="[Method Debugger.Tests.StackFrame_Lifetime.Main():System.Void]"
NextStatement="StackFrame_Lifetime.cs:13,4-13,40" NextStatement="StackFrame_Lifetime.cs:13,4-13,40"
Thread="Thread Name = Suspended = False" /> Thread="Thread Name = Suspended = False" />
</SelectedStackFrame> </SelectedStackFrame>

12
src/AddIns/Debugger/Debugger.Tests/Tests/Thread_Tests.cs

@ -49,10 +49,10 @@ namespace Debugger.Tests {
<Paused>Thread_Tests.cs:12,4-12,40</Paused> <Paused>Thread_Tests.cs:12,4-12,40</Paused>
<Thread> <Thread>
<Thread <Thread
Callstack="{[Method Debugger.Tests.Thread_Tests.Main]}" Callstack="{[Method Debugger.Tests.Thread_Tests.Main():System.Void]}"
IsAtSafePoint="True" IsAtSafePoint="True"
IsInValidState="True" IsInValidState="True"
MostRecentStackFrame="[Method Debugger.Tests.Thread_Tests.Main]" MostRecentStackFrame="[Method Debugger.Tests.Thread_Tests.Main():System.Void]"
Name="" Name=""
Priority="Normal" Priority="Normal"
RuntimeValue="null" /> RuntimeValue="null" />
@ -60,10 +60,10 @@ namespace Debugger.Tests {
<Paused>Thread_Tests.cs:15,4-15,40</Paused> <Paused>Thread_Tests.cs:15,4-15,40</Paused>
<Thread> <Thread>
<Thread <Thread
Callstack="{[Method Debugger.Tests.Thread_Tests.Main]}" Callstack="{[Method Debugger.Tests.Thread_Tests.Main():System.Void]}"
IsAtSafePoint="True" IsAtSafePoint="True"
IsInValidState="True" IsInValidState="True"
MostRecentStackFrame="[Method Debugger.Tests.Thread_Tests.Main]" MostRecentStackFrame="[Method Debugger.Tests.Thread_Tests.Main():System.Void]"
Name="" Name=""
Priority="AboveNormal" Priority="AboveNormal"
RuntimeValue="{System.Threading.Thread}" /> RuntimeValue="{System.Threading.Thread}" />
@ -71,10 +71,10 @@ namespace Debugger.Tests {
<Paused>Thread_Tests.cs:17,4-17,40</Paused> <Paused>Thread_Tests.cs:17,4-17,40</Paused>
<Thread> <Thread>
<Thread <Thread
Callstack="{[Method Debugger.Tests.Thread_Tests.Main]}" Callstack="{[Method Debugger.Tests.Thread_Tests.Main():System.Void]}"
IsAtSafePoint="True" IsAtSafePoint="True"
IsInValidState="True" IsInValidState="True"
MostRecentStackFrame="[Method Debugger.Tests.Thread_Tests.Main]" MostRecentStackFrame="[Method Debugger.Tests.Thread_Tests.Main():System.Void]"
Name="ThreadName" Name="ThreadName"
Priority="AboveNormal" Priority="AboveNormal"
RuntimeValue="{System.Threading.Thread}" /> RuntimeValue="{System.Threading.Thread}" />

Loading…
Cancel
Save