简体   繁体   中英

VS2010 debugger in limbo

I have a large multithreaded C# program in development that loads multiple DLLs from several VS2010 projects/solutions. 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.

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).

Stop Debugging and Restart commands are available and working.

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.

As @Conrad Frix said, your best option may be to take a memory dump & examine what your threads are doing. There are a number of tools available for Windows & .Net development, each of which brings something a little different to the table:

Windbg - Text based memory inspection. 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. Not the best results in my experience though.

RedGate ANTS - My favorite of the "modern" GUI based profilers. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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