RE: Remote communication error

Xinan Tang
2004-09-24T22:21:12Z

Hi

Does this address (0xec2d0) have a special meaning, such as I/O
device?

The timeout occurred when gdb tries to read 4 bytes from this address.
Since all other 'm' commands worked previously, it is kind of strange to
see this 'm' command failed.

Good luck

--Xinan

-----Original Message-----
From: gdb-owner@sources.redhat.com [mailto:gdb-owner@sources.redhat.com]
On Behalf Of Lan Zhang
Sent: Friday, September 24, 2004 2:58 PM
To: gdb@sources.redhat.com
Subject: RE: Remote communication error

Yes, I set the debug serial to 1, but I cannot see any clue from that.
It just stopped there when it tries to read a memory, and it didn't
depend on the memory address, it could stop at any address. And it also
stopped sometime when host try to get response for "$s#" packet, and pop
out same message.

I tried to change remotetimeout value, and it didn't help also.

I think it could be USB buffer problem on host. But I have no idea how
to debug this debugger bug and how to check the USB in and out buffer.

By the way, I am not using the standard GDB, my target is arm processor,
and I used armcc compiler, so I check out some version which works for
this special symbol table from CVS.

What can I do?

Thanks a lot.

Lan

(gdb-usb) r
usbname name= /dev/usb/lp0
ops->name = usb
usb open
Found TI** device
Sending packet: $Hc-1#09...Ack
Packet received: T050f:4cc30e00;0d:7c066300;
Sending packet: $qC#b4...Ack
Packet received:
Sending packet: $qOffsets#4b...Ack
Packet received:
Sending packet: $?#3f...Ack
Packet received:
target_terminal_ours ()
warning: Invalid remote reply:
Packet received: S05
target_wait (-1, status) = 42000, status->kind = stopped, signal =
SIGTRAP
Sending packet: $Hg0#df...Ack
Packet received: OK
Sending packet: $g#67...Ack
Packet received:
0000000013000060c0445b00000000001600000000000000010000000100000000000000
0000000038c7620034076300a50affff7c066300a8df09004cc30e001300002013000020
target_fetch_registers (pc) = 4cc30e00 0xec34c 967500
target_terminal_ours_for_output ()
target_terminal_ours ()
FirstMode () at ../fp/fp.c:1054
remote name line 2280 = /dev/usb/lp0
(gdb-usb) set debug serial 1
(gdb-usb) n
Sending packet: $mec2b0,4#59...[+]Ack
[$][0][4][e][0][2][d][e][5][#][2][9]Packet received: 04e02de5
target_xfer_memory (0xec2b0, xxx, 4, read, xxx) = 4, bytes = 04 e0 2d e5
Sending packet: $mec2b4,4#5d...[+]Ack
[$][2][c][d][0][4][d][e][2][#][5][8]Packet received: 2cd04de2
target_xfer_memory (0xec2b4, xxx, 4, read, xxx) = 4, bytes = 2c d0 4d e2
...
...
...
Sending packet: $mec2c8,4#62...[+]Ack
[$][1][4][0][0][9][d][e][5][#][f][c]Packet received: 14009de5
target_xfer_memory (0xec2c8, xxx, 4, read, xxx) = 4, bytes = 14 00 9d e5
Sending packet: $mec2cc,4#8d...[+]Ack
[$][0][0][0][0][5][0][e][3][#][b][d]Packet received: 000050e3
target_xfer_memory (0xec2cc, xxx, 4, read, xxx) = 4, bytes = 00 00 50 e3
Sending packet: $mec2d0,4#5b...[<Error: Connection timed
out>]target_terminal_ours ()
Remote communication error: Connection timed out.
Sending packet: $z0,ec394,4#9e...[<Error: Connection timed
out>]target_terminal_ours ()
Remote communication error: Connection timed out.
(gdb-usb)

FROM GDB log:

w +$Hc-1#09
r +$T050f:4cc30e00;0d:7c066300;#b8
w +$qC#b4
r +$#00
w +$qOffsets#4b
r +$#00
w +$?#3f
r +$#00
w +
r +$S05#b8
w +$Hg0#df
r +$OK#9a
w +$g#67
r
+$0000000013000060c0445b000000000016000000000000000100000001000000000000
000000000038c7620034076300a50affff7c066300a8df09004cc30e0013000020130000
20#cb
w +
c set debug serial 1
c n
w $mec2b0,4#59
r +$04e02de5#29
w +$mec2b4,4#5d
...
...
...
w +$mec2cc,4#8d
r +$000050e3#bd
w +$mec2d0,4#5b
r <Error: Connection timed out>
w $z0,ec394,4#9e
r <Error: Connection timed out>

-----Original Message-----
From: Andrew Cagney [mailto:cagney@gnu.org]
Sent: Friday, September 24, 2004 4:49 PM
To: Lan Zhang
Cc: gdb@sources.redhat.com
Subject: Re: Remote communication error

> Hi,
>
> I set up a remote debug using USB port. I got some message like:
> Remote communication error: Connection timed out. And this can happen
> at the begin of the debug or after I already did some debug commands.
> But the whole remote debug works fine for the serial port. I think I
> didn't add USB interface correctly. Could anyone point me which code
> related to the remote communication error, and why this happens?
>
> Thanks a lot

That it works with a simple serial device and not USB suggests a bug in
the kernel or h/w. GDB (assuming this is with a standard GDB) uses
identical code to drive both devices.

You can use "(gdb) set debug serial" to see exactly what GDB is doing
when it hangs.

ANdrew