This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: remote serial protocol - gdbserver
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: Raja Saleru <iap_sraja at access dot co dot jp>
- Cc: saleru dot raja at iap-online dot com, gdb at sources dot redhat dot com
- Date: Sat, 11 Oct 2003 11:40:11 -0400
- Subject: Re: remote serial protocol - gdbserver
- References: <000001c38eed$89aa2b50$88444e9d@access.co.jp>
My wild guess appears to be correct ...
(gdb) l
53 T_RFLG pk_rflg;
54 T_RVER pk_rver;
55
56 INT err;
57
58 mmUserPrint(" Enter Root task\n");
59
60 /* o[WQ?*/
61 err = tk_ref_ver( &pk_rver );
62 if( err != E_OK)
(gdb) n
Sending packet: $m8c5e83d4,2#03...Ack
Packet received: 04d1
Sending packet: $M8c5e83d4,2:20c3#15...Ack
Packet received: OK
Sending packet: $s#73...Ack
Packet received: T0510:1e845e8c;0e:1466658c;0f:da835e8c;
Sending packet: $s#73...Ack
Packet received: T0510:20845e8c;0e:1466658c;0f:da835e8c;
Sending packet: $s#73...Ack
Packet received: T0510:22845e8c;0e:1466658c;0f:da835e8c;
Sending packet: $s#73...Ack
Packet received: T0510:2874008c;0e:1466658c;0f:26845e8c;
I'm guessing that 2874008c is the PC in little-endian byte order. It's
just stepped the target into mmUserPrint.
Sending packet: $Hg2#e1...Ack
Packet received: OK
Sending packet: $g#67...Ack
Packet received:
000000002874008ca866658c00000000b0935e8ca866658c000000000000000000000000
00000000000000000000000000000000000000001466658c26845e8c2874008c00000000
0000008c0000000000000000000000000000006008000000000000000000000004000000
000000002e000000040000000000000000000000487d0000180000001600000004000000
040000000c00000039000000080000000300000000000000c81200000000000000000000
0000000004000000000000003e000000010000000000000000000000c812000030000000
000000000000000001000000000000004c000000
It's pulled the target's registers looking for the "link-register" which
should contain the return address.
Sending packet: $m0,2#fb...Ack
------------------------------------- <1>
Packet received: b0935e8c
Sending packet: $M0,2:20c3#0d...Ack
and then sets a breakpoint at that return-address. For some reason GDB
think's that's zero (bad packet? bad gdb?).
BTW: "b0935e8c" is a bogus return value for "$m0,2,#fb", only two bytes
were requested but four were returned, which is wrong (at present).
Andrew
------------------------------------- <2>
Packet received: OK
Sending packet: $c#63...Ack
Packet received: T0510:2874008c;0e:1466658c;0f:26845e8c;
Program received signal SIGTRAP, Trace/breakpoint trap.