This is the mail archive of the gdb@sources.redhat.com 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-h8-stub


>I'm confused. My gdb stub does not support binary downloads, but the gdb acts
>like it does.
>It starts downloading the program as usual:
>(gdb) set remotedebug 1
>(gdb) load
>Loading section .text, size 0x160 lma 0x200000
>Sending packet: $X200000,0:#10...Ack
>Packet received:
>binary downloading NOT suppported by target
>
>note here, the program starts at 0x200000, the gdb sends an 'X' packet with
>that address, but receives nothing back. It concludes there, that since the
>responce to 'X' is empty, binary download is not supported by target.
>
>But then, it sends a bunch of 'M' commands, which have addresses relative to
>the 0x200000 one. But the 0x200000 was sent to target with 'X', and the 'X'
>failed...

You're right about gdb infering that the stub doesn't support 'X' by
the empty response packet.  An empty packet is the response the stub
sends back to the host for any command that it doesn't understand.
Once gdb figures out that 'X' (write binary to memory) isn't supported
by the stub(due to the empy packet), it falls back to trying 'M'
(write hex to memory) and finds that it works(since all stubs are
required to support 'M').  The 'X' command is an extension so 'load'
runs about twice as fast.

-- 
Peter Barada                                   Peter.Barada@motorola.com
Wizard                                         781-852-2768 (direct)
WaveMark Solutions(wholly owned by Motorola)   781-270-0193 (fax)


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