如何将 Valgrind 的输出重定向到文件? [英] How to redirect Valgrind's output to a file?

查看:167
本文介绍了如何将 Valgrind 的输出重定向到文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用 Valgrind 工具时,我需要记录 valgrind 工具生成的详细信息.我怎样才能做到这一点?我试过类似的东西,

While working with Valgrind tool, i need to log the details produced by valgrind tool. How can I accomplish that? I tried something like,

 valgrind a.out | test

 valgrind a.out > test

它只给出了程序的输出,而不是 valgrind 内存错误、泄漏信息.如果程序不需要用户交互(即提供输入),即使我也会这样.如果程序需要用户输入,即使那件事本身也不起作用.

It gave just the program's output and not the valgrind memory error,leak information. Even i am getting like this if the program requires no user interaction (i.e. giving input). If the program need user input even that thing itself won't work.

我该怎么做?

推荐答案

valgrind --log-file="filename"

这篇关于如何将 Valgrind 的输出重定向到文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆