title - Linux程序调试及调试工具使用笔记
0.参考资料
[1].http://www.ibm.com/developerworks/cn/linux/sdk/l-debug/
[2]. http://dsec.pku.edu.cn/~yuhj/wiki/gdb.html
[3].http://www.gnu.org/software/libtool/manual/libtool.html
1.YAMD - http://www.cs.hmc.edu/~nate/yamd/
YAMD is Yet Another Malloc Debugger. It's a package for finding dynamic allocation
related bugs in C and C++. It currently runs on Linux/x86 and DJGPP. The current
version is 0.32.
1.1. 获取源码&构建&安装
http://www.cs.hmc.edu/~nate/yamd/yamd-0.32.tar.gz
$tar xzf yamd-0.32.tar.gz
$cd yamd-0.32
~/yamd-0.32$make
~/yamd-0.32$sudo make install
1.2. 示例
// testyamd.c
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
char *ptr1;
char *ptr2;
ptr1 = malloc(512);
ptr2 = malloc(512);
linux程序调试及调试工具使用笔记
最新推荐文章于 2023-09-17 21:23:34 发布