Summary: | attach to multithreaded process does not show threads in Frame Stack | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | Chris Halls <halls> |
Component: | CPP Debugger | Assignee: | KDevelop Developers <kdevelop-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Proposed fix for problem |
Description
Chris Halls
2003-10-16 15:42:11 UTC
Created attachment 2789 [details]
Proposed fix for problem
This fixes the problem on my system. Tested with gdb 5.3 and 6.0.
Can't confirm your behaviour: $ gdb /usr/local/kde3/bin/kdeinit GNU gdb 5.3 [...] (gdb) attach 131801 [...] Reading symbols from /lib/libpthread.so.0...done. [New Thread 16384 (LWP 131801)] [New Thread 32769 (LWP 131802)] [New Thread 16386 (LWP 131803)] Loaded symbols for /lib/libpthread.so.0 [...] 0x415590e1 in select () from /lib/libc.so.6 (gdb) info threads 3 Thread 16386 (LWP 131803) 0x414b0f56 in sigsuspend () from /lib/libc.so.6 2 Thread 32769 (LWP 131802) 0x41557173 in poll () from /lib/libc.so.6 1 Thread 16384 (LWP 131801) 0x415590e1 in select () from /lib/libc.so.6 (I made all non-trivial KDE applications multithreaded) Yes, you're right - my description of the problem was wrong. I was debugging an internal program at the time which is why I didn't post the log in the report. But I can reproduce the problem by attaching to openoffice in the debugger too, so here's how to reproduce: - Start openoffice - Open kdevelop and choose attach to process. - Look at Frame Stack - only one thread is shown, but there should be several. This is the kdevelop gdb window contents: /bin/sh -c /home/challs/dev/prjatm/services/model/comms/libtool gdb -fullname -nx -quiet (gdb) set edit off (gdb) set confirm off (gdb) (gdb) (gdb) set print static-members off (gdb) tty /dev/pts/1 (gdb) set width 0 (gdb) set height 0 (gdb) set stop-on 1 (gdb) handle SIG32 pass nostop noprint (gdb) handle SIG43 pass nostop noprint (gdb) set print asm-demangle on (gdb) cd /home/challs/dev/prjatm/services/model/comms/modelsrv (gdb) attach 13456 (gdb) backtrace (no debugging symbols found)... [repeated lots of times, deleted] [New Thread 16384 (LWP 11803)] [New Thread 32769 (LWP 12502)] [New Thread 16386 (LWP 12503)] [New Thread 32771 (LWP 12592)] [New Thread 49156 (LWP 12596)] [New Thread 65541 (LWP 13456)] (no debugging symbols found)... [multiple times] 0x410e6666 in poll () from /lib/libc.so.6 #0 0x410e6666 in poll () from /lib/libc.so.6 #1 0x44fd42d5 in ?? () from /usr/lib/openoffice/program/libdtransX11645li.so #2 0x44fd4433 in ?? () from /usr/lib/openoffice/program/libdtransX11645li.so #3 0x4136631b in osl_getTextEncodingFromLocale () from /usr/lib/openoffice/program/libsal.so.3 #4 0x4114cc00 in pthread_start_thread () from /lib/libpthread.so.0 #5 0x410eeae7 in clone () from /lib/libc.so.6 (gdb) frame 0 #0 0x410e6666 in poll () from /lib/libc.so.6 (gdb) frame 5 #5 0x410eeae7 in clone () from /lib/libc.so.6 (gdb) frame 0 #0 0x410e6666 in poll () from /lib/libc.so.6 The Frame Stack window should at this point be displaying all of the threads, but it only shows the one that gdb displayed in the 'backtrace' output. Kdevelop did not switch on s_viewThreads and send an 'info threads' request. With the patch applied, this happens: /bin/sh -c /home/challs/dev/prjatm/services/model/comms/libtool gdb -fullname -nx -quiet (gdb) set edit off (gdb) set confirm off (gdb) (gdb) (gdb) set print static-members off (gdb) tty /dev/pts/9 (gdb) set width 0 (gdb) set height 0 (gdb) set stop-on 1 (gdb) handle SIG32 pass nostop noprint (gdb) handle SIG43 pass nostop noprint (gdb) set print asm-demangle on (gdb) cd /home/challs/dev/prjatm/services/model/comms/modelsrv (gdb) attach 12596 (gdb) backtrace (no debugging symbols found)... [New Thread 16384 (LWP 11803)] [New Thread 32769 (LWP 12502)] [New Thread 16386 (LWP 12503)] [New Thread 32771 (LWP 12592)] [New Thread 49156 (LWP 12596)] [New Thread 65541 (LWP 13456)] (no debugging symbols found)... 0x410e6666 in poll () from /lib/libc.so.6 #0 0x410e6666 in poll () from /lib/libc.so.6 #1 0x425bb3f5 in ICEConnectionWorker () from /usr/lib/openoffice/program/libvcl645li.so #2 0x4136631b in osl_getTextEncodingFromLocale () from /usr/lib/openoffice/program/libsal.so.3 #3 0x4114cc00 in pthread_start_thread () from /lib/libpthread.so.0 #4 0x410eeae7 in clone () from /lib/libc.so.6 (gdb) info thread 6 Thread 65541 (LWP 13456) 0x410e6666 in poll () from /lib/libc.so.6 5 Thread 49156 (LWP 12596) 0x410e6666 in poll () from /lib/libc.so.6 4 Thread 32771 (LWP 12592) 0x411532c6 in nanosleep () from /lib/libpthread.so.0 3 Thread 16386 (LWP 12503) 0x41152cf8 in accept () from /lib/libpthread.so.0 2 Thread 32769 (LWP 12502) 0x410e6666 in poll () from /lib/libc.so.6 1 Thread 16384 (LWP 11803) 0x410e8551 in select () from /lib/libc.so.6 (gdb) frame 0 #0 0x410e6666 in poll () from /lib/libc.so.6 Note the new 'info thread'. And kdevelop shows all the threads. I hope that description is a little clearer :) Seems very reasonable to me, and a good looking patch Committed Thanks :-) |