www.delorie.com/gnu/docs/gdb/gdb_69.html   search  
 
Buy the book!


Debugging with GDB

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.14 Copy between memory and a file

The commands dump, append, and restore are used for copying data between target memory and a file. Data is written into a file using dump or append, and restored from a file into memory by using restore. Files may be binary, srec, intel hex, or tekhex (but only binary files can be appended).

dump binary memory filename start_addr end_addr
Dump contents of memory from start_addr to end_addr into raw binary format file filename.

append binary memory filename start_addr end_addr
Append contents of memory from start_addr to end_addr to raw binary format file filename.

dump binary value filename expression
Dump value of expression into raw binary format file filename.

append binary memory filename expression
Append value of expression to raw binary format file filename.

dump ihex memory filename start_addr end_addr
Dump contents of memory from start_addr to end_addr into intel hex format file filename.

dump ihex value filename expression
Dump value of expression into intel hex format file filename.

dump srec memory filename start_addr end_addr
Dump contents of memory from start_addr to end_addr into srec format file filename.

dump srec value filename expression
Dump value of expression into srec format file filename.

dump tekhex memory filename start_addr end_addr
Dump contents of memory from start_addr to end_addr into tekhex format file filename.

dump tekhex value filename expression
Dump value of expression into tekhex format file filename.

restore filename [binary] bias start end
Restore the contents of file filename into memory. The restore command can automatically recognize any known bfd file format, except for raw binary. To restore a raw binary file you must use the optional argument binary after the filename.

If bias 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 bias. Other bfd files have a built-in location; they will be restored at offset bias from that location.

If start and/or end are non-zero, then only data between file offset start and file offset end will be restored. These offsets are relative to the addresses in the file, before the bias argument is applied.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003