Debugging JNI and Java Code Together

By Christopher Elford (Intel) (2 posts) on August 21, 2007 at 6:30 am

The other day, I was reading the progress that Mariot Chauvin on his Google Summer of Code project . Mariot is creating a plug-in on sourceforge  to facilitate debugging both Java language code and any JNI (native) code that it interacts with. Mariot uses two debug perspectives (gdb/CDT and JDT) and then applies some heuristics to allow stepping back and forth between languages and enabling to GUI to seamlessly toggle between the perspectives. I must say that I am pretty impressed at how far Mariot has gotten and look forward to seeing the end result of his project. Some interesting challenges remain though. For example, if one is stopped at a native frame, can one examine java stack frame and variables (and vise-versa)?

At EclipseCon 2007 , we presented another approach for pursuing Java/JNI debugging. Mariot mentions this presentation in the related work part of his blog (thanks Mariot :-). In our model, we enable seamless examination of the Java and native frames by extending the Apache Harmony VM  with a JVMTI extension that orchestrates the breakpoints, memory examination, etc. of native code. Consequently, there is never a time where the JVM is "blocked" preventing it from responding to JNI and JVMTI calls... Hmmm... well, almost never... well, probably rarely... okay, we may need some more testing and users to know for sure whether how often this is true...

Hopefully some of the Intel engineers who know the most about the guts of the prototype that we demonstrated at EclipseCon will be able to talk more with the community both here and on Mariot's blog about the different models for mixed Java/JNI debugging. I think that both approaches have something interesting to bring to the table. Perhaps something great can evolve from the discussion!

Categories: Software Engineering, What If Software

Comments (1) Comments RSS Feed

By Intel® Software Network Blogs » Blog Archive » Integrated Debugger for Java*/JNI Environments prototype on What If Site on September 17th, 2007 at 10:07 am
[...] is the prototype for Mixed Java/native debugging that we discussed at EclipseCon '07.    See my earlier blog entry talking about it and how it relates to some other work in this area.    I'm sure I'll blather on [...]


What do you think?

Name (required)

Email (required; will not be displayed on this page)

Your URL (optional)

Comments (required)