carbidecpp22devenv/configuration/org.eclipse.osgi/bundles/309/1/.cp/getting_started/cdt_w_debug.htm
author cawthron
Fri, 04 Dec 2009 10:01:33 -0600
changeset 5 684bf18fdedf
permissions -rw-r--r--
add files for RCL_2_2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     2
<html lang="en">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     3
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     4
<head>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     5
	<meta http-equiv="Content-Language" content="en-us">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     6
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     7
	<title>Debugging your project</title>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     8
	<link rel="stylesheet" type="text/css" href="../help.css">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
     9
</head>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    10
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    11
<body>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    12
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    13
<h1>Debugging a project</h1>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    14
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    15
<p>The debugger lets you control the execution of your program by setting 
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    16
breakpoints, suspending executed programs, stepping through your code, and 
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    17
examining the contents of variables.</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    18
<p>To debug a project:</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    19
<ol>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    20
  <li>Click <b>Run  &gt; Debug Configurations...</b>.<p>The Debug Configurations dialog opens.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    21
  <li>Double-click <b>C/C++  Application</b>.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    22
  <li>In the <b>Name</b> field, type <b>Hello World</b>.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    23
  <p>You can now select this debug launch configuration by name the next time 
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    24
  that you debug this project.</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    25
  <li>In the <b>Project</b> box, type or choose your project, e.g. <b>HelloWorld</b>.   
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    26
  <br> 
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    27
  Your executable should be selected under "C/C++ Application."
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    28
  <br>If not, the <b>Search Project</b> button should find the executable in the project.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    29
  <p>&nbsp;</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    30
  </li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    31
  <ul>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    32
  <li>If you see the error "[Debugger]: No debugger available", select the Debugger tab
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    33
  and choose a valid debugger for your platform (e.g. gdb/mi).
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    34
  </li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    35
  </ul>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    36
  <li>Click <b>Debug</b>.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    37
  <p>You will be prompted to switch to the Debug Perspective.  Click <b>Yes</b></p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    38
  <p>You will now see the debug perspective with the hello.exe application window open. 
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    39
  The C/C++ editor repositions in the perspective.</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    40
    <ul>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    41
  <li>If you see an error in the editor "Can't find source file" you can use the buttons provided
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    42
  to point to your source file, e.g. "Locate File."
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    43
  </li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    44
  </ul>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    45
  <li>In the left margin of the main.cpp window, double-click to set a 
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    46
  breakpoint on:<br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    47
  &nbsp;cout &lt;&lt; &quot;You just entered&quot;
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    48
  <br>You'll see an icon there indicating the breakpoint is set.</br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    49
  </li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    50
  <li>Click <b>Run  &gt; Resume</b>.
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    51
  <br>Or, you can use the <b>Resume</b> button (green arrow) on the toolbar <i>of the Debug View</i>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    52
  </li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    53
  <li>When prompted, in the Console view, type a value other than 'm', and hit Enter/Return.<br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    54
  The breakpoint will be hit.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    55
  <li>In the <b>Variables</b> view, verify that the variable is not 'm'.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    56
  <li>Click <b>Run  &gt; Resume</b>.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    57
  <li>When prompted, again type a value other than 'm' in the Console view, and press Enter/Return.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    58
  <p>The breakpoint will be hit.</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    59
  <li>In the <b>Variables</b> view, verify that the variable is not 'm'.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    60
  <li>In the <b>Variables</b> view, right-click the input variable, and select <b>Change Value...</b> 
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    61
  and type <b>'m'</b> <i>between the single quotes</i> and hit <b>OK</b>.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    62
  <li>Click <b>Run  &gt; Resume</b>.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    63
  <p>The output in the hello.exe application window is:<br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    64
&nbsp;&quot;You just entered m, you need to enter m to exit.&quot;
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    65
<li>The application terminates and the debug session ends. The debug 
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    66
  perspective remains open.</li>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    67
</ol>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    68
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    69
<p>To learn more about   debugging, see   the related debug conceptual topics.</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    70
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    71
<p align="left"> <a href="cdt_w_build.htm">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    72
<img border="0" src="../images/ngback.gif" width="16" height="16" alt="Back icon"></a><b> <a href="cdt_w_build.htm">Back: Building a project</a></b>&nbsp;&nbsp;&nbsp; </p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    73
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    74
<p><img border="0" src="../images/ngconcepts.gif" ALT="Related concepts" width="143" height="21">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    75
<br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    76
<a href="../concepts/cdt_c_over_dbg.htm">Debug overview</a><br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    77
<a href="../concepts/cdt_c_dbg_info.htm">Debug information</a></p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    78
<p><img border="0" src="../images/ngtasks.gif" ALT="Related tasks" width="143" height="21">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    79
<br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    80
<a href="../tasks/cdt_o_debug.htm">Debugging</a></p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    81
<p><img border="0" src="../images/ngref.gif" ALT="Related reference" width="143" height="21">
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    82
<br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    83
<a href="../reference/cdt_u_dbg_view.htm">Debug view</a><br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    84
<a href="../reference/cdt_u_dbg_view.htm">Debug launch controls</a><br>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    85
&nbsp;</p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    86
<p>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    87
<img src="../images/ng00_04a.gif" ALT="QNX Copyright Statement" >
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    88
</body>
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    89
684bf18fdedf add files for RCL_2_2
cawthron
parents:
diff changeset
    90
</html>