gdb出错:Can't attach LWP 3001: No such process
ksappsvr程序是fork出来的子进程,其中有多个线程,但是启动gdb调试就出现core dump,并且core dump的位置就是我设置断点的位置,希望高手指点
[test@CLINUX testqhsrv]$ gdb ksappsvr
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...
(gdb) attach 3003
Attaching to program: /home/test/testqhsrv/ksappsvr, process 3003
Reading symbols from /usr/lib/libstdc++.so.5...done.
Loaded symbols for /usr/lib/libstdc++.so.5
Reading symbols from /lib/tls/libpthread.so.0...done.
[New Thread 1074882848 (LWP 3001)]
Error while reading shared library symbols:
Can't attach LWP 3001: No such process
Reading symbols from /lib/tls/libm.so.6...done.
Loaded symbols for /lib/tls/libm.so.6
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/tls/libc.so.6...done.
Loaded symbols for /lib/tls/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
0xffffe002 in ?? ()
(gdb) b pushthread.cpp:156
Breakpoint 1 at 0x806520f: file pushthread.cpp, line 156.
(gdb) c
Continuing.
Segmentation fault
[test@CLINUX testqhsrv]$ gdb ksappsvr
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...
(gdb) attach 3003
Attaching to program: /home/test/testqhsrv/ksappsvr, process 3003
Reading symbols from /usr/lib/libstdc++.so.5...done.
Loaded symbols for /usr/lib/libstdc++.so.5
Reading symbols from /lib/tls/libpthread.so.0...done.
[New Thread 1074882848 (LWP 3001)]
Error while reading shared library symbols:
Can't attach LWP 3001: No such process
Reading symbols from /lib/tls/libm.so.6...done.
Loaded symbols for /lib/tls/libm.so.6
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/tls/libc.so.6...done.
Loaded symbols for /lib/tls/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
0xffffe002 in ?? ()
(gdb) b pushthread.cpp:156
Breakpoint 1 at 0x806520f: file pushthread.cpp, line 156.
(gdb) c
Continuing.
Segmentation fault
...全文
相关推荐
GDB设计原理
- 例如,可以通过`kill_lwp(process->head.id, SIGSTOP);`来实现这一目的。#### 五、同步与异步模式GDB有两种工作模式:同步模式和异步模式。
详解Linux获取线程的PID(TID、LWP)的几种方式
线程的标识符主要有两种形式:TID(Thread ID,线程ID)和LWP(Lightweight Process,轻量级进程)。
Live-debug-a-running-Process
process, we can follow these steps:1.
Debugging with GDB 用GDB调试多线程程序
- **LWP (Lightweight Process)**:轻量级进程,是内核层面的线程表示形式。- **GDB ID**:GDB为每个线程分配的唯一标识符,用于后续的线程操作。
GDB调试 Gdb 使用流程
Inferior 1 [process 1234] will be killed.Quit anyway?


