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