84
Chapter 10. Examining Data
append [binary] memory
filename start_addr end_addr
append [binary] value
filename expr
Append the contents of memory from
start_addr
to
end_addr
, or the value of
expr
, to
filename
, in raw binary form. (gdb can only append data to files in raw binary form.)
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
specify the optional keyword
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.
10.15. Character Sets
If the program you are debugging uses a different character set to represent characters and strings
than the one gdb uses itself, gdb can automatically translate between the character sets for you. The
character set gdb uses we call the
host character set
; the one the inferior program uses we call the
target character set
.
For example, if you are running gdb on a gnu/Linux system, which uses the ISO Latin 1 character set,
but you are using gdb’s remote protocol (Remote Debugging) to debug a program running on an IBM
mainframe, which uses the ebcdic character set, then the host character set is Latin-1, and the target
character set is ebcdic. If you give gdb the command
set target-charset EBCDIC-US
, then gdb
translates between ebcdic and Latin 1 as you print character or string values, or use character and
string literals in expressions.
gdb has no way to automatically recognize which character set the inferior program uses; you must
tell it, using the
set target-charset
command, described below.
Here are the commands for controlling gdb’s character set support:
set target-charset
charset
Set the current target character set to
charset
. We list the character set names gdb recognizes
below, but if you type
set target-charset
followed by [TAB][TAB], gdb will list the target
character sets it supports.
set host-charset
charset
Set the current host character set to
charset
.
By default, gdb uses a host character set appropriate to the system it is running on; you can
override that default using the
set host-charset
command.
gdb can only use certain character sets as its host character set. We list the character set names
gdb recognizes below, and indicate which can be host character sets, but if you type
set
target-charset
followed by [TAB][TAB], gdb will list the host character sets it supports.
set charset
charset
Set the current host and target character sets to
charset
. As above, if you type
set charset
followed by [TAB][TAB], gdb will list the name of the character sets that can be used for both
host and target.
Summary of Contents for ENTERPRISE LINUX 4 - DEVELOPER TOOLS GUIDE
Page 1: ...Red Hat Enterprise Linux 4 Debugging with gdb ...
Page 12: ...2 Chapter 1 Debugging with gdb ...
Page 28: ...18 Chapter 4 Getting In and Out of gdb ...
Page 34: ...24 Chapter 5 gdb Commands ...
Page 44: ...34 Chapter 6 Running Programs Under gdb ...
Page 68: ...58 Chapter 8 Examining the Stack ...
Page 98: ...88 Chapter 10 Examining Data ...
Page 112: ...102 Chapter 12 Tracepoints ...
Page 118: ...108 Chapter 13 Debugging Programs That Use Overlays ...
Page 138: ...128 Chapter 14 Using gdb with Different Languages ...
Page 144: ...134 Chapter 15 Examining the Symbol Table ...
Page 170: ...160 Chapter 19 Debugging remote programs ...
Page 198: ...188 Chapter 21 Controlling gdb ...
Page 204: ...194 Chapter 22 Canned Sequences of Commands ...
Page 206: ...196 Chapter 23 Command Interpreters ...
Page 216: ...206 Chapter 25 Using gdb under gnu Emacs ...
Page 296: ...286 Chapter 27 gdb Annotations ...
Page 300: ...290 Chapter 28 Reporting Bugs in gdb ...
Page 322: ...312 Chapter 30 Using History Interactively ...
Page 362: ...352 Appendix D gdb Remote Serial Protocol ...
Page 380: ...370 Appendix F GNU GENERAL PUBLIC LICENSE ...
Page 386: ...376 Appendix G GNU Free Documentation License ...
Page 410: ......