如何在Visual Studio 2012中查看断言失败的C ++堆栈跟踪? [英] How to see C++ stack trace for assert failure in Visual Studio 2012?

查看:115
本文介绍了如何在Visual Studio 2012中查看断言失败的C ++堆栈跟踪?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio 2012中断言失败时,如何查看堆栈跟踪?如果将我附加到某个进程,则该进程将按预期工作,但是当我仅使用F5(调试)进行构建时,会发生我的断言,并显示中止,重试,忽略"提示,但在该进程中看不到我的调用堆栈.调试器.

How can I see the stacktrace when my assert fails in visual studio 2012? If I am attahed to a process, it works as expected, but when I just build using F5 (debug), my assert happens, giving me the "Abort, Retry, Ignore" prompt, but I don't see my callstack in the debugger.

在调试构建过程中是否有任何方法可以启用它,还是我总是必须先构建然后附加到该过程中?

Is there any way to enable it during debug builds, or will I always have to build and then attach to the process?

我的assert只是一个简单的assert(1 == 2),可以使其失效并查看调用堆栈.

My assert is just a simple assert(1 == 2) to get it to fail and see the callstack.

推荐答案

(从评论重新发布)

按下Retry按钮将激活调试器,使您可以查看调用堆栈,本地变量等.

Pressing the Retry button will activate the debugger, allowing you to see your callstack, locals, etc.

这篇关于如何在Visual Studio 2012中查看断言失败的C ++堆栈跟踪?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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