如何调试Delphi中的DLL文件 [英] How to debug a DLL file in Delphi

查看:172
本文介绍了如何调试Delphi中的DLL文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一名从事Visual C ++的开发人员,但在我的项目中有一些 Delphi 组件。我需要调试Delphi组件来解决一些问题。

I am a developer working on Visual C++, but in my project there are some Delphi components. I need to debug the Delphi components to fix some issues.

在调试中生成DLL文件,然后在Delphi中开始调试是必须的? / p>

What are the things that are a must to generate a DLL file in debug and then start debugging in Delphi?

推荐答案

在Delphi 7中,您将执行此操作:

In Delphi 7 you would do this:

选项|编译器|调试|调试信息(检查)

Project | Options | Compiler | Debugging | Debug information (check)

然后转到Run |参数|主机应用程序并输入您的exe名称。

Then go to Run | Parameters | Host Application and enter the name of your exe.

在您的DLL代码中添加一些断点,然后单击运行。您的exe将被加载,您可以调试Delphi IDE中的DLL部件。

Add some breakpoints in your DLL code and then click run. Your exe will be loaded and you can debug the DLL parts in the Delphi IDE.

如果您的exe已经在运行,请单击Run |附加到进程

If your exe is already running, click Run | Attach to process

- 我已经测试了这一点,发现我还需要在Delphi 7中的项目选项的链接器页面上查看包括远程调试符号 。

-- I've tested this and found that I also needed to check the "Include remote debug symbols" on the Linker page of project options in Delphi 7.

我能够使用Run |参数以及Run |附加到处理方法。我创建的测试DLL具有单个stdcall函数,并由Visual C ++控制台应用程序动态加载。

I was able to get a breakpoint to hit using the Run | Parameters as well as Run | Attach to process methods. The test DLL I had created had a single stdcall function and was dynamically loaded by a Visual C++ console application.

这篇关于如何调试Delphi中的DLL文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆