Discussion:
Visual Studio crashed with using java.exe to load DLL
(too old to reply)
George
2007-08-14 06:40:02 UTC
Permalink
Hello everyone,


I am using Visual Studio 2003. I am writing a JNI program, and upper layer
is Java code and lower layer is C code (DLL). The Java code is utilizing C
code by JNI.

To debug the C code, in the C DLL Project Properties dialog, I assign
Debugging Command to java, then set Command argument to,

-classpath "C:\Program Files\Java\jdk1.5.0_06" HelloWorld,

when when debugging from Visual Studio, Visual Studio will crash. Do you
know anything wrong with the settings?

I have also tried to run manually from command line,

java -classpath "C:\Program Files\Java\jdk1.5.0_06" HelloWorld

and the result is correct.


regards,
George
Free
2007-11-11 00:04:30 UTC
Permalink
i would go by hardcoding a breakpoint in the code
__asm int 3
on the line u want to break on

hope this helps
Johnny
Post by George
Hello everyone,
I am using Visual Studio 2003. I am writing a JNI program, and upper layer
is Java code and lower layer is C code (DLL). The Java code is utilizing C
code by JNI.
To debug the C code, in the C DLL Project Properties dialog, I assign
Debugging Command to java, then set Command argument to,
-classpath "C:\Program Files\Java\jdk1.5.0_06" HelloWorld,
when when debugging from Visual Studio, Visual Studio will crash. Do you
know anything wrong with the settings?
I have also tried to run manually from command line,
java -classpath "C:\Program Files\Java\jdk1.5.0_06" HelloWorld
and the result is correct.
regards,
George
George
2007-11-11 11:43:00 UTC
Permalink
Thanks Free,


The issue for me now is when it is broken, it does not jump to the java.exe
(using Eclipse IDE) to begins to debug my code in Eclipse. This is what makes
me confused.


regards,
George
Post by Free
i would go by hardcoding a breakpoint in the code
__asm int 3
on the line u want to break on
hope this helps
Johnny
Post by George
Hello everyone,
I am using Visual Studio 2003. I am writing a JNI program, and upper layer
is Java code and lower layer is C code (DLL). The Java code is utilizing C
code by JNI.
To debug the C code, in the C DLL Project Properties dialog, I assign
Debugging Command to java, then set Command argument to,
-classpath "C:\Program Files\Java\jdk1.5.0_06" HelloWorld,
when when debugging from Visual Studio, Visual Studio will crash. Do you
know anything wrong with the settings?
I have also tried to run manually from command line,
java -classpath "C:\Program Files\Java\jdk1.5.0_06" HelloWorld
and the result is correct.
regards,
George
Free
2007-11-11 13:21:03 UTC
Permalink
Debug as u always do your java code, but when the C code will break, attach
the visual studio, so practically you'll have two debuggers as the same
time, Ecplipse for Java, and VS for C

Hope it is clear now
Post by George
Thanks Free,
The issue for me now is when it is broken, it does not jump to the java.exe
(using Eclipse IDE) to begins to debug my code in Eclipse. This is what makes
me confused.
regards,
George
Post by Free
i would go by hardcoding a breakpoint in the code
__asm int 3
on the line u want to break on
hope this helps
Johnny
Post by George
Hello everyone,
I am using Visual Studio 2003. I am writing a JNI program, and upper layer
is Java code and lower layer is C code (DLL). The Java code is utilizing C
code by JNI.
To debug the C code, in the C DLL Project Properties dialog, I assign
Debugging Command to java, then set Command argument to,
-classpath "C:\Program Files\Java\jdk1.5.0_06" HelloWorld,
when when debugging from Visual Studio, Visual Studio will crash. Do you
know anything wrong with the settings?
I have also tried to run manually from command line,
java -classpath "C:\Program Files\Java\jdk1.5.0_06" HelloWorld
and the result is correct.
regards,
George
George
2007-11-12 09:21:01 UTC
Permalink
Thanks Free,


There are two ways to debug in the hybrid environment, I want to confirm
with you which one do you mean,

1. Start debug from Visual Studio 2005 (by pressing F5) and set the debug
process to be java.exe (Eclipse);

2. Start debug from Eclipse and in Visual Studio 2005, select attach to
process to attach the native DLL code to Eclipse process (java.exe).

Which one do you mean?


regards,
George
Post by Free
Debug as u always do your java code, but when the C code will break, attach
the visual studio, so practically you'll have two debuggers as the same
time, Ecplipse for Java, and VS for C
Hope it is clear now
Post by George
Thanks Free,
The issue for me now is when it is broken, it does not jump to the java.exe
(using Eclipse IDE) to begins to debug my code in Eclipse. This is what makes
me confused.
regards,
George
Post by Free
i would go by hardcoding a breakpoint in the code
__asm int 3
on the line u want to break on
hope this helps
Johnny
Post by George
Hello everyone,
I am using Visual Studio 2003. I am writing a JNI program, and upper layer
is Java code and lower layer is C code (DLL). The Java code is utilizing C
code by JNI.
To debug the C code, in the C DLL Project Properties dialog, I assign
Debugging Command to java, then set Command argument to,
-classpath "C:\Program Files\Java\jdk1.5.0_06" HelloWorld,
when when debugging from Visual Studio, Visual Studio will crash. Do you
know anything wrong with the settings?
I have also tried to run manually from command line,
java -classpath "C:\Program Files\Java\jdk1.5.0_06" HelloWorld
and the result is correct.
regards,
George
Loading...