http://stackoverflow.com/questions/10000335/how-to-use-debug-version-of-libc
两个重要参数
set verbose on debug-file-directory
本机的测试结果
[julian@irwas123x64 Projects]$ ls /usr/lib/debug ls: /usr/lib/debug: No such file or directory [julian@irwas123x64 Projects]$ !gdb gdb ./filetest GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-37.el5) 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 "x86_64-redhat-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /home/julian/Projects/filetest...(no debugging symbols found)...done. (gdb) set verbose on (gdb) run Starting program: /home/julian/Projects/filetest Trying host libthread_db library: libthread_db.so.1. Host libthread_db.so.1 resolved to: /lib64/libthread_db.so.1. td_ta_new failed: application not linked with libthread Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done. Trying host libthread_db library: libthread_db.so.1. Host libthread_db.so.1 resolved to: /lib64/libthread_db.so.1. td_ta_new failed: application not linked with libthread Loaded symbols for /lib64/ld-linux-x86-64.so.2 Symbols already loaded for /lib64/ld-linux-x86-64.so.2 Reading symbols from system-supplied DSO at 0x2aaaaaaab000...warning: no loadable sections found in added symbol-file system-supplied DSO at 0x2aaaaaaab000 (no debugging symbols found)...done. Trying host libthread_db library: libthread_db.so.1. Host libthread_db.so.1 resolved to: /lib64/libthread_db.so.1. td_ta_new failed: application not linked with libthread Symbols already loaded for /lib64/ld-linux-x86-64.so.2 Symbols already loaded for /lib64/ld-linux-x86-64.so.2 Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done. Trying host libthread_db library: libthread_db.so.1. Host libthread_db.so.1 resolved to: /lib64/libthread_db.so.1. td_ta_new failed: application not linked with libthread Loaded symbols for /lib64/libc.so.6 OK Program exited normally.