2015-08-25 2 views
2

Pour déboguer un simulateur qui utilise l'outil PIN, en utilisant 2 différentes fenêtres du terminal, je fais ce qui suit:outil PIN Debugging add-symbole fichier ne fonctionne pas

/home/agy/mcsim/pin/intel64/bin/pinbin -pause_tool 5 -t /home/agy/mcsim/Pthread/mypthreadtool -port 47145 -skip_first 10000 -- McSim/JacNoBoost/JACCARD 
Pausing to attach to pid 5465 
To load the tool's debug info to gdb use: 
    add-symbol-file /home/agy/mcsim/Pthread/mypthreadtool 0x7f86e6c06ee0 -s .data 0x7f86e709f620 -s .bss 0x7f86e70aaac0 

autre fenêtre, je fais la suivant:

gdb /home/agy/mcsim/Pthread/mypthreadtool 
GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7 
Copyright (C) 2014 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-linux-gnu". 
Type "show configuration" for configuration details. 
For bug reporting instructions, please see: 
<http://www.gnu.org/software/gdb/bugs/>. 
Find the GDB manual and other documentation resources online at: 
<http://www.gnu.org/software/gdb/documentation/>. 
For help, type "help". 
Type "apropos word" to search for commands related to "word"... 
Reading symbols from /home/agy/mcsim/Pthread/mypthreadtool...done. 
(gdb) attach 5465 
Attaching to program: /home/agy/mcsim/Pthread/mypthreadtool, process 5465 
0x0000000030592c70 in ??() 
(gdb) add-symbol-file /home/agy/mcsim/Pthread/mypthreadtool 0x7f86e6c06ee0 -s .data 0x7f86e709f620 -s .bss 0x7f86e70aaac0 
add symbol table from file "/home/agy/mcsim/Pthread/mypthreadtool" at 
    .text_addr = 0x7f86e6c06ee0 
    .data_addr = 0x7f86e709f620 
    .bss_addr = 0x7f86e70aaac0 
(y or n) y 
Reading symbols from /home/agy/mcsim/Pthread/mypthreadtool...done. 
(gdb) c 
Continuing. 

à un certain point, l'outil broches se bloque et j'envoyer manuellement signal d'interruption à la broche outil et essayer de déboguer sur la fenêtre ci-joint. Pour comprendre à quelle implémentation de broche ligne est bloquée, j'ai essayé la commande backtrace mais elle renvoie des points d'interrogation même si le fichier de symboles est ajouté.

Program received signal SIGINT, Interrupt. 
0x000000003052c474 in ??() 
(gdb) backtrace 
#0 0x000000003052c474 in ??() 
#1 0x00007f86e5570850 in ??() 
#2 0x000000003070c290 in ??() 
#3 0x0000000001dda880 in ??() 
#4 0x0000000001dda880 in ??() 
#5 0x000000000040e03a in ??() 
#6 0x0000000030643de0 in ??() 
#7 0x00007f86d5ada0c0 in ??() 
#8 0x0000000000000012 in ??() 
#9 0x00007f86e5571350 in ??() 
#10 0x0000000030aade20 in ??() 
#11 0x0000000000000000 in ??() 

Je n'ai pas trouvé la mauvaise approche ici. Pourrais-tu m'aider s'il te plaît?

+0

Agy, pouvez-vous vérifier que les adresses que vous voyez sont à l'intérieur de l'outil de broche/broche? Faites 'cat/proc//maps' et faites la référence croisée de ces plages d'adresses avec les broches et le pintool. – nitzanms

Répondre

2

Je n'ai pas trouvé la mauvaise approche ici.

vous dites que GDB mypthreadtool est votre exécutable principal, mais il est pas: /home/agy/mcsim/pin/intel64/bin/pinbin est.

Essayez ceci:

gdb /home/agy/mcsim/pin/intel64/bin/pinbin 5465 
(gdb) add-symbol-file /home/agy/mcsim/Pthread/mypthreadtool \ 
    0x7f86e6c06ee0 -s .data 0x7f86e709f620 -s .bss 0x7f86e70aaac0 
+1

L'exécutable principal pour le débogage de broche est pinbin. – nitzanms

+0

@nitzanms Merci. Actualisé. –

+1

@nitzanms et Employé russe merci pour votre aide. Utiliser pinbin comme exécutable principal et mettre le pid à la place de 5465 fonctionnait plutôt bien. – agy