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: Disabling</title> 18 19<meta name="description" content="Debugging with GDB: Disabling"> 20<meta name="keywords" content="Debugging with GDB: Disabling"> 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="Breakpoints.html#Breakpoints" rel="up" title="Breakpoints"> 29<link href="Conditions.html#Conditions" rel="next" title="Conditions"> 30<link href="Delete-Breaks.html#Delete-Breaks" rel="previous" title="Delete Breaks"> 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="Disabling"></a> 65<div class="header"> 66<p> 67Next: <a href="Conditions.html#Conditions" accesskey="n" rel="next">Conditions</a>, Previous: <a href="Delete-Breaks.html#Delete-Breaks" accesskey="p" rel="previous">Delete Breaks</a>, Up: <a href="Breakpoints.html#Breakpoints" accesskey="u" rel="up">Breakpoints</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="Disabling-Breakpoints"></a> 71<h4 class="subsection">5.1.5 Disabling Breakpoints</h4> 72 73<a name="index-enable_002fdisable-a-breakpoint"></a> 74<p>Rather than deleting a breakpoint, watchpoint, or catchpoint, you might 75prefer to <em>disable</em> it. This makes the breakpoint inoperative as if 76it had been deleted, but remembers the information on the breakpoint so 77that you can <em>enable</em> it again later. 78</p> 79<p>You disable and enable breakpoints, watchpoints, and catchpoints with 80the <code>enable</code> and <code>disable</code> commands, optionally specifying 81one or more breakpoint numbers as arguments. Use <code>info break</code> to 82print a list of all breakpoints, watchpoints, and catchpoints if you 83do not know which numbers to use. 84</p> 85<p>Disabling and enabling a breakpoint that has multiple locations 86affects all of its locations. 87</p> 88<p>A breakpoint, watchpoint, or catchpoint can have any of several 89different states of enablement: 90</p> 91<ul> 92<li> Enabled. The breakpoint stops your program. A breakpoint set 93with the <code>break</code> command starts out in this state. 94</li><li> Disabled. The breakpoint has no effect on your program. 95</li><li> Enabled once. The breakpoint stops your program, but then becomes 96disabled. 97</li><li> Enabled for a count. The breakpoint stops your program for the next 98N times, then becomes disabled. 99</li><li> Enabled for deletion. The breakpoint stops your program, but 100immediately after it does so it is deleted permanently. A breakpoint 101set with the <code>tbreak</code> command starts out in this state. 102</li></ul> 103 104<p>You can use the following commands to enable or disable breakpoints, 105watchpoints, and catchpoints: 106</p> 107<dl compact="compact"> 108<dd><a name="index-disable"></a> 109<a name="index-dis-_0028disable_0029"></a> 110</dd> 111<dt><code>disable <span class="roman">[</span>breakpoints<span class="roman">]</span> <span class="roman">[</span><var>list</var>…<span class="roman">]</span></code></dt> 112<dd><p>Disable the specified breakpoints—or all breakpoints, if none are 113listed. A disabled breakpoint has no effect but is not forgotten. All 114options such as ignore-counts, conditions and commands are remembered in 115case the breakpoint is enabled again later. You may abbreviate 116<code>disable</code> as <code>dis</code>. 117</p> 118<a name="index-enable"></a> 119</dd> 120<dt><code>enable <span class="roman">[</span>breakpoints<span class="roman">]</span> <span class="roman">[</span><var>list</var>…<span class="roman">]</span></code></dt> 121<dd><p>Enable the specified breakpoints (or all defined breakpoints). They 122become effective once again in stopping your program. 123</p> 124</dd> 125<dt><code>enable <span class="roman">[</span>breakpoints<span class="roman">]</span> once <var>list</var>…</code></dt> 126<dd><p>Enable the specified breakpoints temporarily. <small>GDB</small> disables any 127of these breakpoints immediately after stopping your program. 128</p> 129</dd> 130<dt><code>enable <span class="roman">[</span>breakpoints<span class="roman">]</span> count <var>count</var> <var>list</var>…</code></dt> 131<dd><p>Enable the specified breakpoints temporarily. <small>GDB</small> records 132<var>count</var> with each of the specified breakpoints, and decrements a 133breakpoint’s count when it is hit. When any count reaches 0, 134<small>GDB</small> disables that breakpoint. If a breakpoint has an ignore 135count (see <a href="Conditions.html#Conditions">Break Conditions</a>), that will be 136decremented to 0 before <var>count</var> is affected. 137</p> 138</dd> 139<dt><code>enable <span class="roman">[</span>breakpoints<span class="roman">]</span> delete <var>list</var>…</code></dt> 140<dd><p>Enable the specified breakpoints to work once, then die. <small>GDB</small> 141deletes any of these breakpoints as soon as your program stops there. 142Breakpoints set by the <code>tbreak</code> command start out in this state. 143</p></dd> 144</dl> 145 146<p>Except for a breakpoint set with <code>tbreak</code> (see <a href="Set-Breaks.html#Set-Breaks">Setting Breakpoints</a>), breakpoints that you set are initially enabled; 147subsequently, they become disabled or enabled only when you use one of 148the commands above. (The command <code>until</code> can set and delete a 149breakpoint of its own, but it does not change the state of your other 150breakpoints; see <a href="Continuing-and-Stepping.html#Continuing-and-Stepping">Continuing and 151Stepping</a>.) 152</p> 153<hr> 154<div class="header"> 155<p> 156Next: <a href="Conditions.html#Conditions" accesskey="n" rel="next">Conditions</a>, Previous: <a href="Delete-Breaks.html#Delete-Breaks" accesskey="p" rel="previous">Delete Breaks</a>, Up: <a href="Breakpoints.html#Breakpoints" accesskey="u" rel="up">Breakpoints</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> 157</div> 158 159 160 161</body> 162</html> 163