gdb多线程程序信息线程仅显示一个线程信息

时间:2019-05-18 09:42:28

标签: c multithreading gdb

我编译gdb-7.10.1并在嵌入式设备上使用它,当我gdb附加以pid 1517运行的多线程程序时,信息线程仅显示一个线程。

没有显示[使用libthread_db启用的线程调试]。 但是如果gdb是由ubuntu上的programm生成的核心文件,则info thread有效的文件,我可以获得所有线程的信息。 有人说可能是libthread_db问题,没有任何线索。

# ./gdb-install/bin/gdb ./stmp/dolagent.app -p 1517
GNU gdb (GDB) 7.10.1
Copyright (C) 2015 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 "arm-linux".
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 ./stmp/dolagent.app...done.
Attaching to program: /dev/shm/test/stmp/dolagent.app, process 1517

warning: Could not load shared library symbols for 10 libraries, e.g. ../lib/libpthread.so.0.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
Reading symbols from /usrapp/libplatform.so...(no debugging symbols found)...done.
Reading symbols from /usrapp/libshare.so...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libnetsnmp.so.15...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libssl.so.1.0.0...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libcrypto.so.1.0.0...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libstdc++.so.6...(no debugging symbols found)...done.
Reading symbols from /lib/ld-linux.so.3...(no debugging symbols found)...done.
0xf6ebc018 in ?? ()
(gdb) set solib-search-path ./libs/
Reading symbols from /dev/shm/test/libs/libpthread.so.0...done.
warning: File "/dev/shm/test/libs/libthread_db.so.1" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
        add-auto-load-safe-path /dev/shm/test/libs/libthread_db.so.1
line to your configuration file "//.gdbinit".
To completely disable this security protection add
        set auto-load safe-path /
line to your configuration file "//.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
        info "(gdb)Auto-loading safe path"
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
Reading symbols from /dev/shm/test/libs/libcrypt.so.1...(no debugging symbols found)...done.
Reading symbols from /dev/shm/test/libs/librt.so.1...(no debugging symbols found)...done.
Reading symbols from /dev/shm/test/libs/libdl.so.2...(no debugging symbols found)...done.
Reading symbols from /dev/shm/test/libs/libm.so.6...done.
Reading symbols from /dev/shm/test/libs/libgcc_s.so.1...done.
Reading symbols from /dev/shm/test/libs/libc.so.6...done.
Reading symbols from /dev/shm/test/libs/libnss_files.so.2...(no debugging symbols found)...done.
(gdb) set libthread-db-search-path ./libs/
(gdb) info threads 
  Id   Target Id         Frame 
* 1    LWP 1517 "vtyAcceptor" 0xf6ebc018 in select () from /dev/shm/test/libs/libc.so.6
(gdb)  show auto-load safe-path
List of directories from which it is safe to auto-load files is $debugdir:$datadir/auto-load.
(gdb) show auto-load libthread-db
Auto-loading of inferior specific libthread_db is on.
(gdb) show debug libthread-db
libthread-db debugging is 0.
(gdb) set debug libthread-db 1
(gdb) show debug libthread-db 
libthread-db debugging is 1.
(gdb) info threads 
  Id   Target Id         Frame 
* 1    LWP 1517 "vtyAcceptor" 0xf6ebc018 in select () from /dev/shm/test/libs/libc.so.6
(gdb) q

# ls libs/
6858stdlibc.tar.gz    libcrypt.so.1         libm-2.24.so          libplatform.so        librt.so.1            libthread_db.so.1
libc-2.24.so          libdl-2.24.so         libm.so.6             libpthread-2.24.so    libshare.so
libc.so.6             libdl.so.2            libnss_files-2.24.so  libpthread.so.0       libthread_db-1.0.so
libcrypt-2.24.so      libgcc_s.so.1         libnss_files.so.2     librt-2.24.so         libthread_db.so

当嵌入式设备上的gdb出现时,如何显示其他线程,请有人帮我解决这个问题。

0 个答案:

没有答案