In VS C++ 6.0, what debug tools are good to find w

2019-05-24 12:07发布

My program eventually consumes all ram and crashes... looking through the code, I can't find anything that stands out that would do this.

3条回答
\"骚年 ilove
2楼-- · 2019-05-24 12:39

Could you modify the code to use the debug version of malloc and free? If yes, check _malloc_dbg and _free_dbg.

(You could write own new and delete operators based on these functions.)

As I remember VS 6.0 has no _realloc_dbg.

#ifdef _DEBUG
#define _CRTDBG_MAP_ALLOC 1
#include <Crtdbg.h>
#define malloc(size) _malloc_dbg(size,_CLIENT_BLOCK,__FILE__,__LINE__)
#define free(addr) _free_dbg(addr,_CLIENT_BLOCK)
#endif
查看更多
爷的心禁止访问
3楼-- · 2019-05-24 12:45

You can try BoundsChecker (now DevPartner): http://www.microfocus.com/products/micro-focus-developer/devpartner/index.aspx

You will be able to see memory leaks, interface leaks and other problems in your code.

查看更多
我只想做你的唯一
4楼-- · 2019-05-24 12:46

Depending on the type of leak you can use umdh, or debugdiag as simple tools, otherwise I would recommend windbg. All of these are free and are part of debugging tools for windows, you can Google for tutorials on all these tools. The command for automatic leak finding in windbg is !heap -l.

查看更多
登录 后发表回答