Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

252 rindas
9.9KB

  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>Memory Region Attributes (Debugging with GDB)</title>
  17. <meta name="description" content="Memory Region Attributes (Debugging with GDB)">
  18. <meta name="keywords" content="Memory Region Attributes (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="Dump_002fRestore-Files.html#Dump_002fRestore-Files" rel="next" title="Dump/Restore Files">
  27. <link href="OS-Information.html#OS-Information" rel="prev" title="OS Information">
  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="Memory-Region-Attributes"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="Dump_002fRestore-Files.html#Dump_002fRestore-Files" accesskey="n" rel="next">Dump/Restore Files</a>, Previous: <a href="OS-Information.html#OS-Information" accesskey="p" rel="prev">OS Information</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="Memory-Region-Attributes-1"></a>
  64. <h3 class="section">10.17 Memory Region Attributes</h3>
  65. <a name="index-memory-region-attributes"></a>
  66. <p><em>Memory region attributes</em> allow you to describe special handling
  67. required by regions of your target&rsquo;s memory. <small>GDB</small> uses
  68. attributes to determine whether to allow certain types of memory
  69. accesses; whether to use specific width accesses; and whether to cache
  70. target memory. By default the description of memory regions is
  71. fetched from the target (if the current target supports this), but the
  72. user can override the fetched regions.
  73. </p>
  74. <p>Defined memory regions can be individually enabled and disabled. When a
  75. memory region is disabled, <small>GDB</small> uses the default attributes when
  76. accessing memory in that region. Similarly, if no memory regions have
  77. been defined, <small>GDB</small> uses the default attributes when accessing
  78. all memory.
  79. </p>
  80. <p>When a memory region is defined, it is given a number to identify it;
  81. to enable, disable, or remove a memory region, you specify that number.
  82. </p>
  83. <dl compact="compact">
  84. <dd><a name="index-mem"></a>
  85. </dd>
  86. <dt><code>mem <var>lower</var> <var>upper</var> <var>attributes</var>&hellip;</code></dt>
  87. <dd><p>Define a memory region bounded by <var>lower</var> and <var>upper</var> with
  88. attributes <var>attributes</var>&hellip;, and add it to the list of regions
  89. monitored by <small>GDB</small>. Note that <var>upper</var> == 0 is a special
  90. case: it is treated as the target&rsquo;s maximum memory address.
  91. (0xffff on 16 bit targets, 0xffffffff on 32 bit targets, etc.)
  92. </p>
  93. </dd>
  94. <dt><code>mem auto</code></dt>
  95. <dd><p>Discard any user changes to the memory regions and use target-supplied
  96. regions, if available, or no regions if the target does not support.
  97. </p>
  98. <a name="index-delete-mem"></a>
  99. </dd>
  100. <dt><code>delete mem <var>nums</var>&hellip;</code></dt>
  101. <dd><p>Remove memory regions <var>nums</var>&hellip; from the list of regions
  102. monitored by <small>GDB</small>.
  103. </p>
  104. <a name="index-disable-mem"></a>
  105. </dd>
  106. <dt><code>disable mem <var>nums</var>&hellip;</code></dt>
  107. <dd><p>Disable monitoring of memory regions <var>nums</var>&hellip;.
  108. A disabled memory region is not forgotten.
  109. It may be enabled again later.
  110. </p>
  111. <a name="index-enable-mem"></a>
  112. </dd>
  113. <dt><code>enable mem <var>nums</var>&hellip;</code></dt>
  114. <dd><p>Enable monitoring of memory regions <var>nums</var>&hellip;.
  115. </p>
  116. <a name="index-info-mem"></a>
  117. </dd>
  118. <dt><code>info mem</code></dt>
  119. <dd><p>Print a table of all defined memory regions, with the following columns
  120. for each region:
  121. </p>
  122. <dl compact="compact">
  123. <dt><em>Memory Region Number</em></dt>
  124. <dt><em>Enabled or Disabled.</em></dt>
  125. <dd><p>Enabled memory regions are marked with &lsquo;<samp>y</samp>&rsquo;.
  126. Disabled memory regions are marked with &lsquo;<samp>n</samp>&rsquo;.
  127. </p>
  128. </dd>
  129. <dt><em>Lo Address</em></dt>
  130. <dd><p>The address defining the inclusive lower bound of the memory region.
  131. </p>
  132. </dd>
  133. <dt><em>Hi Address</em></dt>
  134. <dd><p>The address defining the exclusive upper bound of the memory region.
  135. </p>
  136. </dd>
  137. <dt><em>Attributes</em></dt>
  138. <dd><p>The list of attributes set for this memory region.
  139. </p></dd>
  140. </dl>
  141. </dd>
  142. </dl>
  143. <a name="Attributes"></a>
  144. <h4 class="subsection">10.17.1 Attributes</h4>
  145. <a name="Memory-Access-Mode"></a>
  146. <h4 class="subsubsection">10.17.1.1 Memory Access Mode</h4>
  147. <p>The access mode attributes set whether <small>GDB</small> may make read or
  148. write accesses to a memory region.
  149. </p>
  150. <p>While these attributes prevent <small>GDB</small> from performing invalid
  151. memory accesses, they do nothing to prevent the target system, I/O DMA,
  152. etc. from accessing memory.
  153. </p>
  154. <dl compact="compact">
  155. <dt><code>ro</code></dt>
  156. <dd><p>Memory is read only.
  157. </p></dd>
  158. <dt><code>wo</code></dt>
  159. <dd><p>Memory is write only.
  160. </p></dd>
  161. <dt><code>rw</code></dt>
  162. <dd><p>Memory is read/write. This is the default.
  163. </p></dd>
  164. </dl>
  165. <a name="Memory-Access-Size"></a>
  166. <h4 class="subsubsection">10.17.1.2 Memory Access Size</h4>
  167. <p>The access size attribute tells <small>GDB</small> to use specific sized
  168. accesses in the memory region. Often memory mapped device registers
  169. require specific sized accesses. If no access size attribute is
  170. specified, <small>GDB</small> may use accesses of any size.
  171. </p>
  172. <dl compact="compact">
  173. <dt><code>8</code></dt>
  174. <dd><p>Use 8 bit memory accesses.
  175. </p></dd>
  176. <dt><code>16</code></dt>
  177. <dd><p>Use 16 bit memory accesses.
  178. </p></dd>
  179. <dt><code>32</code></dt>
  180. <dd><p>Use 32 bit memory accesses.
  181. </p></dd>
  182. <dt><code>64</code></dt>
  183. <dd><p>Use 64 bit memory accesses.
  184. </p></dd>
  185. </dl>
  186. <a name="Data-Cache"></a>
  187. <h4 class="subsubsection">10.17.1.3 Data Cache</h4>
  188. <p>The data cache attributes set whether <small>GDB</small> will cache target
  189. memory. While this generally improves performance by reducing debug
  190. protocol overhead, it can lead to incorrect results because <small>GDB</small>
  191. does not know about volatile variables or memory mapped device
  192. registers.
  193. </p>
  194. <dl compact="compact">
  195. <dt><code>cache</code></dt>
  196. <dd><p>Enable <small>GDB</small> to cache target memory.
  197. </p></dd>
  198. <dt><code>nocache</code></dt>
  199. <dd><p>Disable <small>GDB</small> from caching target memory. This is the default.
  200. </p></dd>
  201. </dl>
  202. <a name="Memory-Access-Checking"></a>
  203. <h4 class="subsection">10.17.2 Memory Access Checking</h4>
  204. <p><small>GDB</small> can be instructed to refuse accesses to memory that is
  205. not explicitly described. This can be useful if accessing such
  206. regions has undesired effects for a specific target, or to provide
  207. better error checking. The following commands control this behaviour.
  208. </p>
  209. <dl compact="compact">
  210. <dd><a name="index-set-mem-inaccessible_002dby_002ddefault"></a>
  211. </dd>
  212. <dt><code>set mem inaccessible-by-default [on|off]</code></dt>
  213. <dd><p>If <code>on</code> is specified, make <small>GDB</small> treat memory not
  214. explicitly described by the memory ranges as non-existent and refuse accesses
  215. to such memory. The checks are only performed if there&rsquo;s at least one
  216. memory range defined. If <code>off</code> is specified, make <small>GDB</small>
  217. treat the memory not explicitly described by the memory ranges as RAM.
  218. The default value is <code>on</code>.
  219. <a name="index-show-mem-inaccessible_002dby_002ddefault"></a>
  220. </p></dd>
  221. <dt><code>show mem inaccessible-by-default</code></dt>
  222. <dd><p>Show the current handling of accesses to unknown memory.
  223. </p></dd>
  224. </dl>
  225. <hr>
  226. <div class="header">
  227. <p>
  228. Next: <a href="Dump_002fRestore-Files.html#Dump_002fRestore-Files" accesskey="n" rel="next">Dump/Restore Files</a>, Previous: <a href="OS-Information.html#OS-Information" accesskey="p" rel="prev">OS Information</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>
  229. </div>
  230. </body>
  231. </html>