如何在Delphi中调试从Java调用的DLL?

发布于 2024-08-10 08:26:26 字数 221 浏览 4 评论 0原文

我使用 Delphi 编写了一个 DLL,可以通过 JNA (Java Native Access) 从 Java 调用该 DLL。这个DLL中的方法只是简单的操作,但为了将来的使用和更复杂的调用,我想知道如果直接从Java(或从Java IDE)调用DLL,如何使用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).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

童话里做英雄 2024-08-17 08:26:26

我相信这个问题的答案与 Stack Overflow 问题的答案相同如何在Delphi中调试DLL文件

事实上,由于您在Delphi环境中调试Delphi的DLL文件,因此谁位于调用堆栈的较高层并不重要。

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.

清晰传感 2024-08-17 08:26:26

如果我定义主机应用程序(Java)并设置正确的参数,它就可以工作:

  • 主机应用程序:C:\ Programme \ Java \ jdk1.6.0_14 \ jre \ bin \ java.exe
  • 参数:-cp“/path/to/test .jar" junit.textui.TestRunner AppTest

JUnit 文本 TestRunner 命令行参数解释如下:
http://junit.sourceforge.net/junit3.8.1/ javadoc/junit/textui/TestRunner.html

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

滿滿的愛 2024-08-17 08:26:26

为什么不先在Delphi中调试DLL呢? Delphi 有一个名为 DUnit 的单元测试框架。您仍然需要为整个系统编写集成测试,但您可以在 JUnit 单元测试中模拟外部依赖项。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文