@@ -2211,8 +2211,15 @@ public SoftMethodCall (SoftEvaluationContext ctx, MethodMirror function, IInvoca
2211
2211
}
2212
2212
2213
2213
public override string Description {
2214
- get {
2215
- return function . DeclaringType . FullName + "." + function . Name ;
2214
+ get
2215
+ {
2216
+ try {
2217
+ return function . DeclaringType . FullName + "." + function . Name ;
2218
+ }
2219
+ catch ( Exception e ) {
2220
+ DebuggerLoggingService . LogError ( "Exception during getting description of method" , e ) ;
2221
+ return "[Unknown method]" ;
2222
+ }
2216
2223
}
2217
2224
}
2218
2225
@@ -2264,7 +2271,7 @@ e is AbsentInformationException ||
2264
2271
tcs . SetException ( new EvaluatorException ( e . Message ) ) ;
2265
2272
}
2266
2273
else {
2267
- DebuggerLoggingService . LogError ( "Unexpected exception has thrown in Invocation" , e ) ;
2274
+ DebuggerLoggingService . LogError ( string . Format ( "Unexpected exception has thrown when ending invocation of {0}" , GetInfo ( ) ) , e ) ;
2268
2275
tcs . SetException ( e ) ;
2269
2276
}
2270
2277
}
@@ -2273,12 +2280,32 @@ e is AbsentInformationException ||
2273
2280
}
2274
2281
} , null ) ;
2275
2282
return tcs . Task ;
2276
- } catch ( Exception ) {
2283
+ } catch ( Exception e ) {
2277
2284
UpdateSessionState ( ) ;
2285
+ DebuggerLoggingService . LogError ( string . Format ( "Unexpected exception has thrown when invoking {0}" , GetInfo ( ) ) , e ) ;
2278
2286
throw ;
2279
2287
}
2280
2288
}
2281
2289
2290
+ string GetInfo ( )
2291
+ {
2292
+ try {
2293
+ TypeMirror type = null ;
2294
+ if ( obj is ObjectMirror )
2295
+ type = ( ( ObjectMirror ) obj ) . Type ;
2296
+ else if ( obj is TypeMirror )
2297
+ type = ( TypeMirror ) obj ;
2298
+ else if ( obj is StructMirror )
2299
+ type = ( ( StructMirror ) obj ) . Type ;
2300
+ return string . Format ( "method {0} on object {1}" ,
2301
+ function . FullName ,
2302
+ type == null ? "[null]" : type . FullName ) ;
2303
+ } catch ( Exception ex ) {
2304
+ DebuggerLoggingService . LogError ( "Error getting info for SDB MethodCall" , ex ) ;
2305
+ return "[Unknown method]" ;
2306
+ }
2307
+ }
2308
+
2282
2309
void UpdateSessionState ( )
2283
2310
{
2284
2311
ctx . Session . StackVersion ++ ;
0 commit comments