Valgrind

fuyundeMacBook-Pro:valgrind-3.10.0 fuyun$ ./configure && make && sudo make install

checking for a BSD-compatible install... /usr/bin/install -c

checking whether build environment is sane... yes

checking for a thread-safe mkdir -p... ./install-sh -c -d

checking for gawk... no

checking for mawk... no

checking for nawk... no

checking for awk... awk

checking whether make sets $(MAKE)... yes

checking whether to enable maintainer-specific portions of Makefiles... no

checking whether ln -s works... yes

checking for gcc... gcc

checking whether the C compiler works... yes

checking for C compiler default output file name... a.out

checking for suffix of executables... 

checking whether we are cross compiling... no

checking for suffix of object files... o

checking whether we are using the GNU C compiler... yes

checking whether gcc accepts -g... yes

checking for gcc option to accept ISO C89... none needed

checking for style of include used by make... GNU

checking dependency style of gcc... gcc3

checking whether gcc and cc understand -c and -o together... yes

checking how to run the C preprocessor... gcc -E

checking for g++... g++

checking whether we are using the GNU C++ compiler... yes

checking whether g++ accepts -g... yes

checking dependency style of g++... gcc3

checking for ranlib... ranlib

checking for a sed that does not truncate output... /usr/bin/sed

checking for ar... /usr/bin/ar

checking for perl... /usr/bin/perl

checking for gdb... /no/gdb/was/found/at/configure/time

checking dependency style of gcc... gcc3

checking for diff -u... yes

checking for a supported version of gcc... Configured with: --prefix=/Applications/Xcode6-Beta7.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode6-Beta7.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1

ok (4.2.1)

checking build system type... x86_64-apple-darwin14.0.0

checking host system type... x86_64-apple-darwin14.0.0

checking for a supported CPU... ok (x86_64)

checking for a 64-bit only build... no

checking for a 32-bit only build... no

checking for a supported OS... ok (darwin14.0.0)

checking for the kernel version... unsupported (14.0.0)

configure: error: Valgrind works on Darwin 10.x, 11.x, 12.x and 13.x (Mac OS X 10.6/7/8/9)


我是10.10啊,啊手贱

### Valgrind工具介绍 Valgrind是一套Linux下的开源(GPL V2)仿真调试工具集[^4]。这套工具不仅限于单一的功能,而是提供了多种不同的工具用于解决不同类型的编程问题。 #### 功能概述 除了最为人熟知的内存错误检测工具Memcheck之外,Valgrind还包括了Cachegrind、Helgrind、Callgrind和Massif等多个实用工具[^1]。这些工具各自专注于不同的方面: - **Memcheck**: 主要用来查找程序中的内存管理错误,如访问未初始化或已释放的内存区域等。 - **Cachegrind**: 可以帮助开发者理解其应用程序如何与CPU缓存交互,从而优化性能[^3]。 - **Helgrind**: 专门针对多线程应用中存在的竞态条件等问题进行诊断。 - **Callgrind**: 类似于Cachegrind,但是更侧重于函数调用关系及其成本分析。 - **Massif**: 提供详细的堆栈分配历史记录,有助于识别大对象创建的位置并减少不必要的动态内存占用。 #### 安装过程 对于希望安装最新版本Valgrind的用户来说,可以按照下面的方式操作[^2]: ```bash mkdir valgrind-inst && cd valgrind-inst/ wget http://www.valgrind.org/downloads/valgrind-latest.tar.bz2 tar -xf valgrind-latest.tar.bz2 cd valgrind-*/ ./configure make sudo make install ``` 请注意上述命令适用于大多数类Unix操作系统,具体路径可能因下载时间的不同而有所变化。 #### 使用实例 当想要使用除默认Memcheck以外的其他工具时,可以通过`--tool=`参数来指定所需的工具名称。例如,如果想通过Cachegrind来进行缓存行为分析,则应执行如下命令: ```bash valgrind --tool=cachegrind ./your_program ``` 这里假设`your_program`是你编译后的可执行文件名。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值