user3398315
user3398315

Reputation: 331

program stuck. How do I find the offending code?

I have a very big piece of code and whenever it run for 20sec, it will be stuck somewhere and the program freezes. I suspect it stuck in a loop or waiting for some event to happen before it continue.

How do I identify that piece of code? I tried setting breakpoint but it seems too slow. If I set breakpoint at line 1, it will take few hundred iteration before I reach the offending code.

Upvotes: -1

Views: 2785

Answers (1)

Ehsan
Ehsan

Reputation: 32681

Apart from debugging which you have already tried, You can do the following 2 things.

  1. Pause the visual studio to see where it is stuck (as mentioned by Niklas B in comments as well)
  2. If that isn't helpful you can log the details in some log file that can help you in finding the code that is creating problem.

Though i must say that finding the problem is mostly a tedious job.

Upvotes: 3

Related Questions