@@ -4,25 +4,53 @@ This contract is for getting information about exceptions in the process.
44
55## APIs of contract
66
7+ ``` csharp
8+ record struct ExceptionData (
9+ TargetPointer Message ,
10+ TargetPointer InnerException ,
11+ TargetPointer StackTrace ,
12+ TargetPointer WatsonBuckets ,
13+ TargetPointer StackTraceString ,
14+ TargetPointer RemoteStackTraceString ,
15+ int HResult ,
16+ int XCode );
17+ ```
18+
719``` csharp
8- TargetPointer GetExceptionInfo (TargetPointer exception , out TargetPointer nextNestedException );
20+ TargetPointer GetNestedExceptionInfo (TargetPointer exceptionInfoAddr , out TargetPointer nextNestedExceptionInfo );
21+ ExceptionData GetExceptionData (TargetPointer exceptionAddr )
922```
1023
1124## Version 1
1225
1326Data descriptors used:
1427- ` ExceptionInfo `
28+ - ` Exception `
1529
1630``` csharp
17- TargetPointer GetExceptionInfo (TargetPointer exception , out TargetPointer nextNestedException )
31+ TargetPointer GetNestedExceptionInfo (TargetPointer exceptionInfoAddr , out TargetPointer nextNestedExceptionInfo )
1832{
19- if (exception == TargetPointer .Null )
33+ if (exceptionInfo == TargetPointer .Null )
2034 throw new InvalidArgumentException ();
2135
22- nextNestedException = target .ReadPointer (address + /* ExceptionInfo::PreviousNestedInfo offset*/ );
23- TargetPointer thrownObjHandle = target .ReadPointer (address + /* ExceptionInfo::ThrownObject offset */ );
36+ nextNestedException = target .ReadPointer (exceptionInfo + /* ExceptionInfo::PreviousNestedInfo offset*/ );
37+ TargetPointer thrownObjHandle = target .ReadPointer (exceptionInfo + /* ExceptionInfo::ThrownObject offset */ );
2438 return = thrownObjHandle != TargetPointer .Null
2539 ? target .ReadPointer (thrownObjHandle )
2640 : TargetPointer .Null ;
2741}
42+
43+ ExceptionData GetExceptionData (TargetPointer exceptionAddr )
44+ {
45+ return new ExceptionData (
46+ target .ReadPointer (exceptionAddr + /* Exception::Message offset */ ),
47+ target .ReadPointer (exceptionAddr + /* Exception::InnerException offset */ ),
48+ target .ReadPointer (exceptionAddr + /* Exception::StackTrace offset */ ),
49+ target .ReadPointer (exceptionAddr + /* Exception::WatsonBuckets offset */ ),
50+ target .ReadPointer (exceptionAddr + /* Exception::StackTraceString offset */ ),
51+ target .ReadPointer (exceptionAddr + /* Exception::RemoteStackTraceString offset */ ),
52+ target .Read <int >(exceptionAddr + /* Exception::HResult offset */ ),
53+ target .Read <int >(exceptionAddr + /* Exception::XCode offset */ ),
54+ );
55+ }
2856```
0 commit comments