This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: A copy/save command ...
- From: Andrew Cagney <ac131313 at cygnus dot com>
- To: gdb at sources dot redhat dot com
- Cc: "Frank Ch. Eigler" <fche at redhat dot com>
- Date: Fri, 08 Feb 2002 16:54:57 -0500
- Subject: Re: A copy/save command ...
- References: <3C341E2D.6050009@cygnus.com> <3C476C0B.90009@cygnus.com> <o5sn948npy.fsf@tooth.toronto.redhat.com>
> cagney wrote:
>
>
>> [...]
>> 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> ...
>> [...]
>
>
> That looks good. (Please consider "dump" or "emit" or "unload" or
> "save" (yes, asking the tracepoint save function to be renamed) or
> something instead of "generate" as the verb though.)
Renameing ``save-tracepoints'' is possible using the deprecate command
mechanism. But perhaphs ``save'' should be reserved for GDB things.
``unload'' reminds me too much of shared libraries. But close to that
is ``upload'' as suggested in the earlier thread the other is ``dump''.
I show both below:
upload value <file> <expression>
dump value <file> <expression>
write the TARGET value of
<expression> as a sequence
of bytes.
upload memory <file> <start> <length>
dump memory <file> <start> <length>
write memory from <start> to
<start>+<length>-1 as bytes.
While:
(*(char*)START)@LENGTH
is equvalent this would be
more efficient.
upload core <file>
dump core <file>
Hmm, the latter parses well.
With the option:
/a append to file
(assuming I can get it to work and where applicable :-).
As for creating files in different formats objcopy can be used but that
certainly doesn't preclude extra options being added.
Example:
shell rm goo
upload value/a goo (uint32) 0xdeadbeef
upload value/a goo (uint8) 2
upload value/a goo (uint8) 3
would write:
BE: de ad be ef 02 03
LE: ef be ad de 02 03
to a file.
thoughts?
Andrew