| 
							- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 - <html>
 - <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
 - 
 - Permission is granted to copy, distribute and/or modify this document
 - under the terms of the GNU Free Documentation License, Version 1.3 or
 - any later version published by the Free Software Foundation; with the
 - Invariant Sections being "Free Software" and "Free Software Needs
 - Free Documentation", with the Front-Cover Texts being "A GNU Manual,"
 - and with the Back-Cover Texts as in (a) below.
 - 
 - (a) The FSF's Back-Cover Text is: "You are free to copy and modify
 - this GNU Manual.  Buying copies from GNU Press supports the FSF in
 - developing GNU and promoting software freedom." -->
 - <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
 - <head>
 - <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 - <title>Dump/Restore Files (Debugging with GDB)</title>
 - 
 - <meta name="description" content="Dump/Restore Files (Debugging with GDB)">
 - <meta name="keywords" content="Dump/Restore Files (Debugging with GDB)">
 - <meta name="resource-type" content="document">
 - <meta name="distribution" content="global">
 - <meta name="Generator" content="makeinfo">
 - <link href="index.html#Top" rel="start" title="Top">
 - <link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
 - <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
 - <link href="Data.html#Data" rel="up" title="Data">
 - <link href="Core-File-Generation.html#Core-File-Generation" rel="next" title="Core File Generation">
 - <link href="Memory-Region-Attributes.html#Memory-Region-Attributes" rel="prev" title="Memory Region Attributes">
 - <style type="text/css">
 - <!--
 - a.summary-letter {text-decoration: none}
 - blockquote.indentedblock {margin-right: 0em}
 - blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
 - blockquote.smallquotation {font-size: smaller}
 - div.display {margin-left: 3.2em}
 - div.example {margin-left: 3.2em}
 - div.lisp {margin-left: 3.2em}
 - div.smalldisplay {margin-left: 3.2em}
 - div.smallexample {margin-left: 3.2em}
 - div.smalllisp {margin-left: 3.2em}
 - kbd {font-style: oblique}
 - pre.display {font-family: inherit}
 - pre.format {font-family: inherit}
 - pre.menu-comment {font-family: serif}
 - pre.menu-preformatted {font-family: serif}
 - pre.smalldisplay {font-family: inherit; font-size: smaller}
 - pre.smallexample {font-size: smaller}
 - pre.smallformat {font-family: inherit; font-size: smaller}
 - pre.smalllisp {font-size: smaller}
 - span.nolinebreak {white-space: nowrap}
 - span.roman {font-family: initial; font-weight: normal}
 - span.sansserif {font-family: sans-serif; font-weight: normal}
 - ul.no-bullet {list-style: none}
 - -->
 - </style>
 - 
 - 
 - </head>
 - 
 - <body lang="en">
 - <a name="Dump_002fRestore-Files"></a>
 - <div class="header">
 - <p>
 - Next: <a href="Core-File-Generation.html#Core-File-Generation" accesskey="n" rel="next">Core File Generation</a>, Previous: <a href="Memory-Region-Attributes.html#Memory-Region-Attributes" accesskey="p" rel="prev">Memory Region Attributes</a>, Up: <a href="Data.html#Data" accesskey="u" rel="up">Data</a>   [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
 - </div>
 - <hr>
 - <a name="Copy-Between-Memory-and-a-File"></a>
 - <h3 class="section">10.18 Copy Between Memory and a File</h3>
 - <a name="index-dump_002frestore-files"></a>
 - <a name="index-append-data-to-a-file"></a>
 - <a name="index-dump-data-to-a-file"></a>
 - <a name="index-restore-data-from-a-file"></a>
 - 
 - <p>You can use the commands <code>dump</code>, <code>append</code>, and
 - <code>restore</code> to copy data between target memory and a file.  The
 - <code>dump</code> and <code>append</code> commands write data to a file, and the
 - <code>restore</code> command reads data from a file back into the inferior’s
 - memory.  Files may be in binary, Motorola S-record, Intel hex,
 - Tektronix Hex, or Verilog Hex format; however, <small>GDB</small> can only
 - append to binary files, and cannot read from Verilog Hex files.
 - </p>
 - <dl compact="compact">
 - <dd>
 - <a name="index-dump"></a>
 - </dd>
 - <dt><code>dump <span class="roman">[</span><var>format</var><span class="roman">]</span> memory <var>filename</var> <var>start_addr</var> <var>end_addr</var></code></dt>
 - <dt><code>dump <span class="roman">[</span><var>format</var><span class="roman">]</span> value <var>filename</var> <var>expr</var></code></dt>
 - <dd><p>Dump the contents of memory from <var>start_addr</var> to <var>end_addr</var>,
 - or the value of <var>expr</var>, to <var>filename</var> in the given format.
 - </p>
 - <p>The <var>format</var> parameter may be any one of:
 - </p><dl compact="compact">
 - <dt><code>binary</code></dt>
 - <dd><p>Raw binary form.
 - </p></dd>
 - <dt><code>ihex</code></dt>
 - <dd><p>Intel hex format.
 - </p></dd>
 - <dt><code>srec</code></dt>
 - <dd><p>Motorola S-record format.
 - </p></dd>
 - <dt><code>tekhex</code></dt>
 - <dd><p>Tektronix Hex format.
 - </p></dd>
 - <dt><code>verilog</code></dt>
 - <dd><p>Verilog Hex format.
 - </p></dd>
 - </dl>
 - 
 - <p><small>GDB</small> uses the same definitions of these formats as the
 - <small>GNU</small> binary utilities, like ‘<samp>objdump</samp>’ and ‘<samp>objcopy</samp>’.  If
 - <var>format</var> is omitted, <small>GDB</small> dumps the data in raw binary
 - form.
 - </p>
 - <a name="index-append"></a>
 - </dd>
 - <dt><code>append <span class="roman">[</span>binary<span class="roman">]</span> memory <var>filename</var> <var>start_addr</var> <var>end_addr</var></code></dt>
 - <dt><code>append <span class="roman">[</span>binary<span class="roman">]</span> value <var>filename</var> <var>expr</var></code></dt>
 - <dd><p>Append the contents of memory from <var>start_addr</var> to <var>end_addr</var>,
 - or the value of <var>expr</var>, to the file <var>filename</var>, in raw binary form.
 - (<small>GDB</small> can only append data to files in raw binary form.)
 - </p>
 - <a name="index-restore"></a>
 - </dd>
 - <dt><code>restore <var>filename</var> <span class="roman">[</span>binary<span class="roman">]</span> <var>bias</var> <var>start</var> <var>end</var></code></dt>
 - <dd><p>Restore the contents of file <var>filename</var> into memory.  The
 - <code>restore</code> command can automatically recognize any known <small>BFD</small>
 - file format, except for raw binary.  To restore a raw binary file you
 - must specify the optional keyword <code>binary</code> after the filename.
 - </p>
 - <p>If <var>bias</var> is non-zero, its value will be added to the addresses
 - contained in the file.  Binary files always start at address zero, so
 - they will be restored at address <var>bias</var>.  Other bfd files have
 - a built-in location; they will be restored at offset <var>bias</var>
 - from that location.
 - </p>
 - <p>If <var>start</var> and/or <var>end</var> are non-zero, then only data between
 - file offset <var>start</var> and file offset <var>end</var> will be restored.
 - These offsets are relative to the addresses in the file, before
 - the <var>bias</var> argument is applied.
 - </p>
 - </dd>
 - </dl>
 - 
 - <hr>
 - <div class="header">
 - <p>
 - Next: <a href="Core-File-Generation.html#Core-File-Generation" accesskey="n" rel="next">Core File Generation</a>, Previous: <a href="Memory-Region-Attributes.html#Memory-Region-Attributes" accesskey="p" rel="prev">Memory Region Attributes</a>, Up: <a href="Data.html#Data" accesskey="u" rel="up">Data</a>   [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
 - </div>
 - 
 - 
 - 
 - </body>
 - </html>
 
 
  |