如何调试和检测挂起问题

发布于 2024-10-17 19:50:10 字数 473 浏览 3 评论 0原文

我正在测试我的应用程序(Windows 7、WinForms、Infragistics 控件、C#、.Net 3.5)。 我有两个显示器,我的应用程序保存和恢复表单在第一个或第二个显示器上的位置。因此,我物理上关闭了第二个显示器,并在 Windows 显示设置表单上的“屏幕分辨率”处禁用了它。我需要知道我的应用程序是否可以将窗口位置(对于保存在第二个监视器上的窗口)恢复到第一个监视器。

我关闭了第二台显示器并按“检测”以应用硬件更改。

在此处输入图像描述

然后 Windows 关闭第一台显示器几秒钟以应用新设置。当第一个监视器屏幕返回时,我的应用程序变得没有响应。我的应用程序是在调试模式下启动的,因此我尝试通过堆栈和线程(Visual Studio 2008)进行导航,暂停应用程序,启动,但没有找到任何可以帮助我理解应用程序不响应的原因。有人可以帮助我如何检测问题的根源。

I am testing my application (Windows 7, WinForms, Infragistics controls, C#, .Net 3.5).
I have two monitors and my application saves and restores forms' position on the first or second monitors. So I physically switched off second monitor and disabled it at Screen Resolution on the windows display settings form. I need to know it is possible for my application to restore windows positions (for those windows that were saved on the second monitor) to the first one.

I switched off second monitor and press Detect to apply hardware changes.

enter image description here

Then Windows switched OFF the first monitor for a few seconds to apply new settings. When the first monitor screen came back, my application became unresponsive. My application was launched in debug mode, so I tried to navigate via stack and threads (Visual Studio 2008), paused application, started and did not find any thing that help me to understand why my application is not responsive. Could somebody help my how to detect the source of issue.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

玻璃人 2024-10-24 19:50:10

下载Windows 调试工具,然后运行 ​​adplus挂起模式。在 windbg 中打开生成的 .dmp 文件并调用:

!analyze -v -hang

Download the Debugging Tools For Windows then run adplus in hang mode. The with the resulting .dmp file open in windbg and invoke:

!analyze -v -hang
俏︾媚 2024-10-24 19:50:10

您应该提供有关您在调用堆栈和线程窗口中看到的内容的更多信息。哪些线程正在运行?您是否看到任何在睡眠中等待或加入的东西?您是否尝试过命名线程,以便更清楚地了解暂停时发生的情况(尽管没有必要,因为无论如何您都可以从调用堆栈中获取此信息......这是一件方便的事情)。

You should provide more information about what you saw in the call stack and threads windows. Which threads were running? Did you see anything that was waiting in a sleep or join? Have you tried naming your threads so that it's clearer as to what's going on when you pause (though not necessary since you can get this info from the call stack anyway... it's a convenience thing).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文