This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: [RFC] upload/download command
On Mon, Nov 17, 2003 at 10:35:12AM -0500, Kris Warkentin wrote:
> > > I would like to keep these things in our protocol but it might be useful
> to
> > > generalize the interface out to core gdb. What I'm thinking is that I
> > > create a general upload/download command that uses a hook into the
> target's
> > > code for any special functionality. We could have a general one for
> native
> > > targets which would basically be 'copy' (probably not all that useful
> but
> > > there for completeness) and just print 'not implemented' for targets
> which
> > > don't define the hooks.
> >
> > Rather don't implement it for native I think... hm, might be easier to
> > test the core parts if we did.
>
> That's what I was thinking....it doesn't really hurt anything.
>
> > > Any ideas, comments, suggestions, etc.?
> >
> > For starters, how about describing how it works in your protocol?
> > Obviously this could be useful to gdbserver. For mechanics, it may
> > want to be another target_read_partial()...
>
> We actually have a remote_fileopen command in our protocol. The host sends
> an open command to the target and then just sends blocks of data for the
> target server to write out. Then a close message tells the remote to close
> it. It's basically identical to an ordinary open command so you can open on
> the remote for reading/writing/etc.
Sounds like a good fit for target_read_partial with the exception that
we don't have open/close right now. I don't think we'd need to add
them for this; for that kind of copy, the remote could assume that it
would keep the file open until we'd read the whole file. Might be more
efficient not to.
> I'm not sure about gdbserver though. Do you even presume the existence of a
> filesystem on the remote?
Yes. Don't confuse gdbserver with the generic remote protocol;
gdbserver is a Unix-equivalent (Linux only right now) stub, using
ptrace.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer