From: Michael Snyder <msnyder@redhat.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: gdb@sources.redhat.com
Subject: Re: A copy/save command ...
Date: Fri, 04 Jan 2002 14:10:00 -0000 [thread overview]
Message-ID: <3C362723.77825C08@redhat.com> (raw)
In-Reply-To: <3C341E2D.6050009@cygnus.com>
Andrew Cagney wrote:
>
> 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>''.
>
> better suggestions welcome.
How about (gdb) unload <filename> <?offsets?>
Not sure what options you might want, but load has offsets, so
unload might want them as well. Maybe an option to specify
file format (srec?)
I once wrote a "reload" command that was an optimized version of "load":
it would iterate thru the object file sections, ignore the read-only
ones,
and for each writeable section it would do a CRC and compare what was
in target memory. Only if they differed, it would download that
section.
You might do something similar (assuming you had an object file):
iterate thru the sections, take the memory ranges for the writeable
ones, and copy those ranges to your output file (perhaps in a
format such as srec which GDB already knows how to reload later).
next prev parent reply other threads:[~2002-01-04 22:10 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-03 1:02 Andrew Cagney
2002-01-03 12:58 ` Daniel Jacobowitz
2002-01-03 20:29 ` Andrew Cagney
2002-01-04 9:39 ` Frank Ch. Eigler
2002-01-04 11:54 ` Daniel Jacobowitz
2002-01-04 12:57 ` Andrew Cagney
2002-01-04 13:02 ` Frank Ch. Eigler
2002-01-04 13:24 ` Andrew Cagney
2002-01-04 14:12 ` Michael Snyder
2002-01-04 14:48 ` Grant Edwards
2002-01-04 14:10 ` Michael Snyder [this message]
2002-01-17 16:27 ` Andrew Cagney
2002-01-17 17:14 ` Frank Ch. Eigler
2002-02-08 13:55 ` Andrew Cagney
2002-02-23 10:24 ` Andrew Cagney
2002-01-17 17:29 ` Vlasios Tsiatsis
2002-02-08 13:24 ` Andrew Cagney
2002-01-17 23:20 ` Eli Zaretskii
[not found] <1010165997.16220.ezmlm@sources.redhat.com>
2002-01-04 12:03 ` Edward Swarthout
2002-01-04 12:48 ` Andrew Cagney
2002-01-04 13:18 ` Edward Swarthout
2002-01-04 14:14 ` Michael Snyder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3C362723.77825C08@redhat.com \
--to=msnyder@redhat.com \
--cc=ac131313@cygnus.com \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox