简体   繁体   English

VS2010调试器处于不确定状态

[英]VS2010 debugger in limbo

I have a large multithreaded C# program in development that loads multiple DLLs from several VS2010 projects/solutions. 我在开发中有一个大型多线程C#程序,它从多个VS2010项目/解决方案中加载多个DLL。 Debugging it proves more difficult than I expected (who'd think). 调试它证明比我预期的更困难(谁想)。

The problem is as follows. 问题如下。 More often than not, after a few step-over and/or break-all operations, the program (or perhaps the debugger) enters into some kind of indeterminate state which is neither running nor stopped. 通常,在几次步进和/或中断操作之后,程序(或者可能是调试器)进入某种既不运行也不停止的不确定状态。 In the Debug menu, both Continue and Break All are grayed out, so I cannot continue to work with the program. Debug菜单中, ContinueBreak All都显示为灰色,因此我无法继续使用该程序。

Sometimes, but not always, when this happens, I see a message in the watch windows that says: 有时候,但并非总是如此,当发生这种情况时,我会在监视窗口看到一条消息:

Function evaluation disabled because a previous function evaluation timed out. 由于先前的功能评估超时,因此功能评估被禁用。

The program doesn't seem to be running (no output, no stopping on breakpoints...) and doesn't appear to be stopped also (the Watch window is grayed out, the Call Stack window is empty). 该程序似乎没有运行(没有输出,没有在断点处停止......)并且似乎也没有停止( Watch窗口显示为灰色, Call Stack窗口为空)。

Stop Debugging and Restart commands are available and working. Stop DebuggingRestart命令可用且有效。

Can I do anything in order to be able to debug the thing normally, without restarting the session over and over again? 我可以做任何事情,以便能够正常调试,而无需重复重启会话吗?

I am new to development in the Windows environment, and could be missing something obvious. 我是Windows环境中的新手,可能会遗漏一些明显的东西。

As @Conrad Frix said, your best option may be to take a memory dump & examine what your threads are doing. 正如@Conrad Frix所说,你最好的选择可能是进行内存转储并检查线程正在做什么。 There are a number of tools available for Windows & .Net development, each of which brings something a little different to the table: 有许多工具可用于Windows和.Net开发,每个工具都会带来一些不同的表:

Windbg - Text based memory inspection. Windbg - 基于文本的内存检查。 Great for digging deep into the framework/OS & examining thread stacks, but there's a pretty steep learning curve. 非常适合深入挖掘框架/操作系统和检查线程堆栈,但是有一个相当陡峭的学习曲线。 (Doesn't get more powerful than this however) (然而,没有比这更强大)

JetBrains dotTrace - integrated with Reshaper if you use that. JetBrains dotTrace - 如果您使用它,则与Reshaper集成。 Not the best results in my experience though. 虽然我的经验不是最好的结果。

RedGate ANTS - My favorite of the "modern" GUI based profilers. RedGate ANTS - 我最喜欢的“现代”基于GUI的分析器。 This gives you really good insights into what your threads are doing, but can be a bit difficult to work with if you have hundreds of threads in your application. 这为您提供了对线程正在做什么的非常好的见解,但如果您的应用程序中有数百个线程,则可能有点难以使用。

Jetbrains & RedGate are paid products, so you'll probably need to use their free trials to resolve your issue. Jetbrains和RedGate是付费产品,因此您可能需要使用免费试用来解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM