4
是否可以讓gdb自動查找相應的可執行文件?我已經提取了調試符號並將它們放在/usr/lib/debug/.build-id/目錄中。當我用gdb /usr/bin/executable core
啓動gdb時,一切正常。所有可執行文件和所有共享庫的調試符號都會自動加載,因爲gdb知道build-id並自動加載它。GDB核心轉儲:通過build-id查找可執行文件
$ gdb /usr/bin/executable core
GNU gdb (GDB) 7.0.1-debian
Copyright (C) 2009 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 "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/executable...Reading symbols from /usr/lib/debug/.build-id/b7/fada8ba917de74a6055647f3ac205dee1615c8.debug...done.
然而,當我剛開始GDB並加載核心文件,沒有調試符號被加載。
(gdb) core-file core
[New Thread 10822]
[New Thread 10812]
Core was generated by `/usr/bin/executable'.
Program terminated with signal 6, Aborted.
#0 0xb7790424 in __kernel_vsyscall()
與strace
運行GDB表明,它甚至沒有嘗試找到他們。核心文件包括構建-ID,所以我想GDB應該能找到它...
$ eu-unstrip -n --core core
0x8048000+0x25d000 [email protected] - - [exe]
0xb7790000+0x1000 [email protected] . - linux-gate.so.1
0xb7771000+0x19000 [email protected] /lib/i686/cmov/libpthread.so.0 - libpthread.so.0
0xb7768000+0x9000 [email protected] /lib/i686/cmov/librt.so.1 - librt.so.1
0xb7672000+0xf5000 [email protected] /usr/lib/libstdc++.so.6 - libstdc++.so.6
0xb764c000+0x26000 [email protected] /lib/i686/cmov/libm.so.6 - libm.so.6
0xb762e000+0x1e000 [email protected] /lib/libgcc_s.so.1 - libgcc_s.so.1
0xb74e7000+0x147000 [email protected] /lib/i686/cmov/libc.so.6 - libc.so.6
0xb7791000+0x1d000 [email protected] /lib/ld-linux.so.2 - ld-linux.so.2
有沒有一種方法,使GDB查找可執行文件的調試文件而不提供導致該可執行文件核心轉儲?
對於它的價值,我不認爲coredumps將*總是*包含可執行文件+路徑。例如,我正在使用的emacs的coredump顯示「Core由emacs functions.2.R'生成」,這解釋了爲什麼它不會嘗試。 –