C ++找出调试器是否连接 [英] C++ figure out if the debugger is attached

查看:113
本文介绍了C ++找出调试器是否连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用stackwalk64在visual studio 2008中使用最新的symchk.exe和dbghlp.dll为C ++生成堆栈跟踪。这工作正常,当我运行独立的exe。但是,当调试器附加我死锁visual studio。我以前有一个解决方法,我下载所有的system32符号到磁盘,这工作很好,但最近的更新似乎已经打破了我的解决方法,即使我更新了符号。理想情况下,我想确定是否连接可视工作室调试器(它将只有VS调试器),所以我可以关闭我的堆栈跟踪在这种情况下。感谢任何帮助。

I use stackwalk64 to generate stacktraces for C++ in visual studio 2008 using the latest symchk.exe and dbghlp.dll. This works fine when I'm running the standalone exe. However, when the debugger is attached I deadlock visual studio. I previously had a workaround where I downloaded all of the system32 symbols to disk and this worked well, but a recent update seems to have broken my workaround even though I updated the symbols. Ideally I would like to determine if the visual studio debugger is attached (it will only ever be the VS debugger) so I can turn off my stack traces in that case. Thanks for any help.

推荐答案

使用 IsDebuggerPresent 以及 CheckRemoteDebuggerPresent

这篇关于C ++找出调试器是否连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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