This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gdb load command flow


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]