Category Archives: Debugging

Viewing types, part 2: the manual way

Compiling with /d1reportAllClassLayout, even an empty file, dumps many compiler-intrinsic types. Six of these are interesting in the present context:  _PMD, _TypeDescriptor, _s__RTTIBaseClassDescriptor2, _s__RTTIBaseClassArray, _s__RTTIClassHierarchyDescriptor, and _s__RTTICompleteObjectLocator. Most of this machinery exists solely for multiple inheritance, and virtual inheritance in … Continue reading

Posted in Debugging, VC++ | 3 Comments

Viewing types, part 1: The Normal way

Suppose C derives from B, which derives from A: Now create A-pointers which point to children types, B and C, and watch them in VS: The types in square brackets are the most derived types of the referenced objects. How … Continue reading

Posted in Debugging, VC++ | Leave a comment

Blank Variable Watch, or OMF Errors

During a debugging session I faced a weird situation where the code compiled and ran just fine, yet some class members appeared blank at the watch window, and others showed – CXX0033: error in OMF type information Skip to the … Continue reading

Posted in Debugging, VC++ | Leave a comment

StepOver Revisited

Andy Pennell exposed in 2004 (and I mentioned in 2009) a very useful undocumented VC feature: when you wish to avoid stepping into nagging functions (ctors, refcounts, whatever), you can specify them in the StepOver registry key. It supports RegExp’s … Continue reading

Posted in Debugging, VC++ | Leave a comment

Breaking on Data Read

Edit: As of windows 10 the details and code below do not work. A working alternative is detailed at a newer post.   You’re probably familiar with Data Breakpoints, and rightfully so: It’s extremely useful to know where a value changes. … Continue reading

Posted in Debugging, VC++, Win32 | 6 Comments

g_dwLastErrorToBreakOn: Watching Errors on VS Revisited

Raymond Chen posted about SetLastError recently, and an interesting discussion ensued. One comment in particular caught my eye: The easiest way to catch a specific last error value in debugger is to set ntdll!g_dwLastErrorToBreakOn to that value. A good while … Continue reading

Posted in Debugging, Win32 | 2 Comments

Debugging Reference Count – Part 1

I recently dealt with a large memory leak that turned out to be a delicate reference count issue. It is a common debugging scenario, and I’ll be sharing here some suggestions about it. First I had to isolate the leaking … Continue reading

Posted in Debugging, VC++ | Leave a comment