Listing 3 shows the output from YAMD on test1.
清单3展示了来自test1上的YAMD的输出。
You can use the following command to start yamd.
您可以使用下面的命令来启动yamd。
Let's try YAMD on another sample program in Listing 4.
让我们在清单4中另一个样本程序上试试YAMD。
YAMD only requires the -g option for the link statement.
对于链接(link)语句,YAMD只需要- g选项。
YAMD tells us that we have an out-of-bounds condition in the for loop.
YAMD告诉我们在for循环中有“越界(out - of -bounds)”的情况。
Listing 5 shows the output from using YAMD on the sample program test2.
清单5显示了在样本程序test2上使用YAMD得到的输出。
The latest version of YAMD at the time of writing this article was 0.32.
在撰写本文时,YAMD的最新版本为 0.32。
YAMD shows that we have already freed the memory, and there is a memory leak.
YAMD显示我们已经释放了内存,而且存在内存泄漏。
MEMWATCH and YAMD are both useful debugging tools and they require different approaches.
MEMWATCH和YAMD都是很有用的调试工具,它们的使用方法有所不同。
Tools that show the location of memory leaks, overruns, and the like can solve memory management problems, and I find MEMWATCH and YAMD helpful.
能显示内存泄漏、溢出等等的位置的工具可以解决内存管理问题,我发现MEMWATCH和YAMD很有帮助。
For Scenario 1, we use two sample programs with memory allocation problems that we debug using the MEMWATCH and Yet Another Malloc Debugger (YAMD) tools.
在第1种情况中,我们使用了两个有内存分配问题的样本程序,使用MEMWATCH和YetAnotherMallocDebugger (YAMD)工具来调试它们。
For Scenario 1, we use two sample programs with memory allocation problems that we debug using the MEMWATCH and Yet Another Malloc Debugger (YAMD) tools.
在第1种情况中,我们使用了两个有内存分配问题的样本程序,使用MEMWATCH和YetAnotherMallocDebugger (YAMD)工具来调试它们。
应用推荐