@@ -2179,8 +2179,15 @@ public SoftMethodCall (SoftEvaluationContext ctx, MethodMirror function, IInvoca
2179
2179
}
2180
2180
2181
2181
public override string Description {
2182
- get {
2183
- return function . DeclaringType . FullName + "." + function . Name ;
2182
+ get
2183
+ {
2184
+ try {
2185
+ return function . DeclaringType . FullName + "." + function . Name ;
2186
+ }
2187
+ catch ( Exception e ) {
2188
+ DebuggerLoggingService . LogError ( "Exception during getting description of method" , e ) ;
2189
+ return "[Unknown method]" ;
2190
+ }
2184
2191
}
2185
2192
}
2186
2193
@@ -2232,7 +2239,7 @@ e is AbsentInformationException ||
2232
2239
tcs . SetException ( new EvaluatorException ( e . Message ) ) ;
2233
2240
}
2234
2241
else {
2235
- DebuggerLoggingService . LogError ( "Unexpected exception has thrown in Invocation" , e ) ;
2242
+ DebuggerLoggingService . LogError ( string . Format ( "Unexpected exception has thrown when ending invocation of {0}" , GetInfo ( ) ) , e ) ;
2236
2243
tcs . SetException ( e ) ;
2237
2244
}
2238
2245
}
@@ -2241,12 +2248,32 @@ e is AbsentInformationException ||
2241
2248
}
2242
2249
} , null ) ;
2243
2250
return tcs . Task ;
2244
- } catch ( Exception ) {
2251
+ } catch ( Exception e ) {
2245
2252
UpdateSessionState ( ) ;
2253
+ DebuggerLoggingService . LogError ( string . Format ( "Unexpected exception has thrown when invoking {0}" , GetInfo ( ) ) , e ) ;
2246
2254
throw ;
2247
2255
}
2248
2256
}
2249
2257
2258
+ string GetInfo ( )
2259
+ {
2260
+ try {
2261
+ TypeMirror type = null ;
2262
+ if ( obj is ObjectMirror )
2263
+ type = ( ( ObjectMirror ) obj ) . Type ;
2264
+ else if ( obj is TypeMirror )
2265
+ type = ( TypeMirror ) obj ;
2266
+ else if ( obj is StructMirror )
2267
+ type = ( ( StructMirror ) obj ) . Type ;
2268
+ return string . Format ( "method {0} on object {1}" ,
2269
+ function . FullName ,
2270
+ type == null ? "[null]" : type . FullName ) ;
2271
+ } catch ( Exception ex ) {
2272
+ DebuggerLoggingService . LogError ( "Error getting info for SDB MethodCall" , ex ) ;
2273
+ return "[Unknown method]" ;
2274
+ }
2275
+ }
2276
+
2250
2277
void UpdateSessionState ( )
2251
2278
{
2252
2279
ctx . Session . StackVersion ++ ;
0 commit comments