Wie Stützpunkte auf Zukunft gemeinsam genutzte Bibliotheken mit einem Befehl-Flag setzen

StackOverflow https://stackoverflow.com/questions/100444

  •  01-07-2019
  •  | 
  •  

Frage

Ich versuche, eine GDB-Sitzung mit der --command Flagge zu automatisieren. Ich versuche, einen Haltepunkt für eine Funktion in einer gemeinsam genutzten Bibliothek zu setzen (die Unix-äquivalent eine DLL). Mein cmds.gdb sieht wie folgt aus:

set args /home/shlomi/conf/bugs/kde/font-break.txt
b IA__FcFontMatch
r

Aber ich bin immer wie folgt vor:

shlomi:~/progs/bugs-external/kde/font-breaking$ gdb --command=cmds.gdb...
GNU gdb 6.8-2mdv2009.0 (Mandriva Linux release 2009.0)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
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 "i586-mandriva-linux-gnu"...
(no debugging symbols found)
Function "IA__FcFontMatch" not defined.
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]

So ist es nicht den Haltepunkt, nachdem alle nicht gesetzt. Wie kann ich es machen default „y“ zu beantworten, um Haltepunkte zu setzen auf anstehende zukünftige Bibliothek Last geteilt?

Ich erinnere mich, dass ich in der Lage war, etwas zu tun, kann aber nicht daran erinnern, was.

War es hilfreich?

Lösung

zu mir selbst beantworten, würde Ich mag die Antwort geben, dass jemand gab mir im IRC:

(gdb) apropos pending
actions -- Specify the actions to be taken at a tracepoint
set breakpoint -- Breakpoint specific settings
set breakpoint pending -- Set debugger's behavior regarding pending breakpoints
show breakpoint -- Breakpoint specific settings
show breakpoint pending -- Show debugger's behavior regarding pending breakpoints

So Haltepunkt setzen anhängig auf funktioniert der Trick; es wird in cmds.gdb wie z verwendet.

set breakpoint pending on
break <source file name>:<line number>

Andere Tipps

OT: In Terminal es so aussehen würde Caja in einer Zeile zu debuggen:

gdb -ex "set breakpoint pending on" -ex "break gdk_x_error" -ex run --args caja --sync

Ohne Symbole.

objdump -t /lib/libacl.so
SYMBOL TABLE:
no symbols
objdump -T /lib/libacl.so
...
00002bd0 g    DF .text  000000d0  ACL_1.0     acl_delete_entry
...


(gdb) break 0x0002bd0 

(gdb) x/20i acl_delete_entry
0x2bd0 <acl_delete_entry>:      stwu    r1,-32(r1)
0x2bd4 <acl_delete_entry+4>:    mflr    r0
0x2bd8 <acl_delete_entry+8>:    stw     r29,20(r1)
0x2bdc <acl_delete_entry+12>:   stw     r30,24(r1)
0x2be0 <acl_delete_entry+16>:   mr      r29,r4
0x2be4 <acl_delete_entry+20>:   li      r4,28972
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top