在 Visual Studio 中,我们都遇到过“baadf00d”,在运行时检查 C++ 调试器中的变量时看到过“CC”和“CD”。
据我了解,“CC”处于调试模式仅指示内存何时被 new() 或 alloc() 和 unilialized。而“CD”代表已删除或已释放的内存。我只在 RELEASE 版本中看到“baadf00d”(但我可能是错的)。
有时,我们会遇到内存泄漏、缓冲区溢出等问题,这些信息会派上用场。
有人可以指出内存何时以及以什么模式设置为可识别的字节模式以用于调试目的吗?
此链接有更多信息:
https://en.wikipedia.org/wiki/Magic_number_(programming)#Debug_values https://en.wikipedia.org/wiki/Magic_number_(programming)#Debug_values
* 0xABABABAB : Used by Microsoft's HeapAlloc() to mark "no man's land" guard bytes after allocated heap memory
* 0xABADCAFE : A startup to this value to initialize all free memory to catch errant pointers
* 0xBAADF00D : Used by Microsoft's LocalAlloc(LMEM_FIXED) to mark uninitialised allocated heap memory
* 0xBADCAB1E : Error Code returned to the Microsoft eVC debugger when connection is severed to the debugger
* 0xBEEFCACE : Used by Microsoft .NET as a magic number in resource files
* 0xCCCCCCCC : Used by Microsoft's C++ debugging runtime library to mark uninitialised stack memory
* 0xCDCDCDCD : Used by Microsoft's C++ debugging runtime library to mark uninitialised heap memory
* 0xDDDDDDDD : Used by Microsoft's C++ debugging heap to mark freed heap memory
* 0xDEADDEAD : A Microsoft Windows STOP Error code used when the user manually initiates the crash.
* 0xFDFDFDFD : Used by Microsoft's C++ debugging heap to mark "no man's land" guard bytes before and after allocated heap memory
* 0xFEEEFEEE : Used by Microsoft's HeapFree() to mark freed heap memory
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)