在 Windows 7 的 VS 中取消引用 null
我注意到,当我运行 Windows XP 时,如果我的代码取消引用 null,我会在调试中崩溃,然后我可以轻松识别错误来自何处。看起来在 Windows 7(我运行的是 64 位)中,代码不会崩溃或创建任何类型的通知,而是简单地中断当前迭代并开始新的迭代。这对我来说非常令人沮丧,因为当发生这种情况时,调试所需的时间比以前要长得多。有其他使用 Windows 7 的人注意到这一点吗?
I have noticed that when I was running Windows XP, if my code dereferenced null I would get a crash in debug and I could then easily identify where the bug was coming from. It seems that in Windows 7 (I'm running 64-bit), instead of crashing or creating any sort of notification, the code will simply break its current iteration and start a new one. This has been very frustrating for me, as when this happens it takes much longer to debug than it used to. Has anyone else with Windows 7 noticed this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
访问冲突异常可能被程序中更高层的东西捕获。如果您使用的是 MSVC,请在“调试”菜单下查看“异常...”并确保选中“访问冲突”(以告诉调试器在引发异常时给您第一次机会中断) ,在它渗透到通常的异常处理程序之前)。
The access violation exception is probably being caught by something higher up in the program. If you're using MSVC, under your "debug" menu, look at "Exceptions..." and make sure that "Access violation" is checked (to tell the debugger to give you a first-chance break when the exception is thrown, before it gets percolated up to the usual exception handlers).