From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4653 invoked by alias); 4 Jan 2002 22:10:13 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 4499 invoked from network); 4 Jan 2002 22:10:06 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 4 Jan 2002 22:10:06 -0000 Received: from redhat.com (reddwarf.cygnus.com [205.180.231.12]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id OAA17686; Fri, 4 Jan 2002 14:10:05 -0800 (PST) Message-ID: <3C362723.77825C08@redhat.com> Date: Fri, 04 Jan 2002 14:10:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2smp i686) X-Accept-Language: en MIME-Version: 1.0 To: Andrew Cagney CC: gdb@sources.redhat.com Subject: Re: A copy/save command ... References: <3C341E2D.6050009@cygnus.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-01/txt/msg00019.txt.bz2 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 > > The result of 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
> or (gdb) copy/
> > or similar. A more traditional
/ approach. > ``copy/'' comes from ``x/''. > > better suggestions welcome. How about (gdb) unload 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).