* gdb.texinfo (Separate Debug Files, Remote Protocol): Clarified

CRC definitions.
This commit is contained in:
Eli Zaretskii 2009-08-05 17:47:09 +00:00
parent 768f092942
commit 99e008fef7
2 changed files with 71 additions and 18 deletions

View File

@ -1,3 +1,8 @@
2009-08-05 Jeremy Bennett <jeremy.bennett@embecosm.com>
* gdb.texinfo (Separate Debug Files, Remote Protocol): Clarified
CRC definitions.
2009-08-03 Vladimir Prus <vladimir@codesourcery.com>
* gdb.texinfo (GDB/MI Breakpoint Commands): Document

View File

@ -10846,8 +10846,8 @@ point computations, error checking in decimal float operations ignores
underflow, overflow and divide by zero exceptions.
In the PowerPC architecture, @value{GDBN} provides a set of pseudo-registers
to inspect @code{_Decimal128} values stored in floating point registers. See
@ref{PowerPC,,PowerPC} for more details.
to inspect @code{_Decimal128} values stored in floating point registers.
See @ref{PowerPC,,PowerPC} for more details.
@node Objective-C
@subsection Objective-C
@ -13644,9 +13644,9 @@ the separate debug info file. The separate debug file's name is
usually @file{@var{executable}.debug}, where @var{executable} is the
name of the corresponding executable file without leading directories
(e.g., @file{ls.debug} for @file{/usr/bin/ls}). In addition, the
debug link specifies a CRC32 checksum for the debug file, which
@value{GDBN} uses to validate that the executable and the debug file
came from the same build.
debug link specifies a 32-bit @dfn{Cyclic Redundancy Check} (CRC)
checksum for the debug file, which @value{GDBN} uses to validate that
the executable and the debug file came from the same build.
@item
The executable contains a @dfn{build ID}, a unique bit string that is
@ -13796,10 +13796,47 @@ utilities (Binutils) package since version 2.18.
@noindent
Since there are many different ways to compute CRC's for the debug
link (different polynomials, reversals, byte ordering, etc.), the
simplest way to describe the CRC used in @code{.gnu_debuglink}
sections is to give the complete code for a function that computes it:
@cindex CRC algorithm definition
The CRC used in @code{.gnu_debuglink} is the CRC-32 defined in
IEEE 802.3 using the polynomial:
@c TexInfo requires naked braces for multi-digit exponents for Tex
@c output, but this causes HTML output to barf. HTML has to be set using
@c raw commands. So we end up having to specify this equation in 2
@c different ways!
@ifhtml
@display
@html
<em>x</em><sup>32</sup> + <em>x</em><sup>26</sup> + <em>x</em><sup>23</sup> + <em>x</em><sup>22</sup> + <em>x</em><sup>16</sup> + <em>x</em><sup>12</sup> + <em>x</em><sup>11</sup>
+ <em>x</em><sup>10</sup> + <em>x</em><sup>8</sup> + <em>x</em><sup>7</sup> + <em>x</em><sup>5</sup> + <em>x</em><sup>4</sup> + <em>x</em><sup>2</sup> + <em>x</em> + 1
@end html
@end display
@end ifhtml
@ifnothtml
@display
@math{x^{32} + x^{26} + x^{23} + x^{22} + x^{16} + x^{12} + x^{11}}
@math{+ x^{10} + x^8 + x^7 + x^5 + x^4 + x^2 + x + 1}
@end display
@end ifnothtml
The function is computed byte at a time, taking the least
significant bit of each byte first. The initial pattern
@code{0xffffffff} is used, to ensure leading zeros affect the CRC and
the final result is inverted to ensure trailing zeros also affect the
CRC.
@emph{Note:} This is the same CRC polynomial as used in handling the
@dfn{Remote Serial Protocol} @code{qCRC} packet (@pxref{Remote Protocol,
, @value{GDBN} Remote Serial Protocol}). However in the
case of the Remote Serial Protocol, the CRC is computed @emph{most}
significant bit first, and the result is not inverted, so trailing
zeros have no effect on the CRC value.
To complete the description, we show below the code of the function
which produces the CRC used in @code{.gnu_debuglink}. Inverting the
initially supplied @code{crc} argument means that an initial call to
this function passing in zero will start computing the CRC using
@code{0xffffffff}.
@kindex gnu_debuglink_crc32
@smallexample
@ -28092,7 +28129,18 @@ Any other reply implies the old thread ID.
@item qCRC:@var{addr},@var{length}
@cindex CRC of memory block, remote request
@cindex @samp{qCRC} packet
Compute the CRC checksum of a block of memory.
Compute the CRC checksum of a block of memory using CRC-32 defined in
IEEE 802.3. The CRC is computed byte at a time, taking the most
significant bit of each byte first. The initial pattern code
@code{0xffffffff} is used to ensure leading zeros affect the CRC.
@emph{Note:} This is the same CRC used in validating separate debug
files (@pxref{Separate Debug Files, , Debugging Information in Separate
Files}). However the algorithm is slightly different. When validating
separate debug files, the CRC is computed taking the @emph{least}
significant bit of each byte first, and the final result is inverted to
detect trailing zeros.
Reply:
@table @samp
@item E @var{NN}