diff options
author | Arseny Chernyaev <arseny.chernyaev@jetbrains.com> | 2017-02-01 20:14:33 +0300 |
---|---|---|
committer | Artem Bukhonov <Artem.Bukhonov@jetbrains.com> | 2017-03-11 21:21:12 +0300 |
commit | b75c5de6e2dcb65532a9385a5a707b8d0e780e69 (patch) | |
tree | 165eb7bb2c0b19bba9e7e703a6ef2ce8fe020f1b /main/src/addins/MonoDevelop.Debugger.Win32 | |
parent | 2dae88ba59a522b10935313afd43ab7e475d2760 (diff) |
handle exception on breakpoint condition evaluation
(cherry picked from commit b2acc57)
Diffstat (limited to 'main/src/addins/MonoDevelop.Debugger.Win32')
-rw-r--r-- | main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/CorDebuggerSession.cs | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/CorDebuggerSession.cs b/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/CorDebuggerSession.cs index cba8e1f4e7..490c368cdb 100644 --- a/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/CorDebuggerSession.cs +++ b/main/src/addins/MonoDevelop.Debugger.Win32/Mono.Debugging.Win32/CorDebuggerSession.cs @@ -503,14 +503,22 @@ namespace Mono.Debugging.Win32 return true;
if (!string.IsNullOrEmpty (bp.ConditionExpression)) {
- string res = EvaluateExpression (thread, bp.ConditionExpression);
- if (bp.BreakIfConditionChanges) {
- if (res == bp.LastConditionValue)
- return true;
- bp.LastConditionValue = res;
- } else {
- if (res != null && res.ToLower () != "true")
- return true;
+ try {
+ string res = EvaluateExpression (thread, bp.ConditionExpression);
+ if (bp.BreakIfConditionChanges) {
+ if (res == bp.LastConditionValue)
+ return true;
+ bp.LastConditionValue = res;
+ }
+ else {
+ if (res != null && res.ToLower () != "true")
+ return true;
+ }
+ }
+ catch (EvaluatorException e) {
+ OnDebuggerOutput (false, e.Message);
+ binfo.SetStatus (BreakEventStatus.Invalid, e.Message);
+ return true;
}
}
@@ -1713,7 +1721,13 @@ namespace Mono.Debugging.Win32 if (j == -1)
break;
string se = exp.Substring (i + 1, j - i - 1);
- se = EvaluateExpression (thread, se);
+ try {
+ se = EvaluateExpression (thread, se);
+ }
+ catch (EvaluatorException e) {
+ OnDebuggerOutput (false, e.ToString ());
+ return String.Empty;
+ }
sb.Append (exp.Substring (last, i - last));
sb.Append (se);
last = j + 1;
@@ -1734,7 +1748,11 @@ namespace Mono.Debugging.Win32 ctx.Thread = thread;
ValueReference val = ctx.Evaluator.Evaluate (ctx, exp);
return val.CreateObjectValue (false).Value;
- } catch (Exception ex) {
+ }
+ catch (EvaluatorException e) {
+ throw;
+ }
+ catch (Exception ex) {
OnDebuggerOutput (true, ex.ToString ());
return string.Empty;
}
|