Can't able to debug multi-threaded applications using Cross GDB

viju vincent vijuvince@gmail.com
Sat Aug 7 07:51:00 GMT 2010


Hi all,

       I am trying to do debug of multi threaded application using
Cross GDB on OMAP3 target ,

The GDB version i am using is 6.8

While debugging, cross gdb waits for remote gdbserver packets while
creating thread.

I am trying the GDB testcase print-threads.exp

From host side :
{{{
remote debugging using 10.0.1.2:2345
[New Thread 711]
0x400007a0 in _start () from /home/rpmuser/armv7a/devel/lib/ld-linux.so.3
(gdb) b main
Breakpoint 1 at 0x8524: file print-threads.c, line 19.
(gdb) c
Continuing.

Breakpoint 1, main () at print-threads.c:19
19          for (i = 0; i < NUM; i++)
(gdb) break thread_function
Breakpoint 2 at 0x863c: file print-threads.c, line 37.
(gdb) set var slow=0
(gdb) c
Continuing.

}}}

 GDB waits here..

After enabling set debug remote
{{{
Sending packet: $m863c,4#d1...Ack
Packet received: 10301be5
Sending packet: $X863c,4: \001  #be...Ack
Packet received: OK
Sending packet: $vCont;c#a8...Ack

}}}

Cross GDB waits for gdbserver packet after sending "$vCont;c#a8"

Expected output from cross GDB
{{{
(gdb) b thread_function
Breakpoint 2 at 0x863c: file print-threads.c, line 37.
(gdb) set var slow = 0
(gdb) c
Continuing.
[New Thread 781]
[Switching to Thread 781]

Breakpoint 2, thread_function (arg=0xbefb79e4) at print-threads.c:37
37          int my_number = *(int *)arg;
(gdb) c
}}}

Enabled set debug remote option on Cross GDB
{{{
Sending packet: $m863c,4#d1...Ack
Packet received: 10301be5
Sending packet: $X863c,4: \001  #be...Ack
Packet received: OK
Sending packet: $vCont;c#a8...Ack
Packet received: T050b:2c9e1741;0d:189e1741;0f:3c860000;thread:315;
[New Thread 789]
Sending packet: $g#67...Ack
Packet received:
e8d9b7be90a41741389e174190a41741d8a4174190a417410cc2024052010000000f3d0000000000408903402c9e1741309e1741189e1741b0c202403c8600000000000000000000f43f01000000000000000000f43f01000000000000000000f43f01000000000000000000f43f01000000000000000000f43f01000000000000000000f43f01000000000000000000f43f01000000000000000000f43f01000000000010000060
Sending packet: $g#67...Ack
Packet received:
e8d9b7be90a41741389e174190a41741d8a4174190a417410cc2024052010000000f3d0000000000408903402c9e1741309e1741189e1741b0c202403c8600000000000000000000f43f01000000000000000000f43f01000000000000000000f43f01000000000000000000f43f01000000000000000000f43f01000000000000000000f43f01000000000000000000f43f01000000000000000000f43f01000000000010000060
}}}

Expected is a "thread alive" packets
(T050b:2c9e1741;0d:189e1741;0f:3c860000;thread:315) from gdbserver
and cross GDB should switch into the newly created thread.

In above example cross GDB switch into thread no 789


Can you please tell me what are the possible issues makes cross
debugging of multi threaded application to FAIL



Thanks and regards
Viju



More information about the Gdb mailing list