简体   繁体   English

如何在Linux(OPENSUSE)中运行dmalloc?

[英]How to run dmalloc in linux(OPENSUSE)?

file : main.c 文件:main.c

to run dmalloc I have done the following step. 运行dmalloc我已经完成了以下步骤。

1) gcc -ldmalloc -o test main.c 1)gcc -ldmalloc -o测试main.c

2) function dmalloc { eval command dmalloc -b $* ; 2)函数dmalloc {eval command dmalloc -b $* ; } }

dmalloc -l logfile -i 100 low

3) ./test 3)./测试

where will I get the result? 我从哪里得到结果?

Even i could not get the logfile. 即使我无法获取日志文件。

make sure that your environment actually contains the DMALLOC_OPTIONS variable before running the program. 在运行程序之前,请确保您的环境实际包含DMALLOC_OPTIONS变量。 Different shells may be different with the eval. 不同的外壳可能随评估而有所不同。 Make sure you actually do a malloc in your test program, else it may not have initialized properly. 确保您实际上在测试程序中执行了malloc,否则可能未正确初始化。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM