This is the mail archive of the
mailing list for the GDB project.
Re: A copy/save command ...
- From: Andrew Cagney <ac131313 at cygnus dot com>
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Thu, 17 Jan 2002 19:27:55 -0500
- Subject: Re: A copy/save command ...
- References: <3C341E2D.firstname.lastname@example.org>
> 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>
(gdb) generate binary afile <address> <address> ...
(I think the word binary is unfortunate but that is what BFD calls it).