Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 0a2ff0fd1d961484045bbf21add7bacff58a3dfa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html lang="en">

<head>
	<meta http-equiv="Content-Language" content="en-us">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Debugging your project</title>
	<link rel="stylesheet" type="text/css" href="../help.css">
</head>

<body>

<h1>Debugging your project</h1>

<p>The debugger lets you control the execution of your program by setting 
breakpoints, suspending executed programs, stepping through your code, and 
examining the contents of variables.</p>
<p>To debug a project:</p>
<ol>
  <li>Click <b>Run  &gt; Debug</b>.<p>The Debug dialog box 
  opens.</li>
  <li>Double-click <b>C++ Local</b>.</li>
  <li>In the <b>Name</b> box, type <b>Hello World</b>.</li>
  <p>You can now select this debug launch configuration by name the next time 
  that you debug this project.</p>
  <li>In the <b>C/C++ Application</b> box, type <b>hello.exe</b>.</li>
  <li>Click <b>Debug</b>.</li>
  <p>The debug perspective the hello.exe application window open.
  The C/C++ editor is repositioned in the perspective.</p>
  <li>In the left margin of the main.cpp window, double-click to set a 
  breakpoint on:<br>
  &nbsp;cout &lt;&lt; &quot;You just entered&quot;</li>
  <li>Click <b>Run  &gt; Resume</b>.</li>
  <li>When prompted, type a value other than 'm'.<br>
  The breakpoint will be hit.</li>
  <li>In the Variable view, verify that the variable is not 'm'.</li>
  <li>Click <b>Run  &gt; Resume</b>.</li>
  <li>When prompted, type a value other than 'm'.</li>
  <p>The breakpoint will be hit.</p>
  <li>In the <b>Variable</b> view, verify that the variable is not 'm'.</li>
  <li>In the <b>Variable</b> view, right-click the input variable, and select <b>Change 
  Variable Value</b> and type <b>'m'</b>.</li>
  <li>Click <b>Run  &gt; Resume</b>.</li>
  <p>The output in the hello.exe application window is:<br>
&nbsp;&quot;You just entered m, you need to enter m to exit.&quot;<li>Type <b>'m'</b> to end the program.<br>
  The hello.exe application window closes and the debug session ends. The debug 
  perspective remains open.</li>
</ol>

<p>To learn more about the debug aids at your disposal, refer to the related 
debug conceptual topics.</p>

<p align="left"> <a href="cdt_w_build.htm">
<img border="0" src="../images/ngback.gif" width="16" height="16"></a><b> <a href="cdt_w_build.htm">Back: Building your project</a></b>&nbsp;&nbsp;&nbsp; </p>

<p><img border="0" src="../images/ngconcepts.gif" ALT="Related concepts" width="143" height="21">
<br>
<a href="../concepts/cdt_c_over_dbg.htm">Debug overview</a><br>
<a href="../concepts/cdt_c_dbg_info.htm">Debug information</a></p>
<p><img border="0" src="../images/ngtasks.gif" ALT="Related tasks" width="143" height="21">
<br>
<a href="../tasks/cdt_o_debug.htm">Debugging</a></p>
<p><img border="0" src="../images/ngref.gif" ALT="Related reference" width="143" height="21">
<br>
<a href="../reference/cdt_u_dbg_view.htm">Debug view</a><br>
<a href="../reference/cdt_u_dbg_view.htm">Debug launch controls</a><br>
&nbsp;</p>
<p>
<img src="../images/ng03_04.gif" ALT="IBM Copyright Statement" BORDER=0 width="324" height="14">
</body>

</html>

Back to the top