Skip to content
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

Native image breakpoints work with shared libraries. #3417

Merged
merged 1 commit into from Jan 8, 2022

Conversation

entlicher
Copy link
Contributor

When submitting a breakpoint into a Java native image, we consult the list of source files from the executable to determine the correct destination file.

The breakpoint's file is resolved relative to the sources folder, which is expected to be the sibling of the executable file.
When the sources folder is not found, breakpoints are resolved to locations that do not exist in the executable.
To verify the correctness of file paths, we use a newly introduced NIDebugger.listSources() method.

@entlicher entlicher added this to the NB13 milestone Jan 5, 2022
@JaroslavTulach
Copy link

I've just tried a version of the .vsix extension prepared by Martin and it kinda works: If my libxyz.so is loaded, I can attach, place a breakpoint to it and it is hit!

If I first attach, then load my dynamic library, the breakpoint doesn't work. But I can live with it.

Copy link

@JaroslavTulach JaroslavTulach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The (necessary) API changes are a little price for getting the debugging working. You have my go!

… and submit breakpoints based on relative path in sources folder.
@entlicher
Copy link
Contributor Author

After all I've abandoned matching file paths in the sources listing as we can not have reliable source list for lazily loaded shared libraries.
The fix reduces to breakpoints submission based on relative paths with respect to the sources folder and using -f option to create pending breakpoints when the location is unknown.

@JaroslavTulach
Copy link

The newest version seems to work for my use-case.

@entlicher entlicher changed the title Consult the list of sources when submitting native breakpoints in Java native image. Native image breakpoints work with shared libraries. Jan 8, 2022
@entlicher entlicher merged commit 25064b0 into apache:master Jan 8, 2022
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.

None yet

2 participants