Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/debugger-libs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArseny Chernyaev <arseny.chernyaev@jetbrains.com>2017-02-01 20:14:33 +0300
committerArtem Bukhonov <Artem.Bukhonov@jetbrains.com>2017-03-11 21:21:12 +0300
commit7707698b51619ebde522aaecff03b9e909dd0976 (patch)
treeb0aa3e9236c2f0c3dd1d55684600dd4a8827a55a /Mono.Debugging.Win32
parentbd2c8fe0a6d1b5b68b6351f0e8bd4ba9864ea9c6 (diff)
handle exception on breakpoint condition evaluation
(cherry picked from commit b2acc57)
Diffstat (limited to 'Mono.Debugging.Win32')
-rw-r--r--Mono.Debugging.Win32/CorDebuggerSession.cs38
1 files changed, 28 insertions, 10 deletions
diff --git a/Mono.Debugging.Win32/CorDebuggerSession.cs b/Mono.Debugging.Win32/CorDebuggerSession.cs
index cba8e1f..490c368 100644
--- a/Mono.Debugging.Win32/CorDebuggerSession.cs
+++ b/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;
}