Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VisualStudio 2015 - Only count hit and do not stop

I am currently debugging a buggy piece of legacy code, which leaks Handles all over the place. For further investigation I would like to keep track of the lines in the code where a Handle is created and the corresponding line where it is closed, in order to see if they are in balance.

I tried to set a breakpoint in the corresponding lines and watch the hit count, which works fine. But it is tedious to always break there. Is there a way to make Visual Studio only count the hit but continue with execution?

Thankful for any advice. KR

like image 590
schmitze333 Avatar asked Oct 17 '22 06:10

schmitze333


1 Answers

You could set the break point to break only when the hit count is a multiple of a very large number, so it does not break in your example, or at least not often.

Debugging with conditional breakpoints in Visual Studio 2012, 2015 and 2019.

Edit for future readers: as mentioned in your comment, the hit count will only be displayed when you have stopped execution, so make sure that some breakpoint will be hit at the time you want to examine it.

like image 113
PaulR Avatar answered Oct 20 '22 12:10

PaulR