Reputation: 3655
Suppose I put a breakpoint on the second line below (the int tempArgc
one), and suppose I'm in debug x64 mode (this is for C++) while running a debugging session:
int main(int argc, char **argv) {
int tempArgc = argc;
tempArgc += 5;
tempArgc = 0;
return 0;
}
As soon as I press "step next", it will halt for 5-10 seconds, and then progress. The 'time elapsed' says <= 1 ms has passed, but the lag before the timer starts is what is getting me. This occurs for every single step so debugging is almost completely useless.
I've searched over StackOverflow for reasons why this could be, since this is a trivial program... I have settings under Tools -> Debugging set that I think would cause issues based on what other people said, and I haven't had luck.
When I step next, after 5 or so seconds a popup box that says "Evaluating expression argc" comes up, and takes another 5 seconds to complete before moving on. I tried disabling Enable property evaluation and other implicit function calls in Tools -> Debugging to see if this would cause it, but that didn't help. Also, the entire UI locks up so I can't click on anything while waiting for this pause.
What could be causing this painful slowdown? I have tried reinstalling VS entirely and that hasn't helped. Are there any settings that might be causing this?
EDIT: If this means anything, it used to happen in VS2015. I upgraded to VS2017 and it still happens. It used to never happen before and I used VS2015 for years without issue, so debugging did used to work (my computer has good specs, so its not my computer). Debugging an arbitrary project when using CLion works perfectly fine, so it's definitely something in VS.
Upvotes: 3
Views: 1673
Reputation: 11
Closing all of the active documents sped up single-step debugging significantly for me. Visual Studio appears to lock and unlock each file with every step.
Upvotes: 1