Showing posts with label Debugging. Show all posts
Showing posts with label Debugging. Show all posts

Thursday, June 18, 2009

"funny" memory values



Thanks to bimba.

0xcccccccc

When the code is compiled with the /GZ option, uninitialized variables are automatically assigned to this value (at byte level). - you define a variable - this is its default value

0xdddddddd
After you delete an object - Memory that has been released with delete or free. It is used to detect writing through dangling pointers.

0xcdcdcdcd
Allocated memory via malloc or new but never written by the application.

0xfdfdfdfd
Also known as "no mans land." This is used to wrap the allocated memory (like surrounding it with fences) and is used to detect indexing arrays out of bounds.

0xBAADFOOD(bad food)
Memory allocated by LocalAlloc() with LMEM_FIXED, but not yet written to.

0xabababab
Memory allocated by LocalAlloc()

Watch Window Tips for Visual Studio 2003



Edit autoexp.dat Which is located in C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Packages\Debugger

Show Vecor Size
Add this line :


std::vector <*> = size = , capacity =

List of additional Object that can be better "Watched" .

Call GetLastError in the Watch Tab in Debugger

Want to see GetLastError messsage on run time?




just add “@err” or “@err,hr” to your debug watch window. Now it’s more like looking at errno.

 
Home | About | Link | Link
Simple Proff Blogger Template Created By Herro | Inspiring By Busy Bee Woo Themes