From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23331 invoked by alias); 2 Oct 2007 21:49:19 -0000 Received: (qmail 23322 invoked by uid 22791); 2 Oct 2007 21:49:19 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 02 Oct 2007 21:49:15 +0000 Received: (qmail 25201 invoked from network); 2 Oct 2007 21:49:13 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 2 Oct 2007 21:49:13 -0000 To: "xchen" Cc: Subject: Re: gdbserver can't run over serial References: <20070929073901.E3B7911F80B@lax-gw07.mroute.net> From: Jim Blandy Date: Tue, 02 Oct 2007 21:49:00 -0000 In-Reply-To: <20070929073901.E3B7911F80B@lax-gw07.mroute.net> (xchen@sunrisetelecom.com.cn's message of "Sat, 29 Sep 2007 15:39:43 +0800") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2007-10/txt/msg00026.txt.bz2 "xchen" writes: > Firstly gdb connected with gdbserver, then gdbserver was silent. > Remotebaud was 9600 and remotedevice was /dev/ttyS0. I set debug remote 1 > and see lots of msg. But I don't understand it at all. Belowed is snapshot > > ./gdbserver /dev/ttyS0 hellogdb > Process hellogdb created; pid = 245 > Remote debugging using /dev/ttyS0 If you're curious, the remote protocol is documented in Appendix D of the GDB manual. Your transcript at least shows that gdb and gdbserver are talking to each other happily. If you were to simply run 'hellogdb' instead of './gdbserver ... hellogdb', where would hellogdb's stdout go? Would it go to /dev/ttyS0 too? If so: GDB silently consumes any extraneous characters it receives between packets, so GDB may be simply eating your output.