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


On Thu, Jul 18, 2002 at 10:26:30AM -0400, Peter Barada wrote:
> 
> >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.

Right.  The corollary is that M and X should be using the same address. 
This works for most targets; you'll need to figure out why it doesn't
work for yours.  It may be a VMA/LMA thing...

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


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