debugger

Visual Studio 2012 introduced a new framework for writing debugger visualizers for C++ types that replaced the old autoexp.dat file. The new framework offers xml syntax, better diagnostics, versioning and multiple file support. Visualizers are defined in XML files with extension .natvis. These visualizers are loaded each time the debugger starts. That means if you…

Read More Per-project natvis files in Visual Studio “14”

When you run your (unmanaged/C++) application in debugger, you see at the end a report of memory leaks (if any are detected). Something like this: Detected memory leaks! Dumping objects -> f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(141) : {381} normal block at 0x001FFC30, 54 bytes long. Data: < x > 0C 00 B9 78 12 00 00 00 12 00…

Read More How to Find the Source of Memory Leaks

I’ve recently discovered a new nice feature in the natice debugger of Visual Studio 2008: the visualization of bit flags. Let’s take this enumeration for example. Notice that each constant is basically a bit flag.

If we used those bitfields like this:

The debugger shows them like this: However, if the constants are…

Read More Visual Studio 2008 Enum Bit Flags Visualization

Suppose you have the following code:

When running the program, the following window is popped up: When running it in the debugger, a different window is popped up: and the debugger takes you to the line of code that threw the exception. Looking into the output window, you can see something like this: First-chance…

Read More Debugging and Exception Handling