From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28016 invoked by alias); 11 Nov 2010 05:52:27 -0000 Received: (qmail 28006 invoked by uid 22791); 11 Nov 2010 05:52:26 -0000 X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_05,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-fx0-f41.google.com (HELO mail-fx0-f41.google.com) (209.85.161.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 11 Nov 2010 05:52:20 +0000 Received: by fxm20 with SMTP id 20so1077737fxm.0 for ; Wed, 10 Nov 2010 21:52:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.96.131 with SMTP id h3mr53078fan.72.1289454737287; Wed, 10 Nov 2010 21:52:17 -0800 (PST) Received: by 10.223.86.139 with HTTP; Wed, 10 Nov 2010 21:52:17 -0800 (PST) Date: Thu, 11 Nov 2010 05:52:00 -0000 Message-ID: Subject: gdbserver delayed packet event issue From: "karthikeyan.s" To: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-11/txt/msg00045.txt.bz2 Hi, I am seeing an issue with the gdb remote debugging, this is gdb 7.1.50 version. I have marked the erroneous states with line --> below. gdbserver sometimes gets a delayed event for the packet QStartNoAckMode sent from the host. In the case pasted below gdbserver gets two events clubbed together when the client has sent the second "QStartNoAckMode" packet after its timeout. At this stage, gdbserver ends up sending two "$OK" while the client is expecting only one and the state gets messed up between client and server. 1) It seems that the client does not handle issues with the network. Instead it assumes the packet is lost on a timeout. 2) Why doesn't gdbserver get an event on the first request itself. I used writeshark on the client side to confirm the packet is being sent. And tcpdump on the remote side to see that the packet does come in at the target. Any help is appreciated Thanks, Karthik ---------- getpkt ("qSupported"); [sending ack] [sent ack] putpkt ("$PacketSize=3D3fff;QPassSignals+;qXfer:libraries:read+;qXfer:auxv:= read+;qXfer:spu:read+;qXfer:spu:write+;qXfer:siginfo:read+;qXfer:siginfo:wr= ite+;qXfer:features:read+;QStartNoAckMode+;qXfer:osdata:read+;multiprocess+= ;QNonStop+;qXfer:threads:read+#31"); [looking for ack] [received '+' (0x2b)] -->handling possible serial event -->getpkt ("QStartNoAckMode"); [sending ack] -->[sent ack] -->[noack mode enabled] -->putpkt ("$OK#9a"); [noack mode] -->handling possible serial event -->getpkt ("QStartNoAckMode"); [no ack sent] -->[noack mode enabled] -->putpkt ("$OK#9a"); [noack mode] handling possible serial event [getpkt: discarding char '+'] getpkt ("Hg0"); [no ack sent] putpkt ("$OK#9a"); [noack mode] handling possible serial event getpkt ("qXfer:features:read:target.xml:0,fff"); [no ack sent] putpkt ("$l #44"); [noack mode] handling possible serial event readchar: Got EOF [getpkt: discarding char '=FF'] -------