Question

according to MSDN, Visual Studio uses a special heap in debug mode that has extra "no man's land" bytes set to 0xFD by default to track heap corruption Is there a way to force visual to break when such values are overwritten? I can't find this information anywhere and it seems extremely useful, much more than having to manually dump the memstat like MSDN proposes

thanks

Was it helpful?

Solution

You could try using _CrtSetDbgFlag() when in debug mode.

Reference.

OTHER TIPS

If you want to pause execution the next time a place in memory is changed then set a data breakpoint. You need to know in advance where the corruption will occur. You maybe need to set a regular break point where a memory is allocated and where no man's land is set to 0xFD. After that point you have a location in memory, and just set the data breakpoint.

Why don't you use AppVerifier with your application?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top