Category Archives: VC++

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

$(TargetDir) Bug, or: Where Did My PDB Go?

Edit: This is now a confirmed VS bug. Hope the Connect page would be updated when it is resolved. Try this (if you weren’t bitten by this issue already): 1. Create a new C++ project – any project type will … Continue reading

Posted in VC++, Visual Studio | 1 Comment

Presenting at Windows Platform Developers Israel User Group

I’ll be giving a talk at a local Windows Developers user group meeting, titled ‘Undocumented Native Debugging Tricks’.  In essence I’ll be surveying as much as time permits of my collection of lesser-known VS tricks – many of which were … Continue reading

Posted in VC++ | Leave a comment

VC++ Version Boundaries

Using a binary built in VC verXXX from a binary built in VC verYYY is very dangerous. This is very obvious in retrospect, but real life recently forced us to try just that: we migrated to VS2010, and a few … Continue reading

Posted in VC++ | 1 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

_VC80_UPGRADE and Warning RC4005 (IDR_MANIFEST Redefinition)

The _VC80_UPGRADE macro seems to cause some confusion around, as does the warning – ‘warning RC4005: ‘IDR_MANIFEST’ : redefinition.’ While it was tempting to try and smear these issues on two posts, fact is they are one. A disk search … Continue reading

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

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

The Case of the ‘X’ That Didn’t Kill the App

One of our MFC apps recently had a weird bug: occasionally debug builds would result in a binary where the ‘X’ corner button killed the app window but not the app – it would just keep idle indefinitely until killed … Continue reading

Posted in Debugging, VC++ | 1 Comment

Debugging Memory Leaks, part 3.5: Hacks with Hooks

Alan rightfully comments that setting a conditional breakpoint at _heap_alloc_dbg  significantly slows down the application. If run time is an issue for you even in debug builds and re-compilation is not an issue, here’s an alternative trick: use an allocation … Continue reading

Posted in Debugging, VC++ | 1 Comment

Debugging Memory Leaks, Part 3: Breaking on Allocations of Given Size

When battling memory leaks, you often start from the output of _CrtMemDumpAllObjectsSince or _CrtDumpMemoryLeaks (called for you if you use MFC) – something similar to: C:\myfile.cpp(20): {130} normal block at 0x00780E80, 68 bytes long. Data: < > CD CD CD … Continue reading

Posted in Debugging, VC++ | 3 Comments