找不到pintool的调试符号

时间:2016-05-19 19:11:30

标签: gdb debug-symbols intel-pin

我已按照此处的指南:debugging pintool guide,但我无法让GDB找到针对我的pintool的调试符号。 首先,我使用调试信息编译了我的pintool

lotus@c02-0:~/PerforceArch/home/Shadi/HLS/pin/source/tools/lotusTools$ make DEBUG=1 obj-intel64/dst7.so
g++ -shared -Wl,--hash-style=sysv -Wl,-Bsymbolic -Wl,--version-script=../../../source/include/pin/pintool.ver  -g  -o obj-intel64/dst7.so obj-intel64/dst7.o  -L../../../intel64/lib -L../../../intel64/lib-ext -L../../../intel64/runtime/glibc -L../../../extras/xed-intel64/lib -lpin -lxed -lpindwarf -ldl

在两个不同的终端窗口中,我执行了以下操作:

在第一个窗口中:

lotus@c02-0:~/PerforceArch/home/Shadi/HLS/pin/source/tools/lotusTools$ ~/PerforceArch/home/Shadi/HLS/pin/intel64/bin/pinbin -pause_tool 10 -t obj-intel64/dst7.so -- ls
Pausing for 10 seconds to attach to process with pid 2214
To load the tool's debug info to gdb use:
   add-symbol-file /home/lotus/PerforceArch/home/Shadi/HLS/pin/source/tools/lotusTools/obj-intel64/dst7.so 0x7fa8952e44c0 -s .data 0x7fa895c0f720 -s .bss 0x7fa895c10c40

在第二个窗口中:

lotus@c02-0:~$ /usr/bin/gdb ~/PerforceArch/home/Shadi/HLS/pin/intel64/bin/pinbin
GNU gdb (GDB) SUSE (7.4.50.20120603-2.1.2)
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-suse-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/lotus/PerforceArch/home/Shadi/HLS/pin/intel64/bin/pinbin...(no debugging symbols found)...done.
(gdb) attach 2214
Attaching to program: /home/lotus/PerforceArch/home/Shadi/HLS/pin/intel64/bin/pinbin, process 2214
Reading symbols from /lib64/libdl.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /usr/lib64/libstdc++.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libstdc++.so.6
Reading symbols from /lib64/libm.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libm.so.6
Reading symbols from /lib64/libgcc_s.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libgcc_s.so.1
Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libc.so.6
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
Reading symbols from /home/lotus/PerforceArch/home/Shadi/HLS/pin/source/tools/lotusTools/obj-intel64/dst7.so...(no debugging symbols found)...done.
Loaded symbols for /home/lotus/PerforceArch/home/Shadi/HLS/pin/source/tools/lotusTools/obj-intel64/dst7.so
0x00007fa895ce6c80 in __nanosleep_nocancel () from /lib64/libc.so.6
Missing separate debuginfos, use: zypper install glibc-debuginfo-2.15-22.6.4.x86_64 libgcc47-debuginfo-4.7.1_20120723-1.1.1.x86_64 libstdc++47-debuginfo-4.7.1_20120723-1.1.1.x86_64
(gdb) add-symbol-file /home/lotus/PerforceArch/home/Shadi/HLS/pin/source/tools/lotusTools/obj-intel64/dst7.so 0x7fa8952e44c0 -s .data 0x7fa895c0f720 -s .bss 0x7fa895c10c40
add symbol table from file "/home/lotus/PerforceArch/home/Shadi/HLS/pin/source/tools/lotusTools/obj-intel64/dst7.so" at
    .text_addr = 0x7fa8952e44c0
    .data_addr = 0x7fa895c0f720
    .bss_addr = 0x7fa895c10c40
(y or n) y
Reading symbols from /home/lotus/PerforceArch/home/Shadi/HLS/pin/source/tools/lotusTools/obj-intel64/dst7.so...(no debugging symbols found)...done.

问题是在第二个窗口的最后一行,它表示没有找到调试符号。

1 个答案:

答案 0 :(得分:0)

在我使用调试符号编译之前,我已经编译了调试符号。在使用调试符号重新编译之前,我删除了.so文件,但没有删除.o文件。删除旧的.o文件,然后再打开调试符号,修复问题。