Category Archives: Debugging

Debug/Release Numerical Differences

We recently had trouble reproducing in debug builds the exact numerical behavior of release builds.   This just happens  occasionally, and we’re used to accept it as some compiler black magic.  This time we dug a bit deeper – I’m pretty … Continue reading

Posted in Debugging, VC++ | 4 Comments

Debugging Memory Leaks, Part 2: CRT support

This feature is well documented, but yet from what I see – doesn’t get the usage it deserves. Here’s a quick, beginner-oriented rehash – if only to refer my teammates. Problem and Immediate Solution If you’re developing MFC apps, the … Continue reading

Posted in Debugging, VC++ | 3 Comments

Viewing Debugee Environment Variables

Koby asks – “How suitable is VS automation for doing something like printing the values of all environment variables in the debugee process”? In fact, I just learnt how to do that. type ‘$env=0’, either at a watch window or … Continue reading

Posted in Debugging, VC++, Visual Studio | 2 Comments

Breaking on System Functions with the Context Operator

[Edit, Aug 2010:] About a year after this trial-and-error-ish investigation, I accidently found this hidden bit of documentation which pretty much sums it up. The context operator is technically documented, although barely so. Seemed to me the reason is that … Continue reading

Posted in Debugging, Visual Studio | 9 Comments

Searching Through Memory in Visual Studio

MS maintains two separate debugger product lines – one (supposedly owned by the smaller team) being WinDbg and the other shipped with Visual Studio. There’s an ever-going online flame for superiority between fans of both debuggers (sample 1, sample 2). … Continue reading

Posted in Debugging, VC++ | 5 Comments

Debugging DICOM Query/Retrieve Communication

I recently had the questionable pleasure of writing a DICOM Q/R-module, for communication with a PACS. A future post may be dedicated to letting some steam out, and listing in detail the reasons I consider DICOM to be the worst … Continue reading

Posted in Debugging, DICOM | 4 Comments

Coding Binary as Binary

If you’re comfortable with hex, you have no business in this post.  If on the other hand, when faced with a mask like 0xFFA8 you’re forced – like me – to translate it on paper into 11111111 10101000,  then by … Continue reading

Posted in Codeproject, Debugging, VC++, Visual Studio | Leave a comment

Naming threads

There is a nice feature that is all but undocumented, and has next to no web presence too:  you can give your threads meaningful names. While this is trivial in managed code, it is hardly obvious for native.  The TIB … Continue reading

Posted in Debugging, Visual Studio | 1 Comment

Debugging Native Memory Leaks, Part 1: LeakDiag

Leaking memory is probably the single most painful aspect of native code – its the reason managed was ever born. At work, our code routes ‘new’ calls through_aligned_malloc_dbg. This CRT API, along with cousins like _malloc_dbg and _calloc_dbg, takes extra … Continue reading

Posted in Debugging | 12 Comments

Stepping Over Unwanted Functions

There’s an undocumented VS setting that lets you specify functions that would not be stepped into when you click F11.  This can be save quite a few clicks in situations of the form – Where pressing F11 would repeatedly step … Continue reading

Posted in Debugging, VC++, Visual Studio | Leave a comment