-
Notifications
You must be signed in to change notification settings - Fork 170
Improve support for method breakpoints #426
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
Conversation
@testforstephen Please review this and let me know what you think ? |
Had a try and found two issues:
I'm thinking a different approach to support the breakpoint added through method header. I think it might be easier to handle it as a line breakpoint instead of method breakpoint.
|
Yes it might be more simpler and efficient than the method entry request. But will it work for decompiled classes since there is no source location available ? And i wonder if we could use the same for lambda and BreakpointLocations implementation so that it will be more user friendly to add breakpoint to step into just selected method invocation in a expression with many method invocations. WDYT ? |
@testforstephen I will try to change the fix with your suggestion, I think we can support method breakpoints better with your suggestion, specially overcoming the overloaded problem with less effort. About lambda I think we might be able to do the same if we find the correct method invocation signature as the FQN. Thanks for the suggestion, it makes the solution more extendable. |
If the classfile doesn't include the source location info, current breakpoint policy cannot work.
VS Code 1.69 added a new capability to step into targets, we can adopt it in the scenario of multiple chain calls in the same line. |
@testforstephen I have reworked the solution, please check and let me know. |
@testforstephen Do you think if we need to comparison of generic method signature ? |
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 latest commit works pretty well.
Another improvement we can optimize is the breakpoint event reason. Currently the method header breakpoint stops with the reason "Paused on Breakpoint", it would be better if it can displayed as "Paused on Function Breakpoint". One approach we can use is to store some additional property via BreakpointRequest#putProperty(), and use that to distinguish the BreakpointEvent reason.
com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/Breakpoint.java
Outdated
Show resolved
Hide resolved
Will improve this on Monday |
I think checking the method signature is enough. I see current implementation is reusing binding#getKey(), which considers both generic signature and signature. if it works, that's ok. |
Then let’s improve this once we have the JDT API i tagged you in. |
79cb06b
to
b8ef001
Compare
com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/Breakpoint.java
Outdated
Show resolved
Hide resolved
Now method breakpoints can added by adding a line breakpoint at method header.
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.
@gayanper It works well for me. Thanks for contribution.
Now method breakpoints can added by adding a line breakpoint at method
header.