Friday, May 11, 2007

An approach I want to try

After I had read the presentation from presenting a way to debug JNI application in Eclipse (see last post for the link), I think that an approach to provide Seamless debugging between JDT and CDT could be the following :
  • Step 0 : the user sets its breakpoints in Java Code and in C code
  • Step 1 : we launch app for remote java code debugging
  • Step 2 : we attach gdb to the application's Java VM with process ID and resume ("release" the JVM) and set " C user breakpoints"
  • Step 3 : we set "default breakpoints" in C/C++ code on each native method called by java code
  • Step 4: we attach jdb
  • Step 5: ready to go !
  • Step 6 : Java breakpoint is hit first. The user steps over until the native call :
- he decides to step into : The default breakpoint is hit in gdb. The user then decides what to do
- he decides to step over : The default breakpoint is hit, but CDI sends a "continue" to the debugger

To proof that is a possible way, I currently a writing a prototype plugin, based on JDT and CDT plugins, which (at this time) uses the following extension :

  • org.eclipse.debug.core.lauchConfigurationTypes
  • org.eclipse.debug.ui.lauchConfigurationTabGroups
  • org.eclipse.debug.ui.lauchConfigurationTypeImages

The main difficulty seems to be the retrieval of the JVM process ID, but I got (Thanks to Mattew) this useful link http://net3x.blogspot.com/2007/03/how-java-application-can-discover-its.html with differents ways to get the PID.

Feel free to comment this approach.

Sunday, May 6, 2007

Follow the white rabbit..

I begin my summer of code by getting in touch with Eclipse community and other gsoc students working on Eclipse projet. During these first weeks I read documentation on the Eclipse framework and some tutorials. I sent an email to CDT-dev mailing list to announce the project and to get feedback and some pointers. Thanks to a response I found an interesting presentation from Intel's guys, who propose a new debug interface for mixed applications, XDI (eXtensible Debug Interface), in remplacement of the current JDI (Java Debug Interface). In the document they present several approaches to provide mixed mode debugging in Eclipse with advantages and problems for each approach. However XDI is not yet standardized and requires an XDI agent implementation in the JRE.
My mentor gave me too some links on existing work. One presentation explains how to debug JNI application currently with Eclipse. It's not so easy but it's possible. As I see currently see it, my job will consist in automating that so that becomes seamless and more powerfull.
I hope to succeed, it will be really nice to have this feature in Eclipse.