-
Notifications
You must be signed in to change notification settings - Fork 45
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
Investigate the possibility of implementing a bridge between GDB and JDI #142
Comments
Apparently the debug info is not available for LLVM backend. |
What do you mean or where do you take this from? What I saw in the code and what I tested, debug info is included with the llvm backend too. I can attach gdb to a programm, set breakpoints etc. |
But there is no debug information about the original Java code, e.g., the file path, line numbers etc. |
//EDIT
Yes, the original source code files is just put into a "sources" folder. But this is also true for non llvm-backend. But line numbers and file path, method names etc. are saved. e.g. I can run "break de/berstanio/x/x.java:50" and it works without the "sources" folder or any other source files. And why should we need the original source code included anyway? We would see the source code over e.g. Android Studio. And in GDB the original source code is just used to print the source code line afaik. |
Are you sure this works for LLVM backend? |
Yes but it only works partially as I know found out. What I missed on my testing was that I just tested to set the breakpoint on the first instruction on the method which is working on the llvm backend (I later thought that the other breakpoints weren't working were just a bug). But the other debug infos are gathered over the "sourceMapping" field in the CompilationResult class. And here only the standard "CompilationsResultBuilder" puts in informations, currently not the llvm backend. Therefor setting the breakpoint on the first instruction of the method works, on other places sadly currently not. |
Are you able to set breakpoint based on the file and line number? |
Yes, but only for the first line of a method. |
|
In case you haven't seen it already: |
It seems that the llvm debugging is pushed forward by oracle/graal#4964 |
Seems graal native-image team is working on something like that themselves now: oracle/graal#5648 |
Currently Native-Image can generate debugging information that can be used by GDB:
https://www.graalvm.org/reference-manual/native-image/DebugInfo/
And some common debugging features are supported, including:
If we could create a translator between GDB and JDWP, then we could be able to use a java debugger to debug a native-image executable.
The text was updated successfully, but these errors were encountered: