Thursday, August 2, 2007

project status, first version of plug-in to improve the Java/JNI applications debugging to download

Since my previous post (already tree weeks) I am working hard to have some results. The problem with the breakpoints automatically added is now resolved, and the support to step from C native code to Java code implemented. This support was not so easy to add as I first thinked. Before more explanation, to not lost courageous reader of this post, I think its necessary to remind the solution I choose to step from java code into C/C++ native code.

I decided to automaticaly add a breakpoint on the first line of each native method susceptible to be called by java code. When the user selects the debug action on a native method in Java code, the plug-in stores this action. Then the C/C++ debugger reaches the breakpoint. If the last action was stepping over or return, the plug-in does a step return otherwise it does nothing.

This approach was not a good option in my point of view to follow call of Java methods from C/C++ code due to the high number of java classes (and so methods) generally present in a project. More over breakpoints are not really required, the JDT debugger will stop itself when we reach java code. The problem was to know in which case we are : Did the current C/C++ function call a java method or is the C/C++ function already terminated ?

The solution I chose is to rely on the line number of the ending line of a native function. When it is reached , the plug-in supposes that we are no more stepping in native code. I don't know if it is the best solution. Another option is to rely on the line number of the java native call.

You can install the plug-in by adding the following remote site to the Eclipse update manager : http://eclipse-incub.svn.sourceforge.net/viewvc/*checkout*/eclipse-incub/jni_seamless_debugging/update-site/site.xml

To reports bugs/enhancement there is a "org.eclipse.soc.jni" component in SOC (which is in Technology category)

To use the plugin please refer to previous posts. I will add documentation on the wiki page as soon as possible.

problems known

  • sometimes gdb does not success to attach to the pid. I don't know why. Not regular and seems to be a gdb bug or limitation.
  • the java files not directly in the the project do not display (see bug #198804)

5 comments:

Anonymous said...

Hi
I am a newbie in developing eclipse plugin's..:)!
Can you please tell me how can we add breakpoints through the outline view programmatically?
I have an XML editor whose outline is shown on the outline view and I want to add breakpoints through its content outline.
I am able to add a popup menu on the outline i.e Toggle Breakpoint. but it is not working.
Please Help!!!

Regards
Parul Seth

Mariot Chauvin said...

Hi Parul,

If you have a general question about the eclipse platform ask it on the platform newsgroup.

Regards,

Mariot

Vishwajeet said...

Hi,

I want to download this debugging plugin but it seems that link provided on this page is broken,could you please fix it or please suggest some site from where i can download this plug-in.

Thanks in advance

Mariot Chauvin said...

Hi Vishwajeet,

You can use the following update site :
https://eclipse-incub.svn.sourceforge.net/svnroot/eclipse-incub/org.eclipse.soc.jni/update-site/site.xml which should work.

The must up-to-date links are on :

http://wiki.eclipse.org/index.php/Support_seamless_debugging_between_JDT_and_CDT

Regards,

Mariot

Vishwajeet said...

Hi Mariot,

yaap,it worked perfectly this time, thanks a lot