调试DLL时出现问题 [英] Problems debugging a DLL

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

问题描述

你好,

VS2008,WEC700,iMX51。

VS2008, WEC700, iMX51.

我正在开发一个QT应用程序和一个C ++ DLL同样的解决方它们都使用调试设置进行编译。

I'm developing a QT application and a C++ DLL in the same solution. Both of them compiled with the debug settings.

VS2008能够部署EXE + DLL,运行EXE并停止放入EXE中的断点。

The VS2008 is able to deploy EXE+DLL, running the EXE and stop on breakpoints put in the EXE.

如果我们在DLL中的函数调用之前停止并按F11输入DLL代码,光标将跳转到EXE中的下一个命令(当我们按F10时)没有任何问题。

If we stop before a function call located in the DLL and press F11 to enter in the DLL code, the cursor jumps in the next command in the EXE (as we press F10) without any problem.

DLL中的断点未激活,如果我们在dll源代码中添加新的断点,则VS会显示消息"与设备的远程连接已丢失。验证设备连接并重新启动  debugging"。调试会话
结束,此消息显示在输出窗口中:

The breakpoints in the DLL are not active and if we add a new breakpoint in the dll source code, the VS shows the message "The remote connection to the device has been lost. Verify the device connection and restart debugging". The debug session ends and this message is shown in the output window:

程序' [0x68108BA] a.exe'已退出,代码为1067(0x42b)。

The program '[0x68108BA] a.exe' has exited with code 1067 (0x42b).

是否有其他方式调试DLL?

Is there other way to debug the DLL?

谢谢!

SteMMo

推荐答案

I当使用与EXE不同的设置编译DLL时,已经看到类似于此的行为,特别是DEBUG vs RETAIL。您可以在同一解决方案中为每个项目单独设置构建类型,如果您尝试,可能会导致此问题。

I've seen behavior similar to this when the DLL was compiled using different settings than the EXE, particularly DEBUG vs RETAIL. You can set the build type separately for each project in the same solution, if you try, possibly causing this.

您也可以尝试在目标位置的DLL中嵌入对DebugBreak()的调用并重新编译。

You might also try embedding a call to DebugBreak() in the DLL at the target location and recompiling.

另一个可能的原因是正在加载的DLL的错误副本。例如,如果您在操作系统映像中有DLL版本的DLL,则该DLL可能已被另一个应用程序加载;你的也会使用它,如果是的话。

Another possible cause is the wrong copy of the DLL being loaded. If, for example, you have a ROM version of the DLL in the OS image, that DLL might already be loaded by another application; yours will use it too, if it is.

Paul T。


这篇关于调试DLL时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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