首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何跟踪导致应用程序挂起的代码

问如何跟踪导致应用程序挂起的代码
EN

Stack Overflow用户
提问于 2013-12-12 19:34:38
回答 1查看 184关注 0票数 1

我正在维护一个MFC应用程序,在某些情况下,它会停止响应30秒,有时1分钟或更长时间。我应该解决这个问题,我尝试跟踪这个类中的codeall方法,但问题仍然存在,我试图在此期间暂停调试,但我没有得到如图所示的任何信息

​

​

我想知道如何跟踪导致应用程序停止响应的代码

EN

回答 1

Stack Overflow用户

发布于 2013-12-13 20:55:36

  1. 为任何单独的线程事件

添加监视变量

代码语言:javascript
复制
- increment each watch variable inside its thread
- also very useful can be flag if the thread/event is executing (especially for events)
- you must set this flag on enter
- end clear before exit

​

  1. 以某种方式可视化监视变量。

代码语言:javascript
复制
- either use some debug print inside your App.
- or use separate Window
- or even better separate App connected with any IPC method. (this will work even if your App UI hangs)

​

当应用程序挂起时,只需查看哪些变量在递增,哪些没有递增

有了旗帜,你就可以确定你身上挂了什么…

祝你在调试时好运。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20542393

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档