2011-08-24 43 views
6

跟踪在documentation for gdb如何使用GDB

,跟踪点目前只适用于远程 目标。请参见指定调试目标一节。另外,您的 远程目标必须知道如何收集跟踪数据。此功能 在远程存根中实现;但是,从本文编写开始,中没有任何存根分发与GDB支持跟踪点。

强调我的。我在哪里可以得到这样一个存根(对于在Debian x86或x64上用GCC编译的C/C++代码)?或者我如何去制作一个?关于写作存根的文档仅提到了实现与串行端口通信的功能。谢谢!

+0

你应该在Linux上使用gdb的时候引用FSF GDB文件,(事实证明,这个特殊的部分并没有改变),如苹果GDB是“很久很久以前,在一个时间”分叉。 – matt

+0

是的,我得到了警告,说它从我的'gdb'中不受支持,并且发出了googling,这就是结果,但它肯定适用于当前的'gdb'。 – Gaius

回答

1

我不太了解遥控器,但gdb中的一些目标现在支持跟踪点 可能有一种方法可以使用'普通'gdb info或show命令来获取此信息,但我无法找到它。在下面的输出中,由于'supported = 1',所以支持跟踪点, 这可能不限于gdb存根,而且存根正在运行。

$ gdbserver/gdbserver :12345 ~/tests/test & 
$ gdb -quiet 
(gdb) file ~/tests/test 
Reading symbols from /home/ratmice/tests/test...done. 
(gdb) target remote :12345 
Remote debugging using :12345 
Remote debugging from host 127.0.0.1 
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done. 
Loaded symbols for /lib64/ld-linux-x86-64.so.2 
0x00000035dd600b20 in _start() from /lib64/ld-linux-x86-64.so.2 
Created trace state variable $trace_timestamp for target's variable 1. 
Missing separate debuginfos, use: debuginfo-install glibc-2.13-2.x86_64 
(gdb) interpreter-exec mi2 -trace-status 
^done,supported="1",running="0",frames="0",frames-created="0",buffer-size="5242880",buffer-free="5242880",disconnected="0",circular="0" 
+0

这是哪个版本?我在内核2.6.32-5上有'gdb' 7.0.1-debian和'gcc' 4.4.5版。 'tstart'给了我''目标不支持这个命令''按照'gdbserver'中的例子运行。 'interpreter-exec mi2 -trace-status'给了我'^错误,msg =“未定义的MI命令:trace-status”'。谢谢! – Gaius

+1

在7.2中添加了-trace-status mi命令。 – matt