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 87677

Summary: Need to debug dynamic JNI libraries with Java
Product: cnd Reporter: _ gordonp <gordonp>
Component: DebuggerAssignee: _ gordonp <gordonp>
Status: RESOLVED FIXED    
Severity: blocker CC: dlipin
Priority: P2    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on: 125513    
Bug Blocks:    

Description _ gordonp 2006-10-20 18:12:24 UTC
> Question with no answer. Maybe it is impossible, maybe I just don`t know
> to deal with it... I want to debug *dynamic* C++ library when it using
> by java application`s native methods. It is possible?

I don't know that any code changes will be required for this. What I think
we should do is to do some mixed C/C++ and Java debugging (including a JNI
shared library) to see how well this works. I attended a talk at JavaONE
presented by an Eclipse user who did the equivalent of concurrent Java and gdb
sessions to debug his JNI application. There are "gotchas" in doing this as
the gdb session is really debugging the JVM the Java session is talking to.

So what I'd realy like to see here, is a white paper we could publish about
how to debug a JNI application and what pitfalls the user is likely to see
and how to work around them.

I almost assigned this to myself as I think it would be a very interesting
project. However, since Nik is now the "owner" of gdb-lite I guess I'll let
him have 1st chance. If you (Nik) don't want this then please assign to me
or let me know you're not interested.
Comment 1 Alexander Pepin 2008-05-12 00:16:52 UTC
Are there any current plans to add the ability to "Attach to Process" to
NB6.x?  Or to create a more "integrated" Java<->JNI (C++) debugging
experience?

I'd love...  And I mean...  LOVE... the ability to debug a Java
application's JNI methods easily from Netbeans.  Currently, I use Data
Display Debugger to attach to the running Java application so I can
debug the JNI code, which is cumbersome.
-- Dustin McCartney Chief Technology Officer DAM Entertainment LLC http://www.damentertainment.com
Comment 2 _ gordonp 2008-05-12 10:19:01 UTC
Making this depend on 125513, since debugging JNI is really just a subset of debugging
shared libraries. Most likely doing this will resolve the JNI issue. But I'll leave it
open in case its not completely resolved by this issue.
Comment 3 Quality Engineering 2008-08-09 03:45:06 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).