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: A copy/save command ...


> Hello,
> 
> To toss out an idea.  One of those oft mentioned missing features is a command to read/write binary data to/from GDB's target memory.  There is the load command, but that works on object files (readable via BFD).
> 
> Anyway, I've two vague thoughts on the syntax/semantics:
> 
> 1. (gdb) copy <expression> <file>
> 
> The result of <expression> is written to the raw file.  This expoits the fact that GDB stores an expression in target form in host memory. Consequently, the copy command just writes that raw data to the file.
> 
> 
> 2. (gdb) copy <address> <length> <file>
> or (gdb) copy/<length> <address> <file>
> 
> or similar.  A more traditional <address>/<length> approach. ``copy/<length>'' comes from ``x/<length>''.


First, lets forget I suggested ``copy'' :-)

The next thought was ``image load'' et.al. I think this overlaps the 
existing ``load'' command so, intead of having two very similar commands 
the load could just be tweeked as needed.

The next was a more explicit save / unload / ...  Michael's added 
``generate-core-file'' following following on from that my next guess is 
to change that command to:

	(gdb) generate core-file <file>

and then also add things like:

	(gdb) generate <target> <file> <arguments/sections>

for instance:

	(gdb) generate binary afile <address> <address> ...

(I think the word binary is unfortunate but that is what BFD calls it).

Andrew


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