PowerPC-Embedded.html 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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 5.1, http://www.gnu.org/software/texinfo/ -->
  14. <head>
  15. <title>Debugging with GDB: PowerPC Embedded</title>
  16. <meta name="description" content="Debugging with GDB: PowerPC Embedded">
  17. <meta name="keywords" content="Debugging with GDB: PowerPC Embedded">
  18. <meta name="resource-type" content="document">
  19. <meta name="distribution" content="global">
  20. <meta name="Generator" content="makeinfo">
  21. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  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="Embedded-Processors.html#Embedded-Processors" rel="up" title="Embedded Processors">
  26. <link href="AVR.html#AVR" rel="next" title="AVR">
  27. <link href="OpenRISC-1000.html#OpenRISC-1000" rel="previous" title="OpenRISC 1000">
  28. <style type="text/css">
  29. <!--
  30. a.summary-letter {text-decoration: none}
  31. blockquote.smallquotation {font-size: smaller}
  32. div.display {margin-left: 3.2em}
  33. div.example {margin-left: 3.2em}
  34. div.indentedblock {margin-left: 3.2em}
  35. div.lisp {margin-left: 3.2em}
  36. div.smalldisplay {margin-left: 3.2em}
  37. div.smallexample {margin-left: 3.2em}
  38. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  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.nocodebreak {white-space:nowrap}
  50. span.nolinebreak {white-space:nowrap}
  51. span.roman {font-family:serif; font-weight:normal}
  52. span.sansserif {font-family:sans-serif; font-weight:normal}
  53. ul.no-bullet {list-style: none}
  54. -->
  55. </style>
  56. </head>
  57. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  58. <a name="PowerPC-Embedded"></a>
  59. <div class="header">
  60. <p>
  61. Next: <a href="AVR.html#AVR" accesskey="n" rel="next">AVR</a>, Previous: <a href="OpenRISC-1000.html#OpenRISC-1000" accesskey="p" rel="previous">OpenRISC 1000</a>, Up: <a href="Embedded-Processors.html#Embedded-Processors" accesskey="u" rel="up">Embedded Processors</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>
  62. </div>
  63. <hr>
  64. <a name="PowerPC-Embedded-1"></a>
  65. <h4 class="subsection">21.3.8 PowerPC Embedded</h4>
  66. <a name="index-DVC-register"></a>
  67. <p><small>GDB</small> supports using the DVC (Data Value Compare) register to
  68. implement in hardware simple hardware watchpoint conditions of the form:
  69. </p>
  70. <div class="smallexample">
  71. <pre class="smallexample">(gdb) watch <var>ADDRESS|VARIABLE</var> \
  72. if <var>ADDRESS|VARIABLE</var> == <var>CONSTANT EXPRESSION</var>
  73. </pre></div>
  74. <p>The DVC register will be automatically used when <small>GDB</small> detects
  75. such pattern in a condition expression, and the created watchpoint uses one
  76. debug register (either the <code>exact-watchpoints</code> option is on and the
  77. variable is scalar, or the variable has a length of one byte). This feature
  78. is available in native <small>GDB</small> running on a Linux kernel version 2.6.34
  79. or newer.
  80. </p>
  81. <p>When running on PowerPC embedded processors, <small>GDB</small> automatically uses
  82. ranged hardware watchpoints, unless the <code>exact-watchpoints</code> option is on,
  83. in which case watchpoints using only one debug register are created when
  84. watching variables of scalar types.
  85. </p>
  86. <p>You can create an artificial array to watch an arbitrary memory
  87. region using one of the following commands (see <a href="Expressions.html#Expressions">Expressions</a>):
  88. </p>
  89. <div class="smallexample">
  90. <pre class="smallexample">(gdb) watch *((char *) <var>address</var>)@<var>length</var>
  91. (gdb) watch {char[<var>length</var>]} <var>address</var>
  92. </pre></div>
  93. <p>PowerPC embedded processors support masked watchpoints. See the discussion
  94. about the <code>mask</code> argument in <a href="Set-Watchpoints.html#Set-Watchpoints">Set Watchpoints</a>.
  95. </p>
  96. <a name="index-ranged-breakpoint"></a>
  97. <p>PowerPC embedded processors support hardware accelerated
  98. <em>ranged breakpoints</em>. A ranged breakpoint stops execution of
  99. the inferior whenever it executes an instruction at any address within
  100. the range it specifies. To set a ranged breakpoint in <small>GDB</small>,
  101. use the <code>break-range</code> command.
  102. </p>
  103. <p><small>GDB</small> provides the following PowerPC-specific commands:
  104. </p>
  105. <dl compact="compact">
  106. <dd><a name="index-break_002drange"></a>
  107. </dd>
  108. <dt><code>break-range <var>start-location</var>, <var>end-location</var></code></dt>
  109. <dd><p>Set a breakpoint for an address range given by
  110. <var>start-location</var> and <var>end-location</var>, which can specify a function name,
  111. a line number, an offset of lines from the current line or from the start
  112. location, or an address of an instruction (see <a href="Specify-Location.html#Specify-Location">Specify Location</a>,
  113. for a list of all the possible ways to specify a <var>location</var>.)
  114. The breakpoint will stop execution of the inferior whenever it
  115. executes an instruction at any address within the specified range,
  116. (including <var>start-location</var> and <var>end-location</var>.)
  117. </p>
  118. <a name="index-set-powerpc"></a>
  119. </dd>
  120. <dt><code>set powerpc soft-float</code></dt>
  121. <dt><code>show powerpc soft-float</code></dt>
  122. <dd><p>Force <small>GDB</small> to use (or not use) a software floating point calling
  123. convention. By default, <small>GDB</small> selects the calling convention based
  124. on the selected architecture and the provided executable file.
  125. </p>
  126. </dd>
  127. <dt><code>set powerpc vector-abi</code></dt>
  128. <dt><code>show powerpc vector-abi</code></dt>
  129. <dd><p>Force <small>GDB</small> to use the specified calling convention for vector
  130. arguments and return values. The valid options are &lsquo;<samp>auto</samp>&rsquo;;
  131. &lsquo;<samp>generic</samp>&rsquo;, to avoid vector registers even if they are present;
  132. &lsquo;<samp>altivec</samp>&rsquo;, to use AltiVec registers; and &lsquo;<samp>spe</samp>&rsquo; to use SPE
  133. registers. By default, <small>GDB</small> selects the calling convention
  134. based on the selected architecture and the provided executable file.
  135. </p>
  136. </dd>
  137. <dt><code>set powerpc exact-watchpoints</code></dt>
  138. <dt><code>show powerpc exact-watchpoints</code></dt>
  139. <dd><p>Allow <small>GDB</small> to use only one debug register when watching a variable
  140. of scalar type, thus assuming that the variable is accessed through the
  141. address of its first byte.
  142. </p>
  143. </dd>
  144. </dl>
  145. <hr>
  146. <div class="header">
  147. <p>
  148. Next: <a href="AVR.html#AVR" accesskey="n" rel="next">AVR</a>, Previous: <a href="OpenRISC-1000.html#OpenRISC-1000" accesskey="p" rel="previous">OpenRISC 1000</a>, Up: <a href="Embedded-Processors.html#Embedded-Processors" accesskey="u" rel="up">Embedded Processors</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>
  149. </div>
  150. </body>
  151. </html>