1、查看进程的线程
ps -T -h <pid>
2、gdb attach 线程ID
[root@RV1126_RV1109:/]# ps -T -p 673
PID SPID TTY TIME CMD
673 673 pts/0 00:00:00 Tampa
673 674 pts/0 00:00:00 logger
673 675 pts/0 00:00:00 configManager
673 676 pts/0 00:00:00 WatchDogTimer
673 678 pts/0 00:00:01 GPIOContorl
673 679 pts/0 00:00:00 xc:RkAiqMngCmdT
673 680 pts/0 00:00:00 Tampa
673 681 pts/0 00:00:00 xc:afecThread
673 682 pts/0 00:00:00 xc:ldchThread
673 683 pts/0 00:00:00 xc:RkAiqRstAppl
673 684 pts/0 00:00:00 xc:RkAiqCoreThr
673 685 pts/0 00:00:00 xc:RkAiqCoreThr
673 686 pts/0 00:00:00 xc:RkLumaCoreTh
673 687 pts/0 00:00:00 xc:mipi_tx_poll
673 688 pts/0 00:00:00 xc:mipi_rx_poll
673 689 pts/0 00:00:00 xc:event_poll
673 690 pts/0 00:00:00 xc:ispp_poll
673 691 pts/0 00:00:00 xc:stats_poll
673 692 pts/0 00:00:00 xc:params_poll
673 693 pts/0 00:00:00 xc:luma_poll
673 694 pts/0 00:00:00 xc:pparams_poll
673 695 pts/0 00:00:00 Tampa
673 696 pts/0 00:00:00 OutputStreamFlo
673 697 pts/0 00:00:00 SourceFlow:v4l2
673 698 pts/0 00:00:00 mpp_enc
673 699 pts/0 00:00:00 VideoEncoderFlo
673 700 pts/0 00:00:00 ZMQbg/Reaper
673 701 pts/0 00:00:00 ZMQbg/IO/0
673 702 pts/0 00:00:00 ZMQbg/Reaper
673 703 pts/0 00:00:00 ZMQbg/IO/0
673 704 pts/0 00:00:00 RPCServer
673 705 pts/0 00:00:00 RPCPubServer
[root@RV1126_RV1109:/]# gdb attach 695
GNU gdb (GDB) 8.1.1
Copyright (C) 2018 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-buildroot-linux-gnueabihf".
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"...
attach: No such file or directory.
Attaching to process 695
Reading symbols from /userdata/Tampa...done.
Reading symbols from /usr/lib/libeasymedia.so.1...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libdrm.so.2...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libasound.so.2...(no debugging symbols found)...done.
Reading symbols from /usr/lib/librockchip_mpp.so.1...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libavformat.so.58...done.
Reading symbols from /usr/lib/libavdevice.so.58...done.
Reading symbols from /usr/lib/libavutil.so.56...done.
Reading symbols from /usr/lib/libavcodec.so.58...done.
Reading symbols from /usr/lib/libswresample.so.3...done.
Reading symbols from /usr/lib/libzmq.so.5...done.
Reading symbols from /usr/lib/libRKAP_3A.so...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libRKAP_ANR.so...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libRKAP_Common.so...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libv4l2.so.0...(no debugging symbols found)...done.
Reading symbols from /usr/lib/librga.so.2...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libmd_share.so...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libod_share.so...(no debugging symbols found)...done.
Reading symbols from /usr/lib/librkaiq.so...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libz.so.1...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libv4lconvert.so.0...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libjpeg.so.62...(no debugging symbols found)...done.
Reading symbols from /lib/libpthread.so.0...(no debugging symbols found)...done.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
Reading symbols from /usr/lib/libjsoncpp.so.19...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libssl.so.1.1...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libcrypto.so.1.1...(no debugging symbols found)...done.
Reading symbols from /lib/libstdc++.so.6...(no debugging symbols found)...done.
Reading symbols from /lib/libm.so.6...(no debugging symbols found)...done.
Reading symbols from /lib/libgcc_s.so.1...(no debugging symbols found)...done.
Reading symbols from /lib/libc.so.6...(no debugging symbols found)...done.
Reading symbols from /lib/ld-linux-armhf.so.3...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libliveMedia.so.61...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libgroupsock.so.8...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libBasicUsageEnvironment.so.1...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libUsageEnvironment.so.3...(no debugging symbols found)...done.
Reading symbols from /lib/libdl.so.2...(no debugging symbols found)...done.
Reading symbols from /lib/librt.so.1...(no debugging symbols found)...done.
Reading symbols from /lib/libatomic.so.1...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libv4l/plugins/libv4l-mplane.so...(no debugging symbols found)...done.
0xa44c3704 in ?? () from /lib/libc.so.6
(gdb) bt
#0 0xa44c3704 in ?? () from /lib/libc.so.6
#1 0xa453e020 in select () from /lib/libc.so.6
#2 0xa5526f74 in ?? () from /usr/lib/libeasymedia.so.1
#3 0xa4a58390 in start_thread () from /lib/libpthread.so.0
#4 0xa454272c in ?? () from /lib/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) q
A debugging session is active.
Inferior 1 [process 695] will be detached.
Quit anyway? (y or n) y
Detaching from program: /userdata/Tampa, process 695