core/com.nokia.carbide.cpp.doc.user/html/projects/tutorials/new_proj_from_template_04.htm
author fturovic <frank.turovich@nokia.com>
Wed, 14 Jul 2010 15:59:19 -0500
changeset 1617 94b6d1326534
parent 1610 5e244b89116e
child 1645 0083290c145a
permissions -rw-r--r--
revised dll example with new images, TOC, and welcome page
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1610
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
     1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
     2
<html>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
     3
<head>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
     4
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
     5
<meta http-equiv="Content-Style-Type" content="text/css" />
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
     6
<title>Launching and debugging an executable </title>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
     7
<link rel="StyleSheet" href="../../../book.css" type="text/css"/>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
     8
</head>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
     9
<body bgcolor="#FFFFFF">
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    10
<h2><strong>Launching and debugging an executable </strong></h2>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    11
<p>In this example we show how to create a new project using one of the built-in Carbide templates, how to build it into an executable, and how to launch the debugger to verify program accuracy. The steps to do this include:</p>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    12
<ol>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    13
    <li><a href="new_proj_from_template_01.htm">Creating</a> a project from a project template</li>
1617
94b6d1326534 revised dll example with new images, TOC, and welcome page
fturovic <frank.turovich@nokia.com>
parents: 1610
diff changeset
    14
    <li><a href="new_proj_from_template_02.htm">Building</a> the object code based on the project sources</li>
1610
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    15
    <li><a href="new_proj_from_template_03.htm">Defining</a> a launch configuration for running or debugging the application</li>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    16
    <li><strong>Launching and debugging an executable using the Carbide debugger</strong></li>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    17
</ol>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    18
<hr>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    19
<p class="note"><b>NOTE</b> You can only debug compiled programs. Use the <a href="../projects/prj_build.htm">Build Project</a> command to compile project sources into a binary file if you do not already have an executable in the project. A symbolics (<span class="code">.sym</span>) file is also required for debugging on a target device. Ensure that a <span class="code">.sym</span> file has been created. If you are importing an existing application, you may have to rebuild the application and create a related <span class="code">.sym</span> file. Make sure a <span class="code">.sym</span> file has been created in the output directory.</p>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    20
<div class="step">
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    21
    <h4><strong></strong>Launching and debugging an executable</h4>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    22
    <ol>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    23
        <li>Select the project to debug in the Project Explorer view.<br />
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    24
        	<p>For this example you should choose the HelloWorld project created in <a href="new_proj_from_template_01.htm">Step 1</a> of this tutorial.</p>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    25
        </li>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    26
        <li>Set a breakpoint in the project.<br>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    27
       		<p>Open the <span class="code">\src\HelloWorldAppUi.cpp</span> file and <a href="../../debugger/breakpoints/toggling_breakpoints.htm">set</a> a breakpoint in the <span class="code">HandleCommandL</span> routine on Line 103.</p>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    28
            <p><img src="../images/debugging_project_02.png" alt="Setting a breakpoint" width="577" height="192"></p>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    29
        </li>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    30
        <li>Launch the debug session.<br />
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    31
            <p>To run the project on the chosen target and start a debug session use one of the following actions. Clicking Debug is the most common choice as it enables you to assume control of the executable should you encounter a problem.</p>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    32
            <ul>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    33
                <li>Right-click the project and choose Debug As &gt; Debug Symbian OS Application on Emulator.</li>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    34
                <li>Click the Run &gt; Debug (<span class="code">F11</span>) menu item.</li>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    35
                <li>Click the Debug (<img src="../images/icon_debug.png" alt="Debug icon" width="17" height="17" align="absmiddle">) icon in the toolbar.</li>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    36
            </ul>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    37
            <p>The emulator is launched and the <a href="../../reference/perspective_debug.htm">Debug</a> perspective appears to manage the debug session.</p>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    38
        </li>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    39
        <li>Click the Options soft-menu and select any menu option to hit the breakpoint set in Step 2. <br />
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    40
        	<p><img src="../images/debugging_project_04.png" alt="Select menu option" width="360" height="397"></p>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    41
        	<p>Which returns control to the <strong>Debug</strong> perspective in Carbide. Use the various views to examine the program as it runs. Examine variables, set more breakpoints, etc.</p>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    42
        	<p><img src="../images/debugging_project_05.png" alt="Select menu option" width="749" height="626"></p>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    43
        </li>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    44
        <li>Use any of the step commands in the Debug view to step through the program source code.<br />
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    45
       	    <ul>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    46
       	        <li>Click Step Into (<span class="code">F5</span>) to execute the current line and enter a function or method.</li>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    47
       	        <li>Click Step Over (<span class="code">F6</span>) to execute the current line.</li>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    48
       	        <li>Click Step Return (<span class="code">F7</span>) to execute lines until exiting the function or method.</li>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    49
   	        </ul>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    50
        </li>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    51
        <li>Click the Resume icon in the Debug view to return control to the program.</li>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    52
        <li>Click the Exit soft-key in the emulator to exit the debug session.<br />
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    53
        	<p>The HelloWorld program stops, the emulator exits, and control returns to Carbide.</p>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    54
        </li>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    55
    </ol>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    56
</div>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    57
<p>That's it. Congratulations on creating, building, and debugging a Carbide project.</p>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    58
<h4>Other references</h4>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    59
<ul>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    60
    
1617
94b6d1326534 revised dll example with new images, TOC, and welcome page
fturovic <frank.turovich@nokia.com>
parents: 1610
diff changeset
    61
    <li><a href="new_proj_from_template_00.htm">Creating and Debugging New Projects Tutorial</a><a href="./"></a><a href="./"></a></li>
1610
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    62
</ul>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    63
<div id="footer">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. <br>License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    64
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    65
</body>
5e244b89116e revised Create New Project tutorial, updated images, TOC, and welcome link
fturovic <frank.turovich@nokia.com>
parents:
diff changeset
    66
</html>