如何使Valgrind调试程序通过一个程序 [英] How to make Valgrind debugger step through a program
问题描述
早上好,我试图使用Valgrind调试器来浏览一个程序。
我的valgrind命令行是 valgrind -tool memcheck --leak-check = full --db-enable = yes ./MatchUpAcurate.exe。我使用valgrind-3.5.0在Centos Linux版本5.5与gdb版本7,0.1-23.el5_5.2。
当valgrind询问附加到Debugger的问题时,我输入Yes。然后,valgrind调试器返回: 4428:return new tuple2< int,A>(2,i ++,p-> next());
当我尝试使用gdb步骤或继续命令,valgrind说
[New Thread 0x410fd10 LWP 6548]找不到LWP 6551的用户级线程:通用错误。
当我尝试使用 valgrind - valgrind命令行上的--single-step = yes
调试程序选项,valgriind说错误选项中止
。
任何valgrind用户可以告诉我如何通过C ++源代码或继续通过程序?
您还可以在3.7.0版本中获取vgdb。从发行说明:
- GDB服务器:Valgrind现在有这意味着
可以控制从GDB的Valgrind运行,做所有通常的
GDB可以做的事情(单步,断点,检查
数据等)。还提供工具特定的功能。对于
示例,当运行Memcheck时,可以从GDB中查询变量
或内存的定义状态;支持任意大的
内存观察点等。要使用GDB服务器,请使用标志--vgdb-error = 0启动
Valgrind,然后按照屏幕上的
指令操作。
valgrind在线手册中有更多信息。
Good morning, I am trying to use the Valgrind debugger to step through a program.
My valgrind command line is valgrind -tool memcheck --leak-check=full --db-enable=yes ./MatchUpAcurate.exe.
I am using valgrind-3.5.0 on Centos Linux release 5.5 with gdb version 7,0.1-23.el5_5.2.
I enter Yes when valgrind asks the question Attach to Debugger. Then, the valgrind debugger returns with: 4428: return new tuple2<int,A>(2, i++, p->next());
When I try to use the gdb step or continue command, valgrind says
[New Thread 0x410fd10 (LWP 6548] Cannot find user-level thread for LWP 6551: generic error.
When I try to use valgrind --single-step=yes
debugger option on the valgrind command-line, valgriind says Bad option aborting
.
Could any valgrind users show me how to step through C++ source code or continue through a program? Thank you.
You can also get vgdb in the 3.7.0 release. From the release notes:
- GDB server: Valgrind now has an embedded GDB server. That means it is possible to control a Valgrind run from GDB, doing all the usual things that GDB can do (single stepping, breakpoints, examining data, etc). Tool-specific functionality is also available. For example, it is possible to query the definedness state of variables or memory from within GDB when running Memcheck; arbitrarily large memory watchpoints are supported, etc. To use the GDB server, start Valgrind with the flag --vgdb-error=0 and follow the on-screen instructions.
There's more info in the valgrind online manual.
这篇关于如何使Valgrind调试程序通过一个程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!