How to debug a DLL called Java in Delphi?

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

+4
source share
3 answers

I believe the answer to this question will be the same as for the stack overflow Debugging a DLL file in Delphi .

In fact, since you are debugging a Delphi DLL file in a Delphi environment, it does not matter who is on the top call stack.

+4
source

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

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

The following are the testrunner command line arguments in JUnit: http://junit.sourceforge.net/junit3.8.1/javadoc/junit/textui/TestRunner.html

0
source

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

-2
source

All Articles