• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisiona86c90e6ba808e997f87f0287d9f01ba8d3e904e (tree)
Time2015-06-16 04:31:00
AuthorSimon Marchi <simon.marchi@eric...>
CommiterSimon Marchi

Log Message

Clarify doc about memory read/write and non-8-bits addressable memory unit sizes

New in v3:

  • Change RSP documentation as well. The m, M and X packets now use
    lengths in addressable memory units.

New in v2:

  • Change wording: use byte for 8-bits chunks and addressable memory unit
    for the unit of data associated to a single address.
  • Introduce definition of addressable memory unit in the Memory
    section.

This patch modifies the manual to clarify the MI, RSP and Python APIs in
regard to reading/writing memory on architectures with addressable
memory unit that are not 8 bits.

Care is taken to use the word "addressable memory unit" or "memory unit"
when referring to one piece of the smallest addressable size on the
current architecture and the word "byte" when referring to an 8-bits
data piece.

For MI, -data-{read,write}-memory are not modified, since they are
deprecated.

gdb/doc/ChangeLog:

* gdb.texinfo (GDB/MI Data Manipulation): Clarify usage of
bytes and memory units for -data-{read,write}-memory-bytes.
(Packets): Same for m, M and X packets.
* python.texi (Inferiors In Python): Same for read_memory and
write_memory.

Change Summary

Incremental Difference

--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,11 @@
1+2015-06-15 Simon Marchi <simon.marchi@ericsson.com>
2+
3+ * gdb.texinfo (GDB/MI Data Manipulation): Clarify usage of
4+ bytes and memory units for -data-{read,write}-memory-bytes.
5+ (Packets): Same for m, M and X packets.
6+ * python.texi (Inferiors In Python): Same for read_memory and
7+ write_memory.
8+
19 2015-06-10 Jon Turney <jon.turney@dronecode.org.uk>
210
311 * gdb.texinfo (Separate Debug Files): Document that PE is also
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -9009,6 +9009,18 @@ If the @code{x} command has a repeat count, the address and contents saved
90099009 are from the last memory unit printed; this is not the same as the last
90109010 address printed if several units were printed on the last line of output.
90119011
9012+@anchor{addressable memory unit}
9013+@cindex addressable memory unit
9014+Most targets have an addressable memory unit size of 8 bits. This means
9015+that to each memory address are associated 8 bits of data. Some
9016+targets, however, have other addressable memory unit sizes.
9017+Within @value{GDBN} and this document, the term
9018+@dfn{addressable memory unit} (or @dfn{memory unit} for short) is used
9019+when explicitly referring to a chunk of data of that size. The word
9020+@dfn{byte} is used to refer to a chunk of data of 8 bits, regardless of
9021+the addressable memory unit size of the target. For most systems,
9022+addressable memory unit is a synonym of byte.
9023+
90129024 @cindex remote memory comparison
90139025 @cindex target memory comparison
90149026 @cindex verify remote memory image
@@ -29579,6 +29591,9 @@ can be used to instantiate this class for a varobj:
2957929591 This section describes the @sc{gdb/mi} commands that manipulate data:
2958029592 examine memory and registers, evaluate expressions, etc.
2958129593
29594+For details about what an addressable memory unit is,
29595+@pxref{addressable memory unit}.
29596+
2958229597 @c REMOVED FROM THE INTERFACE.
2958329598 @c @subheading -data-assign
2958429599 @c Change the value of a program variable. Plenty of side effects.
@@ -30103,7 +30118,7 @@ next-page="0x000013c0",prev-page="0x00001380",memory=[
3010330118 @subsubheading Synopsis
3010430119
3010530120 @smallexample
30106- -data-read-memory-bytes [ -o @var{byte-offset} ]
30121+ -data-read-memory-bytes [ -o @var{offset} ]
3010730122 @var{address} @var{count}
3010830123 @end smallexample
3010930124
@@ -30112,18 +30127,19 @@ where:
3011230127
3011330128 @table @samp
3011430129 @item @var{address}
30115-An expression specifying the address of the first memory word to be
30116-read. Complex expressions containing embedded white space should be
30130+An expression specifying the address of the first addressable memory unit
30131+to be read. Complex expressions containing embedded white space should be
3011730132 quoted using the C convention.
3011830133
3011930134 @item @var{count}
30120-The number of bytes to read. This should be an integer literal.
30135+The number of addressable memory units to read. This should be an integer
30136+literal.
3012130137
30122-@item @var{byte-offset}
30123-The offsets in bytes relative to @var{address} at which to start
30124-reading. This should be an integer literal. This option is provided
30125-so that a frontend is not required to first evaluate address and then
30126-perform address arithmetics itself.
30138+@item @var{offset}
30139+The offset relative to @var{address} at which to start reading. This
30140+should be an integer literal. This option is provided so that a frontend
30141+is not required to first evaluate address and then perform address
30142+arithmetics itself.
3012730143
3012830144 @end table
3012930145
@@ -30134,10 +30150,10 @@ Attributes}. Second, @value{GDBN} will attempt to read the remaining
3013430150 regions. For each one, if reading full region results in an errors,
3013530151 @value{GDBN} will try to read a subset of the region.
3013630152
30137-In general, every single byte in the region may be readable or not,
30138-and the only way to read every readable byte is to try a read at
30153+In general, every single memory unit in the region may be readable or not,
30154+and the only way to read every readable unit is to try a read at
3013930155 every address, which is not practical. Therefore, @value{GDBN} will
30140-attempt to read all accessible bytes at either beginning or the end
30156+attempt to read all accessible memory units at either beginning or the end
3014130157 of the region, using a binary division scheme. This heuristic works
3014230158 well for reading accross a memory map boundary. Note that if a region
3014330159 has a readable range that is neither at the beginning or the end,
@@ -30197,17 +30213,19 @@ where:
3019730213
3019830214 @table @samp
3019930215 @item @var{address}
30200-An expression specifying the address of the first memory word to be
30201-written. Complex expressions containing embedded white space should be
30202-quoted using the C convention.
30216+An expression specifying the address of the first addressable memory unit
30217+to be written. Complex expressions containing embedded white space should
30218+be quoted using the C convention.
3020330219
3020430220 @item @var{contents}
30205-The hex-encoded bytes to write.
30221+The hex-encoded data to write. It is an error if @var{contents} does
30222+not represent an integral number of addressable memory units.
3020630223
3020730224 @item @var{count}
30208-Optional argument indicating the number of bytes to be written. If @var{count}
30209-is greater than @var{contents}' length, @value{GDBN} will repeatedly
30210-write @var{contents} until it fills @var{count} bytes.
30225+Optional argument indicating the number of addressable memory units to be
30226+written. If @var{count} is greater than @var{contents}' length,
30227+@value{GDBN} will repeatedly write @var{contents} until it fills
30228+@var{count} memory units.
3021130229
3021230230 @end table
3021330231
@@ -34842,8 +34860,9 @@ probes the target state as if a new connection was opened
3484234860
3484334861 @item m @var{addr},@var{length}
3484434862 @cindex @samp{m} packet
34845-Read @var{length} bytes of memory starting at address @var{addr}.
34846-Note that @var{addr} may not be aligned to any particular boundary.
34863+Read @var{length} addressable memory units starting at address @var{addr}
34864+(@pxref{addressable memory unit}). Note that @var{addr} may not be aligned to
34865+any particular boundary.
3484734866
3484834867 The stub need not use any particular size or alignment when gathering
3484934868 data from memory for the response; even if @var{addr} is word-aligned
@@ -34857,8 +34876,8 @@ suitable for accessing memory-mapped I/O devices.
3485734876 Reply:
3485834877 @table @samp
3485934878 @item @var{XX@dots{}}
34860-Memory contents; each byte is transmitted as a two-digit hexadecimal
34861-number. The reply may contain fewer bytes than requested if the
34879+Memory contents; each byte is transmitted as a two-digit hexadecimal number.
34880+The reply may contain fewer addressable memory units than requested if the
3486234881 server was able to read only part of the region of memory.
3486334882 @item E @var{NN}
3486434883 @var{NN} is errno
@@ -34866,9 +34885,9 @@ server was able to read only part of the region of memory.
3486634885
3486734886 @item M @var{addr},@var{length}:@var{XX@dots{}}
3486834887 @cindex @samp{M} packet
34869-Write @var{length} bytes of memory starting at address @var{addr}.
34870-The data is given by @var{XX@dots{}}; each byte is transmitted as a two-digit
34871-hexadecimal number.
34888+Write @var{length} addressable memory units starting at address @var{addr}
34889+(@pxref{addressable memory unit}). The data is given by @var{XX@dots{}}; each
34890+byte is transmitted as a two-digit hexadecimal number.
3487234891
3487334892 Reply:
3487434893 @table @samp
@@ -35182,7 +35201,8 @@ for success (@pxref{Stop Reply Packets})
3518235201 @anchor{X packet}
3518335202 @cindex @samp{X} packet
3518435203 Write data to memory, where the data is transmitted in binary.
35185-Memory is specified by its address @var{addr} and number of bytes @var{length};
35204+Memory is specified by its address @var{addr} and number of addressable memory
35205+units @var{length} (@pxref{addressable memory unit});
3518635206 @samp{@var{XX}@dots{}} is binary data (@pxref{Binary Data}).
3518735207
3518835208 Reply:
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -2749,7 +2749,7 @@ return an empty tuple.
27492749
27502750 @findex Inferior.read_memory
27512751 @defun Inferior.read_memory (address, length)
2752-Read @var{length} bytes of memory from the inferior, starting at
2752+Read @var{length} addressable memory units from the inferior, starting at
27532753 @var{address}. Returns a buffer object, which behaves much like an array
27542754 or a string. It can be modified and given to the
27552755 @code{Inferior.write_memory} function. In @code{Python} 3, the return
@@ -2762,7 +2762,8 @@ Write the contents of @var{buffer} to the inferior, starting at
27622762 @var{address}. The @var{buffer} parameter must be a Python object
27632763 which supports the buffer protocol, i.e., a string, an array or the
27642764 object returned from @code{Inferior.read_memory}. If given, @var{length}
2765-determines the number of bytes from @var{buffer} to be written.
2765+determines the number of addressable memory units from @var{buffer} to be
2766+written.
27662767 @end defun
27672768
27682769 @findex gdb.search_memory