-
Notifications
You must be signed in to change notification settings - Fork 188
Fix race competition when the breakpoint needs be evaluated in multi threads #325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -148,20 +148,12 @@ private CompletableFuture<Value> evaluate(String expression, ThreadReference thr | |
| ASTEvaluationEngine engine = new ASTEvaluationEngine(project, debugTarget); | ||
| boolean newExpression = false; | ||
| if (breakpoint != null) { | ||
| if (StringUtils.isNotBlank(breakpoint.getLogMessage())) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why this condition is deleted: StringUtils.isNotBlank(breakpoint.getLogMessage())?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is not needed any more. Previously the compiled expression for the logpoint and conditional breakpoint are saved separately, so when evaluating a breakpoint, need check whether it's a logpoint or conditional breakpoint. In the new implementation, they are saved in a map, and fetched from the map directly. |
||
| compiledExpression = (ICompiledExpression) breakpoint.getCompiledLogpointExpression(); | ||
| if (compiledExpression == null) { | ||
| newExpression = true; | ||
| compiledExpression = engine.getCompiledExpression(expression, stackframe); | ||
| breakpoint.setCompiledLogpointExpression(compiledExpression); | ||
| } | ||
| } else { | ||
| compiledExpression = (ICompiledExpression) breakpoint.getCompiledConditionalExpression(); | ||
| if (compiledExpression == null) { | ||
| newExpression = true; | ||
| compiledExpression = engine.getCompiledExpression(expression, stackframe); | ||
| breakpoint.setCompiledConditionalExpression(compiledExpression); | ||
| } | ||
| long threadId = thread.uniqueID(); | ||
| compiledExpression = (ICompiledExpression) breakpoint.getCompiledExpression(threadId); | ||
| if (compiledExpression == null) { | ||
| newExpression = true; | ||
| compiledExpression = engine.getCompiledExpression(expression, stackframe); | ||
| breakpoint.setCompiledExpression(threadId, compiledExpression); | ||
| } | ||
| } else { | ||
| compiledExpression = engine.getCompiledExpression(expression, stackframe); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add subscriptions.add(subscription)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the following L182 already did that.