[RFC] upload/download command

Andrew Cagney ac131313@redhat.com
Mon Nov 17 15:42:00 GMT 2003


> Our QNX pdebug protocol supports an upload/download command.  This is handy
> for putting binaries onto target system and getting back things like
> corefiles.  Andrew had wanted me to start a discussion on the subject.
> 
> 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.
> 
> Any ideas, comments, suggestions, etc.?

Now that there's a generic xfer mechanism in the target vector, I think 
it is possible to implement this using something like:

	target_xfer_partial (&current_target, TARGET_OBJECT_FILE, 
<name-of-file-on-target>, <readbuf>, <writebuf>, <offset>, <length>)

(but suitably wrapped with target_read_file and target_write_file methods)

Andrew




More information about the Gdb mailing list