Question

With Delphi I wrote a DLL which can be called from Java via JNA (Java Native Access). Methods in this DLL are just simple operations, but for future use and more complex invocations I would like to know how I can use the Delphi debugger, if the DLL is called from Java directly (or from the Java IDE).

Was it helpful?

Solution

I believe the answer for this question would be the same as for Stack Overflow question How to debug a DLL file in Delphi.

In fact, since you debug the Delphi's DLL file within a Delphi environment, it does not matter who is in the higher of the call stack.

OTHER TIPS

It works if I define the host application (Java) and set the correct arguments:

  • Host Application: C:\Programme\Java\jdk1.6.0_14\jre\bin\java.exe
  • Parameter: -cp "/path/to/test.jar" junit.textui.TestRunner AppTest

The JUnit text TestRunner command line arguments are explained here: http://junit.sourceforge.net/junit3.8.1/javadoc/junit/textui/TestRunner.html

Why not debug the DLL in Delphi first? There's a unit testing framework for Delphi called DUnit. You'll still want to write integration tests for the full system, but you could mock out the external dependency in your JUnit unit tests.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top