You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

187 satır
8.0KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Free Software" and "Free Software Needs
  8. Free Documentation", with the Front-Cover Texts being "A GNU Manual,"
  9. and with the Back-Cover Texts as in (a) below.
  10. (a) The FSF's Back-Cover Text is: "You are free to copy and modify
  11. this GNU Manual. Buying copies from GNU Press supports the FSF in
  12. developing GNU and promoting software freedom." -->
  13. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  14. <head>
  15. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  16. <title>Caching Target Data (Debugging with GDB)</title>
  17. <meta name="description" content="Caching Target Data (Debugging with GDB)">
  18. <meta name="keywords" content="Caching Target Data (Debugging with GDB)">
  19. <meta name="resource-type" content="document">
  20. <meta name="distribution" content="global">
  21. <meta name="Generator" content="makeinfo">
  22. <link href="index.html#Top" rel="start" title="Top">
  23. <link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
  24. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  25. <link href="Data.html#Data" rel="up" title="Data">
  26. <link href="Searching-Memory.html#Searching-Memory" rel="next" title="Searching Memory">
  27. <link href="Character-Sets.html#Character-Sets" rel="prev" title="Character Sets">
  28. <style type="text/css">
  29. <!--
  30. a.summary-letter {text-decoration: none}
  31. blockquote.indentedblock {margin-right: 0em}
  32. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  33. blockquote.smallquotation {font-size: smaller}
  34. div.display {margin-left: 3.2em}
  35. div.example {margin-left: 3.2em}
  36. div.lisp {margin-left: 3.2em}
  37. div.smalldisplay {margin-left: 3.2em}
  38. div.smallexample {margin-left: 3.2em}
  39. div.smalllisp {margin-left: 3.2em}
  40. kbd {font-style: oblique}
  41. pre.display {font-family: inherit}
  42. pre.format {font-family: inherit}
  43. pre.menu-comment {font-family: serif}
  44. pre.menu-preformatted {font-family: serif}
  45. pre.smalldisplay {font-family: inherit; font-size: smaller}
  46. pre.smallexample {font-size: smaller}
  47. pre.smallformat {font-family: inherit; font-size: smaller}
  48. pre.smalllisp {font-size: smaller}
  49. span.nolinebreak {white-space: nowrap}
  50. span.roman {font-family: initial; font-weight: normal}
  51. span.sansserif {font-family: sans-serif; font-weight: normal}
  52. ul.no-bullet {list-style: none}
  53. -->
  54. </style>
  55. </head>
  56. <body lang="en">
  57. <a name="Caching-Target-Data"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="Searching-Memory.html#Searching-Memory" accesskey="n" rel="next">Searching Memory</a>, Previous: <a href="Character-Sets.html#Character-Sets" accesskey="p" rel="prev">Character Sets</a>, Up: <a href="Data.html#Data" accesskey="u" rel="up">Data</a> &nbsp; [<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>
  61. </div>
  62. <hr>
  63. <a name="Caching-Data-of-Targets"></a>
  64. <h3 class="section">10.21 Caching Data of Targets</h3>
  65. <a name="index-caching-data-of-targets"></a>
  66. <p><small>GDB</small> caches data exchanged between the debugger and a target.
  67. Each cache is associated with the address space of the inferior.
  68. See <a href="Inferiors-Connections-and-Programs.html#Inferiors-Connections-and-Programs">Inferiors Connections and Programs</a>, about inferior and address space.
  69. Such caching generally improves performance in remote debugging
  70. (see <a href="Remote-Debugging.html#Remote-Debugging">Remote Debugging</a>), because it reduces the overhead of the
  71. remote protocol by bundling memory reads and writes into large chunks.
  72. Unfortunately, simply caching everything would lead to incorrect results,
  73. since <small>GDB</small> does not necessarily know anything about volatile
  74. values, memory-mapped I/O addresses, etc. Furthermore, in non-stop mode
  75. (see <a href="Non_002dStop-Mode.html#Non_002dStop-Mode">Non-Stop Mode</a>) memory can be changed <em>while</em> a gdb command
  76. is executing.
  77. Therefore, by default, <small>GDB</small> only caches data
  78. known to be on the stack<a name="DOCF13" href="#FOOT13"><sup>13</sup></a> or
  79. in the code segment.
  80. Other regions of memory can be explicitly marked as
  81. cacheable; see <a href="Memory-Region-Attributes.html#Memory-Region-Attributes">Memory Region Attributes</a>.
  82. </p>
  83. <dl compact="compact">
  84. <dd><a name="index-set-remotecache"></a>
  85. </dd>
  86. <dt><code>set remotecache on</code></dt>
  87. <dt><code>set remotecache off</code></dt>
  88. <dd><p>This option no longer does anything; it exists for compatibility
  89. with old scripts.
  90. </p>
  91. <a name="index-show-remotecache"></a>
  92. </dd>
  93. <dt><code>show remotecache</code></dt>
  94. <dd><p>Show the current state of the obsolete remotecache flag.
  95. </p>
  96. <a name="index-set-stack_002dcache"></a>
  97. </dd>
  98. <dt><code>set stack-cache on</code></dt>
  99. <dt><code>set stack-cache off</code></dt>
  100. <dd><p>Enable or disable caching of stack accesses. When <code>on</code>, use
  101. caching. By default, this option is <code>on</code>.
  102. </p>
  103. <a name="index-show-stack_002dcache"></a>
  104. </dd>
  105. <dt><code>show stack-cache</code></dt>
  106. <dd><p>Show the current state of data caching for memory accesses.
  107. </p>
  108. <a name="index-set-code_002dcache"></a>
  109. </dd>
  110. <dt><code>set code-cache on</code></dt>
  111. <dt><code>set code-cache off</code></dt>
  112. <dd><p>Enable or disable caching of code segment accesses. When <code>on</code>,
  113. use caching. By default, this option is <code>on</code>. This improves
  114. performance of disassembly in remote debugging.
  115. </p>
  116. <a name="index-show-code_002dcache"></a>
  117. </dd>
  118. <dt><code>show code-cache</code></dt>
  119. <dd><p>Show the current state of target memory cache for code segment
  120. accesses.
  121. </p>
  122. <a name="index-info-dcache"></a>
  123. </dd>
  124. <dt><code>info dcache <span class="roman">[</span>line<span class="roman">]</span></code></dt>
  125. <dd><p>Print the information about the performance of data cache of the
  126. current inferior&rsquo;s address space. The information displayed
  127. includes the dcache width and depth, and for each cache line, its
  128. number, address, and how many times it was referenced. This
  129. command is useful for debugging the data cache operation.
  130. </p>
  131. <p>If a line number is specified, the contents of that line will be
  132. printed in hex.
  133. </p>
  134. </dd>
  135. <dt><code>set dcache size <var>size</var></code></dt>
  136. <dd><a name="index-dcache-size"></a>
  137. <a name="index-set-dcache-size"></a>
  138. <p>Set maximum number of entries in dcache (dcache depth above).
  139. </p>
  140. </dd>
  141. <dt><code>set dcache line-size <var>line-size</var></code></dt>
  142. <dd><a name="index-dcache-line_002dsize"></a>
  143. <a name="index-set-dcache-line_002dsize"></a>
  144. <p>Set number of bytes each dcache entry caches (dcache width above).
  145. Must be a power of 2.
  146. </p>
  147. </dd>
  148. <dt><code>show dcache size</code></dt>
  149. <dd><a name="index-show-dcache-size"></a>
  150. <p>Show maximum number of dcache entries. See <a href="#Caching-Target-Data">info dcache</a>.
  151. </p>
  152. </dd>
  153. <dt><code>show dcache line-size</code></dt>
  154. <dd><a name="index-show-dcache-line_002dsize"></a>
  155. <p>Show default size of dcache lines.
  156. </p>
  157. </dd>
  158. </dl>
  159. <div class="footnote">
  160. <hr>
  161. <h4 class="footnotes-heading">Footnotes</h4>
  162. <h3><a name="FOOT13" href="#DOCF13">(13)</a></h3>
  163. <p>In non-stop mode, it is moderately
  164. rare for a running thread to modify the stack of a stopped thread
  165. in a way that would interfere with a backtrace, and caching of
  166. stack reads provides a significant speed up of remote backtraces.</p>
  167. </div>
  168. <hr>
  169. <div class="header">
  170. <p>
  171. Next: <a href="Searching-Memory.html#Searching-Memory" accesskey="n" rel="next">Searching Memory</a>, Previous: <a href="Character-Sets.html#Character-Sets" accesskey="p" rel="prev">Character Sets</a>, Up: <a href="Data.html#Data" accesskey="u" rel="up">Data</a> &nbsp; [<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>
  172. </div>
  173. </body>
  174. </html>