Author Archives: Ofek Shilon

Accelerating Debug Runs, Part 2: _ITERATOR_DEBUG_LEVEL

A previous post discussed the Windows Debug Heap – with the main motivation being how to avoid it, as it is just empty, expensive overhead, and it isn’t clear why it is on by default in the first place. Remarkably, … Continue reading

Posted in Debugging, VC++ | 1 Comment

Accelerating Debug Runs, Part 1: _NO_DEBUG_HEAP

(A more appropriate but even-less-catchy title might have been ‘accelerating runs from the debugger‘. As elaborated below, these two are not strictly equal). A common notion is that debug builds can and should carry as much debugging overhead as one … Continue reading

Posted in Debugging, Visual Studio, Win32 | Leave a comment

Debugging Memory Corruption II

Some years ago I shared a trick that let’s you call _CrtCheckMemory from the debugger anywhere, without re-compilation.   The updated (as of VS2013) string to type at a watch window is: {,,msvcr120d.dll}_CrtCheckMemory() Let’s expand on that today, in two steps. … Continue reading

Posted in Debugging, VC++ | 3 Comments

Hidden Tracepoint Keywords

The tracepoints window includes instructions for several special keywords, the most useful by far being $CALLSTACK:   These are not all there are – two more exist: $TICK and $FILEPOS. Quoting the documentation: $TICK inserts the current CPU tick count, while $FILEPOS inserts … Continue reading

Posted in Visual Studio | Leave a comment

Debugging Handle Leaks

This is all well documented stuff and I won’t go into details – it’s here mostly for self reference (3rd time I had to chase this down in google). Steps are: (1) Install WDK to integrate the WinDbg engine with … Continue reading

Posted in Debugging, Visual Studio, Win32 | Leave a comment

UseDebugLibraries and Wrong Defaults for VC++ Project Properties

Many of the projects I’m working on seem to have wrong default properties in Debug configuration.  For example, ‘Runtime Library’ is explicitly set to /MDd but defaults to /MD. ‘Basic Runtime Checks’ is explicitly set to /RTC1 but defaults to  … Continue reading

Posted in MSBuild, VC++ | 5 Comments

Reading Specific Monitor Dimensions

Almost 2 years ago I wrote about the proper way of getting the EDID – and in particular the physical monitor size. I did leave a loose end: I actually had to query the dimensions of a specific monitor (specified … Continue reading

Posted in Win32 | 7 Comments