From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16452 invoked by alias); 14 Nov 2008 09:07:31 -0000 Received: (qmail 16369 invoked by uid 22791); 14 Nov 2008 09:07:30 -0000 X-Spam-Check-By: sourceware.org Received: from mail.idnet.net.uk (HELO mail.idnet.net.uk) (212.69.36.63) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 14 Nov 2008 09:06:36 +0000 Received: from [91.135.5.64] by mail.idnet.net.uk (GMS 15.01.3664/NU3963.00.7ca42f0c) with ESMTP id aawonnba for gdb@sourceware.org; Fri, 14 Nov 2008 09:06:29 +0000 Subject: Re: gdb load command flow From: Jeremy Bennett Reply-To: jeremy.bennett@embecosm.com To: gdb@sourceware.org Cc: raja.saleru@iap-online.com In-Reply-To: <59596.210.143.35.18.1226650011.squirrel@www.iap-online.com> References: <33036.210.143.35.19.1225860010.squirrel@www.iap-online.com> <59596.210.143.35.18.1226650011.squirrel@www.iap-online.com> Content-Type: text/plain Date: Fri, 14 Nov 2008 09:07:00 -0000 Message-Id: <1226653589.2943.168.camel@thomas> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 (2.22.3.1-1.fc9) Content-Transfer-Encoding: 7bit X-AuthenticatedSender: jeremy.bennett.embecosm.com@idnet.net.uk 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: 2008-11/txt/msg00114.txt.bz2 On Fri, 2008-11-14 at 03:06 -0500, raja.saleru@iap-online.com wrote: > I would like to know the flow between the gdb and OpenOPCD communication > when the below command is executed. > > (gdb) load > > I understand till the flow > > command_line_handler -> load_command() -> target_load() -> generic_load()-> > > from generic load, how it will communicate with gdbserver of OpenOCD ? Is > it through socket write() or through RSP (remtoe serial protocol) ? for > sending the executable segments into the target for loading ? Hi Raja, target_load() should eventually call target_xfer_partial(), to transfer the bytes to the target. For diagrams of the flow for this and other GDB commands take a look at: http://www.embecosm.com/download/ean3.html The connection to gdbserver will be through RSP. Presumably on the client GDB session you've connected using something like: target remote hostname:port target_xfer_partial() will attempt to use RSP X packets to write the data as binary if the communication channel is 8-bit clean. If not it will use M packets. For a sequence diagram and explanation for this and other GDB commands using RSP take a look at: http://www.embecosm.com/download/ean4.html I'm not hugely familiar with OpenOCD, but I understand that they have their own implementation of gdbserver. In which case I would expect that to be receiving the RSP packets and mapping them into OpenOCD JTAG and using any responses to generate RSP reply packets as required. Any feedback on the above two documents much appreciated. Hope this helps, Jeremy -- Tel: +44 (1202) 416955 Cell: +44 (7970) 676050 SkypeID: jeremybennett Email: jeremy.bennett@embecosm.com Web: www.embecosm.com