Skip to content

Commit 1d4a9c4

Browse files
committed
Restore GetInfo() and detailed logging on invocation
1 parent 5be3b5b commit 1d4a9c4

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

Mono.Debugging.Soft/SoftDebuggerAdaptor.cs

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2179,8 +2179,15 @@ public SoftMethodCall (SoftEvaluationContext ctx, MethodMirror function, IInvoca
21792179
}
21802180

21812181
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+
}
21842191
}
21852192
}
21862193

@@ -2232,7 +2239,7 @@ e is AbsentInformationException ||
22322239
tcs.SetException (new EvaluatorException (e.Message));
22332240
}
22342241
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);
22362243
tcs.SetException (e);
22372244
}
22382245
}
@@ -2241,12 +2248,32 @@ e is AbsentInformationException ||
22412248
}
22422249
}, null);
22432250
return tcs.Task;
2244-
} catch (Exception) {
2251+
} catch (Exception e) {
22452252
UpdateSessionState ();
2253+
DebuggerLoggingService.LogError (string.Format ("Unexpected exception has thrown when invoking {0}", GetInfo ()), e);
22462254
throw;
22472255
}
22482256
}
22492257

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+
22502277
void UpdateSessionState ()
22512278
{
22522279
ctx.Session.StackVersion++;

0 commit comments

Comments
 (0)