Tracepoint 在 gdb 中不起作用,并且显示“Trace 只能在远程目标上运行”
我想使用跟踪点在我拥有完全访问权限的本地计算机上调试程序。我能够设置跟踪点及其passcount,并使用 info tr 给我
(gdb) info tr
Num Enb Address PassC StepC What
1 y 0x080b7529 2 0 in search_tcp at tcp_pkt.c:412
跟踪点 1 的操作: 收集流量 然后
我运行 prog,它照常运行,最后当我给 tfind 或 tdump 来收集所需的数据时,它显示:
(gdb) tfind 1
Trace 只能在远程目标上运行。
(gdb) tdump
Trace 只能在远程目标上运行。
即使我尝试使用“tstart”,但它再次显示“跟踪只能在远程目标上运行”。
知道这条消息的含义吗?目前不支持tracepoing 使用吗?或者是为了通过 LAN 或其他网络调试某些远程计算机? 任何帮助将不胜感激。
谢谢 维卡斯
I want to use tracepoints to debug a prog on a local machine where i have full access. I am able to set the tracepoint and its passcount and using info tr gives me
(gdb) info tr
Num Enb Address PassC StepC What
1 y 0x080b7529 2 0 in search_tcp at tcp_pkt.c:412
Actions for tracepoint 1:
collect flow
end
Then i run the prog, it runs as usual and in the end when i give tfind or tdump to collect the required data it shows:
(gdb) tfind 1
Trace can only be run on remote targets.
(gdb) tdump
Trace can only be run on remote targets.
Even i tried using "tstart" but it shows again "Trace can only be run on remote targets."
Any idea on what is the meaning of this message ? Is tracepoing usage not supported currently ? OR is it for debugging some remote machine over LAN or some other network ?
Any help would be greatly appreciated.
thanks
vikas
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
其含义正是消息所说的:跟踪点工具仅在
gdbserver
中实现,而不是在GDB本身中实现,所以你不能在本机调试时(当 GDB 直接控制下级(正在调试的)进程时)使用 tstart。相反,您需要设置一个远程调试会话(仍然可以在单台计算机上完成):
在另一个窗口中:
现在您将拥有带有远程目标(即正在运行的
gdbserver
)的 GDB在同一主机上),并且 tstart 等将起作用。更新:
在使用
tstart
之前,您需要设置跟踪和操作,如文档此处。并且您无法
运行
,因为劣等进程已经正在运行。请改用继续
。更新 2:
听起来您的
gdbserver
很旧,并且实际上不支持跟踪。生产什么
?
更新 3:
显然您的
gdbserver
太旧了。尽管 GDB 本身从 4.17 版开始就支持跟踪点,但 gdbserver 直到版本 7.2
Update 4 才开始支持跟踪点:
简单。您可以阅读 gdbserver 的 文档,但我相信您正在寻找这个调用:
The meaning is exactly what the message says: the tracepoint facility is implemented only in
gdbserver
, and not in GDB itself, so you can't usetstart
when debugging natively (when GDB controls the inferior (being debugged) process directly).Instead, you need to set up a remote debugging session (which can still be done on a single machine):
In another window:
Now you'll have GDB with a remote target (which is the
gdbserver
running on the same host), andtstart
etc. will work.Update:
Before you can use
tstart
, you need to set trace and actions, as documented here.And you can't
run
because the inferior process is already running. Usecontinue
instead.Update 2:
It sounds like your
gdbserver
is old, and does in fact not support tracing.What do
produce?
Update 3:
Apparently your
gdbserver
is too old.Even though GDB itself supported tracepoints since version 4.17,
gdbserver
only started supporting the tracepoints with version 7.2Update 4:
Simple. You can read the documentation for gdbserver, but I believe you are looking for this invocation: