Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging JVM crashes under Windows

I wrote a piece of software in Java that communicates with USB hardware by using a DLL provided by the hardware vendor. I used the Java Native Access library to write the wrappers to native code. Sometimes when I am running it, only on native code related functions, JVM crashes and I cannot find what caused the bug because it happens in native code, to which I do not have the source code (MSVCRT71.DLL).

I am most of the time a Linux developer, so I'm not used to this situation. What can I do to attach a debugger from outside (say, Visual C++) to the JVM process and get something meaningful (that is, not Assembly instructions) from it?

like image 952
jfsantos Avatar asked Dec 20 '25 08:12

jfsantos


1 Answers

MSVCRT71.DLL is the dll for the c-runtime libraries included in Visual Studio 7.1.

Install Visual Studio 7.1, which has the crt source. Goto Debug->processes, find the java instance you are running, then click "attach".

If you can't get your hands on VS7, try this

[http://www.microsoft.com/whdc/DevTools/Debugging/default.mspx][1]

make sure you get the symbols for that version of the crt

like image 66
KenE Avatar answered Dec 23 '25 00:12

KenE



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!