Skip to content

Commit 17500a5

Browse files
committed
Silently and properly handle COMException in GetThisReference and GetHoistedReference
(cherry picked from commit b3b45f2)
1 parent b5b58d8 commit 17500a5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Mono.Debugging.Win32/CorObjectAdaptor.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
using Microsoft.Samples.Debugging.Extensions;
4444
using System.Linq;
4545
using System.Runtime.CompilerServices;
46+
using System.Runtime.InteropServices;
4647

4748
namespace Mono.Debugging.Win32
4849
{
@@ -1369,7 +1370,8 @@ ValueReference GetHoistedThisReference (CorEvaluationContext cx)
13691370
});
13701371
var type = (CorType) GetValueType (cx, vref);
13711372
return GetHoistedThisReference (cx, type, vref);
1372-
} catch (Exception) {
1373+
} catch (COMException e) {
1374+
DebuggerLoggingService.LogMessage ("Exception in GetHoistedThisReference(): {0}", e.Message);
13731375
}
13741376
return null;
13751377
}
@@ -1458,8 +1460,8 @@ ValueReference GetThisReference (CorEvaluationContext ctx)
14581460
});
14591461

14601462
return new VariableReference (ctx, vref, "this", ObjectValueFlags.Variable | ObjectValueFlags.ReadOnly);
1461-
} catch (Exception e) {
1462-
ctx.WriteDebuggerError (e);
1463+
} catch (COMException e) {
1464+
DebuggerLoggingService.LogMessage("Exception in GetThisReference(): {0}", e.Message);
14631465
return null;
14641466
}
14651467
}

0 commit comments

Comments
 (0)