This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I have three projects that are used together. One is a JInkTest is a java application, JInk is a library with native methods, and JInkJNI implements the native code in C++. JInkJNI is crashing right now, and I'd like to be able to single step through it with the debugger. I can use the debugger on standalone C++ projects fine. There just seems to be a problem when I launch JInkTest and JInkJNI gets invoked indirectly. Can I single step through my JNI code? Is this a configuration issue?
Created attachment 55009 [details] Code in which I would like to single step through the C++ part
Created attachment 55011 [details] Projects demonstrating problem
To debug your native library you need "Attach to process" debugger feature that is coming soon. Please keep an eye on NetBeans updates.
Any idea when it will be added? What's the best place to watch to learn about the update?
> Any idea when it will be added? The attach code has been checked into the trunk. I don't recommend using it as other changes have destabilized the trunk version of the module (ie, it contains work-in-progress). The gdb module should be stabilized by NB 6.1 milestone 1. The first released support will be a gdb module patch for NB 6.0. The first full release will be in NB 6.1.
Closing as fixed (attach is checked into the trunk).
I've downloaded milestone 1, but am still unable to debug my JNI code. I've started a debugging session normally, halted at a break point, and then selected Run/Attach Debugger from the menu. I've then attached a gdb debugger to the one process listed in the dialog box. When I then single step through the code, I am unable to enter my native methods, nor do the breakpoints I set in my C++ halt the debugger. What do I need to do to step through my native code?
Currently (in NB 6.1) you can only attach an application. What you need to do to debug JNI is to attach the JVM process but the dynamic library your JNI code is linked into. This feature is planned for the next NetBeans release.
Next release? Meaning 7.0? When is that scheduled?
The next release is TBD. If its 7.0 it will probably be a while. There are rumors that a dot release will happen before then. So its really too soon to say what and when the next release is. The enhancement itself will probably get done in the next few months. However, until there is an actual release it will only be available in nightly or private builds.
Marking this issue as depending on 125513. Once you can attach to dynamic libraries, you should be able to step through JNI code. However, I won't close this as a duplicate because I'll need to verify that. This is tentatively scheduled for NB 6.5. We're in planning meetings for 6.5 this week and it seems very unlikely to be passed over for this release.
Integrated into 'main-golden', available in build *200808090201* on http://bits.netbeans.org/dev/nightly/ Changeset: http://hg.netbeans.org/main/rev/131629edf547 User: Gordon Prieur <gordonp@netbeans.org> Log: Attach to dynamic libraries (IZs #87677, #125513, #135721 and #125176). Preliminary work making it work on Solaris (although not heavily tested).
I'm reassigning back to myself. I'm mostly done adding support for attaching to dynamic libraries and consider this part of that task.
Ok, thank you.
Fixed with the following changesets: http://hg.netbeans.org/main?cmd=changeset;node=131629edf547 http://hg.netbeans.org/main?cmd=changeset;node=4d610e09b65a http://hg.netbeans.org/main?cmd=changeset;node=2ccce30e80f6 http://hg.netbeans.org/main?cmd=changeset;node=b3d8ead9f5b2 http://hg.netbeans.org/main?cmd=changeset;node=d99fd787cfcc http://hg.netbeans.org/main?cmd=changeset;node=0ab5bbdcf7ed