8 <link rel="StyleSheet" href="../../../book.css" type="text/css"/> |
8 <link rel="StyleSheet" href="../../../book.css" type="text/css"/> |
9 </head> |
9 </head> |
10 <body bgcolor="#FFFFFF"> |
10 <body bgcolor="#FFFFFF"> |
11 <h2>Debugging a Symbian OS Program</h2> |
11 <h2>Debugging a Symbian OS Program</h2> |
12 <p>Use the Carbide.c++ debugger to debug a compiled Symbian OS program in an emulator or on-device. The same process works for other emulators and target devices as well.</p> |
12 <p>Use the Carbide.c++ debugger to debug a compiled Symbian OS program in an emulator or on-device. The same process works for other emulators and target devices as well.</p> |
13 <p class="note"><b>NOTE</b> This example uses the emulator included with the S60 5th Edition SDK. The steps are identical for on-device debugging, although a <span class="code">.sym</span> file is not needed for emulator builds.</p> |
13 <p class="note"><b>NOTE</b> This example uses the Symbian Emulator included with the Symbian^3 SDK. The steps are identical for on-device debugging, although a <span class="code">.sym</span> file is not needed for emulator builds.</p> |
14 <div class="step"> |
14 <div class="step"> |
15 <h4>Debugging a Symbian OS program</h4> |
15 <h4>Debugging a Symbian OS program</h4> |
16 <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> |
16 <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> |
17 <ol> |
17 <ol> |
18 <li>Set a breakpoint in the MyProject program</li> |
18 <li>Set a breakpoint in the MyProject program</li> |
19 <p>Open the <span class="code">\src\MyProjectAppUI.cpp</span> file and <a href="../breakpoints/pgm_bp_setting.htm">set a breakpoint</a> in the <span class="code">HandleCommandL</span> routine.</p> |
19 <p>Open the <span class="code">\src\OortCloudAppUI.cpp</span> file and <a href="../breakpoints/pgm_bp_setting.htm">set a breakpoint</a> in the <span class="code">HandleCommandL</span> routine.</p> |
20 <p align="center"><img src="images/debug_set_breakpoint.png" width="707" height="253" /></p> |
20 <p align="center"><img src="images/debug_set_breakpoint.png" width="678" height="281" /></p> |
21 <p class="figure">Figure 1 - Breakpoint set in MyProjectAppUI::HandleCommandL routine. </p> |
21 <p class="figure">Figure 1 - Breakpoint set in COortCloudAppUI::HandleCommandL routine. </p> |
22 <li>Launch the Carbide debugger and S60 SDK Emulator</li> |
22 <li>Launch the Carbide debugger and Symbian Emulator</li> |
23 <p><a href="../../debugger/debug/cmds_starting.htm">Start</a> the Carbide debugger which launches the S60 SDK Emulator, installs and launches the executable. For on-device debugging, the application is installed on the target device.</p> |
23 <p><a href="../../debugger/debug/cmds_starting.htm">Start</a> the Carbide debugger which launches the Symbian Emulator, then installs and launches the executable. For on-device debugging, the application is installed on the target device.</p> |
24 <p>The HelloCarbide application launches (Figure 2). </p> |
24 <p>The OortCloud application launches (Figure 2). </p> |
25 <p align="center"><img src="images/debug_s60_emulator_04.png" width="465" height="811" /></p> |
25 <p align="center"><img src="images/wnd_symbian_emulator_01.png" alt="Symbian Emulator" width="238" height="458"></p> |
26 <p class="figure">Figure 2 - MyProject application running on S60 Emulator </p> |
26 <p class="figure">Figure 2 - OortCloud application running on Symbian Emulator </p> |
27 <p class="note"><b>NOTE</b> For SDKs prior to the S60 5th Edition it may be necessary to locate the installed application and manually launch it in the emulator or on the target device.</p> |
27 <p class="note"><b>NOTE</b> For SDKs prior to the S60 5th Edition it may be necessary to locate the installed application and manually launch it in the emulator or on the target device.</p> |
28 <li>Click the Options soft-key on the S60 Emulator to display the Options menu.</li> |
28 <li>Click the Options soft-key on the Symbian Emulator to display the Options menu.</li> |
29 <li>Choose the Message menu item and press the Select soft-key to send a message (Figure 3).</li> |
29 <li>Choose the Message menu item and press the Select soft-key to send a message (Figure 3).</li> |
30 <p></p><p align="center"><img src="images/debug_s60_emulator_05.png" width="465" height="458" /></p> |
30 <p></p><p align="center"><img src="images/wnd_symbian_emulator_02.png" alt="Menu selection" width="378" height="431"></p> |
31 <p class="figure">Figure 3 - Send Message to MyProject application </p> |
31 <p class="figure">Figure 3 - Send Message to OortCloud application </p> |
32 <p>The <span class="code">HandleCommandL</span> breakpoint is hit in the program and control returns to the Carbide debugger (Figure 4). You can now set additional breakpoints, examine variables, or use the <a href="../../debugger/debug/viewing_debug.htm">Debug</a> view buttons to control the program. </p> |
32 <p>The <span class="code">HandleCommandL</span> breakpoint is hit in the program and control returns to the Carbide debugger (Figure 4). You can now set additional breakpoints, examine variables, or use the <a href="../../debugger/debug/viewing_debug.htm">Debug</a> view buttons to control the program. </p> |
33 <p align="center"><img src="images/debug_s60_emulator_06.png" width="686" height="276" /></p> |
33 <p align="center"><img src="images/wnd_symbian_emulator_03.png" alt="Breakpoint hit" width="678" height="281"></p> |
34 <p class="figure">Figure 4 - Back in the CMyProjectAppUI::HandleCommandL routine</p> |
34 <p class="figure">Figure 4 - Back in the COortCloudAppUI::HandleCommandL routine</p> |
35 </ol> |
35 </ol> |
36 <p>That's it for this basic introduction to debugging with Carbide.c++.</p> |
36 <p>That's it for this basic introduction to debugging with Carbide.c++.</p> |
37 </div> |
37 </div> |
38 <h5>Concepts</h5> |
38 <h5>Concepts</h5> |
39 <ul> |
39 <ul> |