调试器忽略动态加载的DLL中的错误 [英] Debugger ignores errors in dynamically loaded DLLs

查看:186
本文介绍了调试器忽略动态加载的DLL中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常奇怪的问题,与自编码DLL的调试相关。我有一个MFC驱动的基于对话框的应用程序,几个项目静态链接和几个DLL项目,在运行时加载。

I have a very strange problem related to debugging of self-coded DLLs. I have an MFC-driven dialog-based application, several projects linked statically and several DLL-projects which are loaded at runtime.

我在调试中构建解决方案,运行应用程序我可以轻松地调试这些DLL项目。现在的问题。如果DLL中有一些明显的运行时错误,如下所示:

I build solution in debug, run the application and I can easily debug those DLL-projects. Now the problem. If there is some obvious runtime error in DLL like following

int* i = 0;
*i = 4;

调试器无错误,抛出异常并静默返回到空闲状态,甚至没有(可见)堆栈回报。看起来当我在语句 * i = 4; 上击中F10时,控件返回到主应用程序窗口,程序执行继续,没有发生!如果代码中没有错误,它会执行正常。但是我希望在这种情况下会出现错误!而且它们在主应用程序的代码中。

debugger asserts no error, throws no exception and silently returns to idle state with even no (visible) stack returns. It looks like when I'm hitting F10 on the statement *i = 4;, the control returns to main application window and program execution continues as nothing happened! And if there are no errors in the code, it executes fine. But I expect errors to be asserted in this case! And they are - in the main application's code.

我使用LoadLibrary()函数将我的DLL加载到应用程序中。 DLL本身有MFC静态链接,与解决方案中的每个其他项目一样。

I use LoadLibrary() function to load my DLL into application. DLL itself has MFC statically linked, same as every other project in solution has.

任何想法?甚至不知道什么问题到谷歌...

Any ideas? Don't even know what question to google...

推荐答案

哦,原来,问题是由OpenGL wglMakeCurrent()调用,仅在Windows 7 64位下使用NVIDIA GeForce 8800显卡,同时在Windows Vista 32位下可以正常工作。

Oh, it turned out that problem is caused by OpenGL wglMakeCurrent() call and is experienced only under Windows 7 64-bit with NVIDIA GeForce 8800 graphic card, meanwhile all works fine under Windows Vista 32-bit.

我问新的问题这里。感谢您的反馈。

I asked new question here. Thanks for your feedback.

这篇关于调试器忽略动态加载的DLL中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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