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.

Bug 125176 - Can't step through JNI C++ code
Summary: Can't step through JNI C++ code
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: _ gordonp
URL:
Keywords:
Depends on: 125513
Blocks:
  Show dependency tree
 
Reported: 2008-01-13 20:49 UTC by kitfox
Modified: 2009-06-25 10:59 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Code in which I would like to single step through the C++ part (819.13 KB, text/plain)
2008-01-13 20:51 UTC, kitfox
Details
Projects demonstrating problem (819.13 KB, application/octet-stream)
2008-01-13 21:20 UTC, kitfox
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kitfox 2008-01-13 20:49:37 UTC
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?
Comment 1 kitfox 2008-01-13 20:51:05 UTC
Created attachment 55009 [details]
Code in which I would like to single step through the C++ part
Comment 2 kitfox 2008-01-13 21:20:25 UTC
Created attachment 55011 [details]
Projects demonstrating problem
Comment 3 Alexander Pepin 2008-01-14 14:13:22 UTC
To debug your native library you need "Attach to process" debugger feature that is coming soon. Please keep an eye on
NetBeans updates.  
Comment 4 kitfox 2008-01-14 21:31:35 UTC
Any idea when it will be added?  What's the best place to watch to learn about the update?
Comment 5 _ gordonp 2008-01-14 22:23:05 UTC
> 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.
Comment 6 _ gordonp 2008-01-14 22:24:31 UTC
Closing as fixed (attach is checked into the trunk).
Comment 7 kitfox 2008-02-03 04:58:41 UTC
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?
Comment 8 _ gordonp 2008-03-14 16:58:35 UTC
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.
Comment 9 kitfox 2008-03-15 00:56:40 UTC
Next release?  Meaning 7.0?  When is that scheduled?
Comment 10 _ gordonp 2008-03-17 16:49:34 UTC
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.
Comment 11 _ gordonp 2008-05-12 11:05:03 UTC
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.
Comment 12 Quality Engineering 2008-08-09 03:44:26 UTC
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).
Comment 13 _ gordonp 2008-08-12 14:50:53 UTC
I'm reassigning back to myself. I'm mostly done adding support for attaching to
dynamic libraries and consider this part of that task.
Comment 14 Leonid Lenyashin 2008-08-12 15:08:19 UTC
Ok, thank you.