11 messages in net.java.dev.jna.usersRE: [jna-users] Debugging native code...
FromSent OnAttachments
Stas OskinJul 30, 2008 2:50 am 
Jiang (EXT), HongyiJul 30, 2008 3:13 am 
andrea antonelloJul 30, 2008 3:23 am 
Filippo CaroneJul 30, 2008 3:27 am 
Jiang (EXT), HongyiJul 30, 2008 3:28 am 
andrea antonelloJul 30, 2008 3:56 am 
Jay WaltersJul 30, 2008 4:49 am 
Jiang (EXT), HongyiJul 30, 2008 5:11 am 
Jay WaltersJul 30, 2008 5:21 am 
Jiang (EXT), HongyiJul 30, 2008 5:33 am 
Stas OskinJul 30, 2008 10:06 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:RE: [jna-users] Debugging native code with JNAActions...
From:Jiang (EXT), Hongyi (x_ji@ugs.com)
Date:Jul 30, 2008 5:33:39 am
List:net.java.dev.jna.users

Hi Jay,

It still doesn't work. VS will close my dll workspace if my java application
stops at the break point. I cannot see any source code of my DLL.

-----Original Message----- From: Jay Walters [mailto:jwal@computer.org] Sent: Mittwoch, 30. Juli 2008 14:22 To: use@jna.dev.java.net Subject: Re: [jna-users] Debugging native code with JNA

You need to make sure you load the debug version of the DLL from your java.library.path (I think thats where java loads the DLL) and you need to make sure you are attached to the right process, your IDE will be javaw but the jvm you launch may be java or javaw.

Jiang (EXT), Hongyi wrote:

Hi Jay,

The method you mentioned doesn't work. When my java program stops to the break
point and I attaché the javaw process to VS. The VS will debug javaw process
instead of my DLL. Additionally, the workspace of my DLL is close. I cannot see
any code from VS.

-----Original Message----- From: Jay Walters [mailto:jwal@computer.org] Sent: Mittwoch, 30. Juli 2008 13:50 To: use@jna.dev.java.net Subject: Re: [jna-users] Debugging native code with JNA

I can't remember if I specifically tried to debug JNA code, but it is easy to debug native code from VS.

The easiest way I found is to put a breakpoint in java (using eclipse or whatever IDE) after the dll is loaded, but before you make the call into the native code. Then while the program is stopped, startup VS and go into debug->attach and find the java process you want to attach to. Once you've attached you can set break points in the native code just as you would expect.

Jiang (EXT), Hongyi wrote:

But I use visual studio to create DLL not CDT. How can eclipse communicate with VS?

-----Original Message----- From: andrea antonello [mailto:andr@gmail.com] Sent: Mittwoch, 30. Juli 2008 12:24 To: use@jna.dev.java.net Subject: Re: [jna-users] Debugging native code with JNA

I debugged java-native-java long time ago (wasn't using jna, but straight jni, but nothing should change). It is possible through eclipse mixed environment setup. It is not easy at the begin, but... here is some doc: http://wiki.eclipse.org/Support_seamless_debugging_between_JDT_and_CDT

Hope this helps. Andrea

On Wed, Jul 30, 2008 at 12:13 PM, Jiang (EXT), Hongyi <x_ji@ugs.com> wrote:

I also want to know the solution.

-----Original Message----- From: Stas Oskin [mailto:stas@gmail.com] Sent: Mittwoch, 30. Juli 2008 11:51 To: use@jna.dev.java.net Subject: [jna-users] Debugging native code with JNA

Hi.

If I've compiled debug version of the shared libraries, is it

possible

to debug them in step-by-step fashion together with Java code?

I mean, start with Java, jump into c++ sources, and then back to

Java.

If not, what other methods are advised?

Thanks.