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

查看:310
本文介绍了如何在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天全站免登陆