0

I have followed the guide here: debugging pintool guide, but I cannot get GDB to find the debugging symbols for my pintool. First I compiled my pintool with debug information

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

In two different terminal windows I did the following:

In the first window:

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

In the the second window:

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.

The problem is that on the last line of the second window, it says no debugging symbols were found.

Lotus Fenn
  • 85
  • 7

1 Answers1

0

Before I compiled with debug symbols on, I had compiled with debug symbols off. Before recompiling with debug symbols on, I deleted the .so file but not the .o file. Deleting the old .o file and then compiling again with debug symbols on, fixed the problem.

Lotus Fenn
  • 85
  • 7