This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: gdb load command flow
- From: Jeremy Bennett <jeremy dot bennett at embecosm dot com>
- To: gdb at sourceware dot org
- Cc: raja dot saleru at iap-online dot com
- Date: Fri, 14 Nov 2008 09:06:29 +0000
- Subject: Re: gdb load command flow
- References: <33036.210.143.35.19.1225860010.squirrel@www.iap-online.com> <59596.210.143.35.18.1226650011.squirrel@www.iap-online.com>
- Reply-to: jeremy dot bennett at embecosm dot com
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