3 <title>Debugging with GDB
</title>
4 <meta http-equiv=
"Content-Type" content=
"text/html">
5 <meta name=
"description" content=
"Debugging with GDB">
6 <meta name=
"generator" content=
"makeinfo 4.3">
7 <link href=
"http://www.gnu.org/software/texinfo/" rel=
"generator-home">
12 Node:
<a name=
"Error%20in%20Breakpoints">Error in Breakpoints
</a>,
13 Previous:
<a rel=
"previous" accesskey=
"p" href=
"Breakpoint-Menus.html#Breakpoint%20Menus">Breakpoint Menus
</a>,
14 Up:
<a rel=
"up" accesskey=
"u" href=
"Breakpoints.html#Breakpoints">Breakpoints
</a>
18 <h4 class=
"subsection">"Cannot insert breakpoints"</h4>
20 <p>Under some operating systems, breakpoints cannot be used in a program if
21 any other process is running that program. In this situation,
22 attempting to run or continue a program with a breakpoint causes
23 GDB to print an error message:
25 <pre class=
"example"> Cannot insert breakpoints.
26 The same program may be running in another process.
29 <p>When this happens, you have three ways to proceed:
32 <li>Remove or disable the breakpoints, then continue.
34 <li>Suspend GDB, and copy the file containing your program to a new
35 name. Resume GDB and use the
<code>exec-file
</code> command to specify
36 that GDB should run your program under that name.
37 Then start your program again.
39 <li>Relink your program so that the text segment is nonsharable, using the
40 linker option
<code>-N
</code>. The operating system limitation may not apply
41 to nonsharable executables.
44 <p>A similar message can be printed if you request too many active
45 hardware-assisted breakpoints and watchpoints:
47 <pre class=
"smallexample"> Stopped; cannot insert breakpoints.
48 You may have requested too many hardware breakpoints and watchpoints.
51 <p>This message is printed when you attempt to resume the program, since
52 only then GDB knows exactly how many hardware breakpoints and
53 watchpoints it needs to insert.
55 <p>When this message is printed, you need to disable or remove some of the
56 hardware-assisted breakpoints and watchpoints, and then continue.