Remote Multithread debugging problems
Hi all,
Im trying to debug a multi-threaded application using gdbserver on the remote/target side and Im having some problems, the output I got is depicted below:
TARGET SIDE:(NORMAL OUTPUT)
--------------------------------------------------------------------
# threadTest
Break Function Reached
Init....
Passed 0 times
Main Thread
Passed 1 times
Main Thread
Passed 2 times
Main Thread
Passed 3 times
TARGET SIDE:(DEBUGGING)
--------------------------------------------------------------------
# gdbserver :6666 /bin/threadTest Process /bin/threadTest created; pid = 32 Remote debugging from host 192.168.0.155 Break Function Reached Init.... Passed 0 times GDB bug: target.c (target_signal_from_host): unrecognized real-time signal Passed 1 times Passed 2 times Passed 3 times Passed 4 times
HOST SIDE:
--------------------------------------------------------------------
(gdb) target remote 192.168.0.238:6666 0x30012f40 in ?? ()
(gdb) add-symbol-file /usr/src/threadTest 0x30012f40 add symbol table from file "/usr/src/threadTest" at
.text_addr = 0x30012f40
(gdb) b funcToBreak
Breakpoint 1 at 0x300131b8: file threadTest.c, line 42.
(gdb) b main
Breakpoint 2 at 0x30013130: file threadTest.c, line 22.
(gdb) c
Breakpoint 1, funcToBreak () at threadTest.c:42 (gdb) next
(gdb) c
Breakpoint 1, funcToBreak () at threadTest.c:42 (gdb) next
(gdb) c
Breakpoint 1, funcToBreak () at threadTest.c:42 (gdb) c
Breakpoint 1, funcToBreak () at threadTest.c:42 (gdb) c
Breakpoint 1, funcToBreak () at threadTest.c:42 (gdb) c
Breakpoint 1, funcToBreak () at threadTest.c:42 (gdb) c
Breakpoint 1, funcToBreak () at threadTest.c:42 (gdb) c
Breakpoint 1, funcToBreak () at threadTest.c:42 (gdb) c
Breakpoint 1, funcToBreak () at threadTest.c:42 (gdb) c
Breakpoint 1, funcToBreak () at threadTest.c:42 (gdb) c
Breakpoint 1, funcToBreak () at threadTest.c:42 (gdb) c
Breakpoint 1, funcToBreak () at threadTest.c:42 (gdb) c
---------------------------------------------------------------------
Note that till the last continue, nothing have been written on the target`s console, it seems like gdb and gdbserver are having problems and do restart the application several times... and finally the main thread is killed(!?).
And if I try info threads, I got this:
(gdb) info threads
warning: RMT ERROR : failed to get remote thread list
Im using gdbserver5.2.1 (I tried the one from HHL-2.0 Journeyman and didnt worked too) compiled by myself using Mvista HHL 2.0 tools and gdb 5.2.1 on my i386. Am I doing something wrong or remote thread debugging is not supported by gdb? I have read something about problems with multi-thread application debugging but I thought that it may be OK at this time... Could someone explain to me whats happening? Ive attached de source of threadTest application on this mail...
Any comment, insight and/or help will be very appreciate,
thanks in advance,
Owen.
Dear Owen,
Quoted 4 lines · in message <[email protected]> you wrote:
I
m trying to debug a multi-threaded application using gdbserver on the remote/target side and Im having some problems, the output I got is depicted below:
I'm not surprised. This is broken in most versions of GDB / gdbserver floating around.
Quoted 5 lines
I
m using gdbserver5.2.1 (I tried the one from HHL-2.0 Journeyman and didnt worked too) compiled by myself using Mvista HHL 2.0 tools and gdb 5.2.1 on my i386. Am I doing something wrong or remote thread debugging is not supported by gdb? I have read something about
Let's say the support is incomplete :-)
Quoted 3 lines
problems with multi-thread application debugging but I thought that it may be OK at this time... Could someone explain to me what`s happening?
Check out our ELDK (see http://www.denx.de/ELDK); it contains an extended / bug fixed version of GDB / gdbserver; remote target debugging of MT applications was one of the areas where we spend some work.
If you're just looking for the patches: these can be found on our FTP server; the README including description of the test procedure is at ftp://ftp.denx.de/pub/ppc/patches/README-GDB-MT-Support
Hope this helps.
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: [email protected] That's the thing about people who think they hate computers. What they really hate is lousy programmers.
- Larry Niven and Jerry Pournelle in "Oath of Fealty"
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/