如何在GDB中使用跟踪

时间:2011-08-24 10:43:35

标签: c debugging gdb debian remote-debugging

documentation for gdb

  

tracepoint工具目前仅适用于远程工具   目标。请参阅指定调试目标一节。另外,你的   远程目标必须知道如何收集跟踪数据。这个功能   在远程存根中实现;但是,没有存根   在撰写本文时分发了GDB支持跟踪点

强调我的。我在哪里可以获得这样的存根(对于在Debian x86或x64上使用GCC编译的C / C ++代码)?或者我该怎么做?有关编写存根的文档仅提及实现与串行端口通信的功能。谢谢!

1 个答案:

答案 0 :(得分: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"