Friday, May 16, 2008

Force debugger to stop when some variable change value

Sometimes is very useful to know when value of some variable is changed. To force debugger to stop when it happens run debugger to place from where you want to monitor your variable (Variable must be instanced because you need to know it's address).

In Breakpoints window chose NewNew data breakpoint.
Now, fill breakpoint parameters and next time when your variable is changed, anywhere in code, debugger will stop.

Tuesday, May 13, 2008

How to check memmory coruption

To check if heap is corrupted set following flag using watch window:
{,,msvcrtd.dll}_crtDbgFlag = 5