forked from dotnet/diagnostics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReflection.script
More file actions
66 lines (59 loc) · 3.04 KB
/
Reflection.script
File metadata and controls
66 lines (59 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Reflection debugging scenario
# 1) Load the executable
# 2) Run the executable and wait for it to crash
# 3) Take a dump of the executable.
# 4) Open the dump and compare the output
# We are only verifying the main PrintException fields and for the stacktrace, source lines in the program.
CONTINUE
LOADSOS
# 5) Verifying that !pe gives us the right exception in the format above.
SOSCOMMAND:PrintException
VERIFY:Exception object:\s+<HEXVAL>\s+
VERIFY:Exception type:\s+System\.Reflection\.TargetInvocationException\s+
VERIFY:Message:\s+(<Invalid Object>|Exception has been thrown by the target of an invocation\.)\s+
VERIFY:InnerException:\s+System\.Exception, Use !?printexception <HEXVAL> to see more.\s+
VERIFY:StackTrace \(generated\):\s+
VERIFY:<HEXVAL>\s+<HEXVAL>\s+[Rr]eflection[Tt]est.*!(\$0_)?RefLoader(\.|::)Loader\.Main(\(\))?\+0x<HEXVAL>
VERIFY:(StackTraceString: <none>\s+)?
VERIFY:HResult:\s+80131604
# 6) Verifying that the Exception Object/ID gives us the same output about the reflected exception.
SOSCOMMAND:PrintException <POUT>InnerException:\s+System\.Exception, Use !?printexception (<HEXVAL>) to see more<POUT>
VERIFY:Exception object:\s+<HEXVAL>\s+
VERIFY:Exception type:\s+System\.Exception\s+
VERIFY:Message:\s+(<Invalid Object>|Exception from InvokedCode\.Invoked\.ExceptionNoHandler(\(\))?)\s+
VERIFY:InnerException:\s+<none>\s+
VERIFY:StackTrace \(generated\):\s+
VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+[Rr]eflection[Tt]est.*!(\$0_)?RefLoader(\.|::)Invoked\.ExceptionNoHandler(\(\))?\+0x<HEXVAL>
VERIFY:(StackTraceString: <none>\s+)?
VERIFY:HResult:\s+80131500
# 7) Verifying that there is source file and line number info
SOSCOMMAND:PrintException -lines
VERIFY:Exception type:\s+System\.Reflection\.TargetInvocationException\s+
VERIFY:Message:\s+(<Invalid Object>|Exception has been thrown by the target of an invocation\.)\s+
VERIFY:InnerException:\s+System\.Exception, Use !?printexception <HEXVAL> to see more\.\s+
VERIFY:StackTrace \(generated\):\s+
VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+[Rr]eflection[Tt]est.*!(\$0_)?RefLoader\.Loader\.Main(\(\))?\+0x<HEXVAL>\s*
VERIFY:[.*[\\|/]Debuggees[\\|/].*[Rr]eflection[Tt]est[\\|/][Rr]eflection[Tt]est\.cs @ 32\s*\]
VERIFY:(StackTraceString: <none>\s+)?
VERIFY:HResult:\s+80131604
# Verify that Threads (clrthreads) works
IFDEF:DOTNETDUMP
SOSCOMMAND:clrthreads
ENDIF:DOTNETDUMP
!IFDEF:DOTNETDUMP
SOSCOMMAND:Threads
ENDIF:DOTNETDUMP
VERIFY:\s*ThreadCount:\s+<DECVAL>\s+
VERIFY:\s+UnstartedThread:\s+<DECVAL>\s+
VERIFY:\s+BackgroundThread:\s+<DECVAL>\s+
VERIFY:\s+PendingThread:\s+<DECVAL>\s+
VERIFY:\s+DeadThread:\s+<DECVAL>\s+
VERIFY:\s+Hosted Runtime:\s+no\s+
VERIFY:\s+ID\s+OSID\s+ThreadOBJ\s+State.*\s+
VERIFY:\s+<DECVAL>\s+<DECVAL>\s+<HEXVAL>\s+<HEXVAL>.*\s+
# Verify that ClrStack with no options works
SOSCOMMAND:ClrStack
VERIFY:.*OS Thread Id:\s+0x<HEXVAL>\s+.*
VERIFY:\s+Child\s+SP\s+IP\s+Call Site\s+
VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+(\*\*\* WARNING: Unable to verify checksum for ReflectionTest.exe\s*)?RefLoader\.Loader\.Main(\(\))?\s*
VERIFY:[.*[\\|/]Debuggees[\\|/].*[Rr]eflection[Tt]est[\\|/][Rr]eflection[Tt]est\.cs @ 32\s*\]