Skip to content

Add support for method breakpoints #418

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

Closed
wants to merge 2 commits into from

Conversation

gayanper
Copy link
Contributor

@gayanper gayanper commented Jun 7, 2022

Add support for function breakpoint for java. The current version support adding a function break point with the following syntax.

FQ ClassName#methodName

like

java.util.ArrayList#add

The current version doesn't consider parameter signatures.

@ghost
Copy link

ghost commented Jun 7, 2022

CLA assistant check
All CLA requirements met.

@testforstephen testforstephen self-requested a review June 8, 2022 08:05
@gayanper
Copy link
Contributor Author

gayanper commented Jun 8, 2022

Seems like we need to move to Java 17 JDK for building @testforstephen

@testforstephen
Copy link
Contributor

Seems like we need to move to Java 17 JDK for building @testforstephen

Yes, I have another PR #420 to use JDK 17 as build jdk.

@testforstephen testforstephen force-pushed the function_breakpoints branch from 1a16d33 to 1c853c5 Compare June 8, 2022 09:45
@testforstephen
Copy link
Contributor

checkstyle failed, you can run ./mvnw checkstyle:check to check it.

Error:  src/main/java/com/microsoft/java/debug/core/adapter/IBreakpointManager.java:[85] (regexp) RegexpSingleline: Line has trailing spaces.
Error:  src/main/java/com/microsoft/java/debug/core/adapter/IBreakpointManager.java:[86] (javadoc) NonEmptyAtclauseDescription: At-clause should have a non-empty description.

@testforstephen
Copy link
Contributor

testforstephen commented Jun 9, 2022

@gayanper Thanks for bringing the support for function breakpoints, it's a good improvement.

I tried this PR with VS Code client and it basically works. I just have some concerns about the ease of use.

Currently, the user must add a FQN#methodName to enable a function breakpoint, which is not transparent to user, and it is also not user-friendly to enter such a long name in the text input box.
image

It is OK to keep the current design. But it would be a nice addition if we could also allow adding function breakpoints at the code where the function is declared.

For example, when adding a breakpoint at line 6, then the debugger is able to auto register it as a function breakpoint.
image

@gayanper
Copy link
Contributor Author

gayanper commented Jun 9, 2022

@gayanper Thanks for bringing the support for function breakpoints, it's a good improvement.

I tried this PR with VS Code client and it basically works. I just have some concerns about the ease of use.

Currently, the user must add a FQN#methodName to enable a function breakpoint, which is not transparent to user, and it is also not user-friendly to enter such a long name in the text input box. image

It is OK to keep the current design. But it would be a nice addition if we could also allow adding function breakpoints at the code where the function is declared.

For example, when adding a breakpoint at line 6, then the debugger is able to auto register it as a function breakpoint. image

Thats a good suggestion, I can actually improve this PR to support that.

@testforstephen
Copy link
Contributor

@gayanper In the current version, it seems that method breakpoints don't work if I add two method breakpoints for the same class. If this issue is resolved, I am willing to merge this PR first. We can use a new PR to support enabling method breakpoints at the declaration positions.

WDYT?

@gayanper
Copy link
Contributor Author

Sure @testforstephen I can try to finish this in coming weekend

@testforstephen
Copy link
Contributor

@gayanper Based on your commit, I sumbited a new PR #424 to address the issues with function breakpoint.

@gayanper
Copy link
Contributor Author

Thats good @testforstephen. Last week i got busy with some work and fixing few eclipse features. Shall we close this PR since you have the new PR with these changes ?

@testforstephen
Copy link
Contributor

@gayanper yes, we can close this PR, thanks for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants