mjn
mjn

Reputation: 36644

How to debug a DLL called from Java in Delphi?

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).

Upvotes: 4

Views: 1127

Answers (3)

Tzury Bar Yochay
Tzury Bar Yochay

Reputation: 9004

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.

Upvotes: 4

mjn
mjn

Reputation: 36644

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

Upvotes: 0

TrueWill
TrueWill

Reputation: 25523

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.

Upvotes: -2

Related Questions