Skip to main content
gamedev.net
🔒 Locked

how to debug DLL(DirectX component) in Java

Started by thuong 6 replies 1.4k views
Original Post
thuong
thuong
hi All, i have DLL wrote by C++(DLL about DirectX component), and call it in Java, when i error occur, i can not debug, can anybody help me with how to debug DLL in the java? Thanks
jollyjeffers
jollyjeffers
You most probably can't do what you want without some exotic tools. To my knowledge there aren't any standard/common tools that will do this.

A cross-language IDE (e.g. Eclipse/VStudio) might be able to handle debugging projects with multi-language characteristics, but it'd probably need the source code for the DLL as well.

Are you sure that the DLL is at fault? What sort of information do you need? you might be able to get the DLL to write a log file as its executing if you have the source code.

hth
Jack
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ |
circlesoft
circlesoft
Quote:
Original post by jollyjeffers
You most probably can't do what you want without some exotic tools. To my knowledge there aren't any standard/common tools that will do this.

Unfortunately, I think you are correct. However, perhaps a trip over to the Java forum may prove to be productive.

If you can't find anything, I recommend that you test your DLL in a pure C/C++ environment, where you can actually debug the thing. Then you can procede to integrate it with Java. Hopefully, you can find some kind of debugger though [smile]
S1CA
S1CA
1. DebugView from www.sysinternals.com will allow you to view error messages from the debug DirectX runtimes and from any OutputDebugString() calls in the DLL. This might be enough to fix specific errors with calls to DirectX functions.


2. For Direct3D errors, if you enable "Break on D3D error" for the debug D3D runtime (in the DirectX control panel), then you'll get a breakpoint in the Direct3D DLL at the point where the error occurred; from there you should be able to look at the callstack to see where the error came from.


3. Assuming you have the source code to the DLL (you didn't say) and you're using MSVC to build the DLL (you didn't say):

a) Load the project workspace/solution the DLL was created from into MSVC

b) Place breakpoints on each of the exported entry points of the DLL

c) Run your java code

d) Attach the MSVC debugger to the java runtime

e) AFAIK, as long as the PDB files are up to date etc, the breakpoints should fire whenever your Java code calls the DLL
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site
thuong
thuong
ok, thanks
thuong
thuong
ok, thanks
thuong
thuong
ok, thanks
circlesoft
circlesoft
Quote:
Original post by S1CA
...

That is really cool. I didn't know that you could just attach to an external process like that, and it would still pick up the breakpoints [smile]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.