Category Archives: Debugging

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

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

Setting a Watch on Wide Registers in VS

General-purpose registers can be watched from the watch window pretty much as regular variables: (the ‘$’ prefix is optional, but is recommended by MS – probably as means to minimize clashes with code variables.) It is less known that you … Continue reading

Posted in Debugging, VC++ | Leave a comment

VS2012 Migration #3: autoexp and NoStepInto Replacements

In the past I blogged quite a few times about two immensely useful albeit mostly-unofficial debugger features: watch modification via autoexp.dat, and step-into modification via NoStepInto registry key. A long while ago I raised two suggestions at MS UserVoice, to … Continue reading

Posted in Debugging, VC++ | 3 Comments

Entry Point Not Found, and other DLL Loading Problems

Occasionally I come across DLL load problems: The verbosity of the error messages varies greatly. In their raw form these include at least the DLL name, but as various frameworks come into play (for the error message above, it’s .net) … Continue reading

Posted in Debugging, Win32 | 17 Comments

_DllMain@12 already defined

We recently faced this linkage error: error LNK2005: _DllMain@12 already defined in MSVCRT.lib(dllmain.obj) Searching gives ~36K results as of July 2012, many of which seem high quality (StackOverflow, MS, CodeProject etc.), and I was certain it would be a simple … Continue reading

Posted in Debugging, MFC | 6 Comments

Viewing types, part 3: Exceptions

Last time a way was shown to use internal RTTI mechanics to view C++ type names without direct debugger aid. There is one place in particular where such type names carry substantial information, and that is c++ exceptions. These can … Continue reading

Posted in Debugging, VC++ | Leave a comment