core/com.nokia.carbide.cpp.doc.user/html/tasks/debugger/stop_mode_debug_launchcfg.htm
author fturovic <frank.turovich@nokia.com>
Tue, 31 Aug 2010 22:58:09 -0500
changeset 1934 4f0cd256d26c
parent 1854 49624691da34
permissions -rw-r--r--
BUG 11531 - fixed reported issues from Rooney and Stephen for SDK section

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<title>Stop Mode On-Device Debugging</title>
<link rel="StyleSheet" href="../../../book.css" type="text/css"/>
</head>
<body bgcolor="#FFFFFF" dir="ltr">
<h2> Defining a Stop Mode Debug Configuration</h2>
<p>After installing all necessary software such as Perl, JTAG, compilers, Devkits and SDKs and creating your project, you will need to define a Debug launch configuration for your project. For this example, we will define a Trace32 launch configuration. For new projects that do not have a launch configuration, a New Launch Configuration Wizard will appear and allow you to define settings. You can also cancel the wizard and define a launch configuration from the following instructions.</p>
<div class="step">
  <h4>Define a Launch Configuration </h4>
  <ol>
    <li>Access the Debug window
      <ol type="a">
        <li>If necessary, import a project's  .mmp or .inf file in Carbide.c++.</li>
          <li>Select the Project in the C/C++ Project view that you want to debug.</li>
          <li>Select the Run &gt; Debug… menu option to display the Debug launch configuration window.</li>
          <li>Define a debug launch configuration to communicate with the on-device debug agent or protocol interface.</li>
          <li>In the Debug window, define the type of debug launch configuration to use when debugging programs on the target device.</li>
      </ol>
  </li>
    <p align="center"><img src="images/Debug_Config_window.png" width="704" height="455" /></p>
    <p align="left" class="figure">Figure 1 - Debug Configurations</p>
    <p>Select either a Symbian OS Trace32 configuration type for stop mode on-device debugging and click the New launch configuration icon. The following pages require review and possible option settings:</p>
    <ul>
      <li> Main - defines the project to be launched on the target device</li>
        <li>Connection - specifies the method used to transfer files to the target device</li>
        <li> Debugger - provides control over entry points, message handling, and instruction set default settings</li>
        <li> ROM Image- specifies startup options and ROM log and image files </li>
        <li>Source - specifies the source lookup paths </li>
    <li>Common - specifies general launch configuration settings </li>
    </ul>
    <p>Click <b>Debug</b> after all the preference panels have been set. The Debug window closes and the Carbide.c++ debugger begins a debugging session using the new configuration. The next time you click the Debug icon, this debug launch configuration is used to start a debug session.</p>
    <li>Define Main Tab Settings</li>
    <p>The Main pane shown in Figure 2 defines the project to be launched on the target device. Table 1 defines the fields.</p>
    <p><img src="images/Debug_Config_main.png" width="830" height="506" /></p>
    <p class="figure">Figure 2 - Debug Window - Main Tab</p>
    <p>Table 1. Main pane</p>
    <table width="94%"  border="0" cellpadding="2" cellspacing="0">
      <tr>
        <th width="38%" scope="col">Item</th>
        <th width="62%" scope="col">Explanation</th>
      </tr>
      <tr>
        <td><span class="style12"><strong>Project</strong></span></td>
        <td><p>The project to associate with this debug launch configuration. Click Browse to select a different project.</p></td>
      </tr>
      <tr>
        <td><span class="style12"><strong>Executable</strong></span></td>
        <td><span
 style="font-weight: normal;">This is the name of the executable that is linked to the project. </span>Click <b>Browse</b> to select a different executable.</td>
      </tr>
    </table>
    <p></p>
    <li> Define Connection Tab Settings</li>
    <p><img src="images/Debug_Config_connection.png" width="804" height="309" /></p>
    <p class="figure">Figure 3 -  Debug Window - Connection Tab</p>
    <p>Table 2 - Connection pane</p>
    <table width="94%"  border="0" cellpadding="2" cellspacing="0">
      <tr>
        <th width="38%" scope="col">Item</th>
            <th width="62%" scope="col">Explanation</th>
      </tr>
      <tr>
        <td>
            <p class="style11"><b>Trace32 Executable</b></p></td>
            <td><p>Specify the path to the Trace32 executable. The default path assumes that the Trace32 executable is installed in the default location: C:\T32\T32marm.exe.</p></td>
      </tr>
      <tr>
        <td>
            <p class="style11"><b>Trace32 Configuration File</b></p></td>
            <td>Specify the path to the config.t32 file or other custom configuration file. The default path assumes that the Trace32 configuration file is installed in the default location: C:\T32\config.t32.
              <p>For arm11 processors copy the trace32 configuration file for non-ARM11 processor (config_arm11.t32) to your C:\T32 folder and specify it in the edit box.</p>
              <p>You can modify the config.t32 file to support UDP (User Datagram Protocol) connections by adding the following lines: <br />
                PBI=USB<br />
                RCL=NETASSIST<br />
                PACKLEN=1024<br />
                PORT=20000</p></td>
      </tr>
      <tr>
        <td>
            <p class="style11">
                <b>Trace32 Initialization Script</b></p></td>
            <td><p>Specify the path to the initialization <span class="code">cmm</span> file. This script will be run in T32 after connecting to T32. You can specify your own scripts for the targets used.</p></td>
      </tr>
      <tr>
        <td>
            <p class="style11"><b>
            View messages between Carbide and Trace32</b></p></td>
            <td>Enable to log communications with Trace32 to the console window.</td>
      </tr>
    </table>
	<p></p>
    <li>Define Debugger Tab Settings</li>
    <p align="center"><img src="images/Debug_Config_debugger.png" width="594" height="297" /></p>
    <p class="figure">Figure 4 - Debug Window - Debugger tab</p>
    <p>Table 3 -  Debugger pane</p>
    <table width="94%"  border="0" cellpadding="2" cellspacing="0">
      <tr>
        <th width="38%" scope="col">Item</th>
        <th width="62%" scope="col">Explanation</th>
      </tr>
      <tr>
        <td><span class="style6"><strong>Break at entry point</strong></span></td>
        <td><p>When checked, break at the specified entry point entered in the text field. For .EXE targets, the default entry point is set to <span class="code">E32Main</span>. By default, the <b>Break at entry point</b> option is unchecked for all other target types.</p></td>
      </tr>
      <tr>
        <td><span class="style6"><strong>Target Processor </strong></span></td>
        <td>A drop down with a list of all supported processors.  The process selection should help in determining the memory model. This will in turn help determine the base address and the offsets for the Symbian OS kernel aware information.</td>
      </tr>
      <tr>
        <td>
        <p class="style8"><strong>Target Initialization File</strong></p></td>
        <td><p>Check this box to have the debugger run an initialization script when the debug session starts. For example, if a target device requires initialization for the debugger to be able to read and write memory or registers, you can specify an initialization script here. Click Browse to select a script file using a standard file selection dialog box.</p>
            <p>When using T32, most of the initialization is done in the CMM script file. With other debug protocols you  specify the initialization file, which can be run after connecting to the target.</p></td>
      </tr>
      <tr>
        <td>
        <p class="style8"><strong>Memory Configuration File</strong></p></td>
        <td>Controls whether the debugger uses a memory configuration file when a debug session starts. The Carbide debugger uses this configuration file to know which memory is accessible, readable, and writable on the target.</td>
      </tr>
      <tr>
        <td>
        <p class="style8"><strong>Reset target at the start of each debug session</strong></p></td>
        <td>Forces the Carbide IDE to reset the target at the start of each debug session. This ensures that the debugging session uses the most up-to-date program code.</td>
      </tr>
      <tr>
        <td><p class="style6"><strong>Default Instructon Set </strong></p></td>
        <td><p>Specifies the default instruction set to use if the debugger cannot determine the processor mode in order to set breakpoints and to disassemble code. This can happen at addresses for which we have no symbolic information. The debugger uses the mode when setting breakpoints and disassembling code. The options are:</p>
            <ul>
              <li>Auto (examine code at current PC location) </li>
              <li>ARM (32-bit) </li>
              <li>THUMB (16-bit) </li>
            </ul>
            <p>By default the Instruction Set option uses ARM 32-bit.</p></td>
      </tr>
    </table>
    <p></p>
    <li>Define ROM Image Tab</li>
    <p align="center"><img src="images/Debug_Config_ROM.png" width="594" height="481" /></p>
    <p class="figure">Figure 5 - Debug Window - ROM Image Tab</p>
    <p>Table 4 - ROM Image pane</p>
    <table width="94%"  border="0" cellpadding="2" cellspacing="0">
      <tr>
        <th width="38%" scope="col">Item</th>
        <th width="62%" scope="col">Explanation</th>
      </tr>
      <tr>
        <td>
          <p class="style8">
              <b>Start Address</b></p></td>
        <td><p>Enter the physical address in memory where the Symbian OS start code begins execution. This address is target-specific. The address should be in hexadecimal format with the 0x prefix. For example, 0x8000000 is a valid entry.</p>
          <p class="note"><b>NOTE</b> The address entered in this field must match the start address specified in the source code used to build the Symbian OS ROM image to be debugged. The Start address must match the Download address.</p></td>
      </tr>
      <tr>
        <td>
          <p class="style8">
              <b>Debug from Start address</b></p></td>
        <td>Select this option to have the debugger halt the program at the address specified in Start Address once the target initialization is done and the OS is downloaded; if the user has chosen to download the OS. You can then step through start-up code or run the target in bare-board mode.</td>
      </tr>
      <tr>
        <td>
          <p class="style8">
            <b>Run from start address</b></p></td>
        <td>Select this option to have the debugger start the code at the address specified in Start Address once the target initialization is done. If you have breakpoints set, the debugger stops at the first breakpoint encountered. You can click the Break button to halt the device.</td>
      </tr>
      <tr>
        <td>
          <p class="style8">
              <b>Symbian ROM Log file</b></p></td>
        <td>Check the Parse ROM Log File option and specify the information that the debugger needs in order to show detailed stack information, set breakpoints, and show source level debugging information for ROM images. In the first text field, browse to or enter the full path and name of the log file that corresponds to the ROM image on the target device. This log file is generated by default when the ROM image is built.</td>
      </tr>
      <tr>
        <td>
          <p class="style8">
              <b>Symbian OS Kit EPOC32 Directory</b></p></td>
        <td class="note"><p>Specifies the epoc32 directory in which the ROM image and log files are stored. Since the log file may not contain full paths to the ROM components on the host PC, you need to enter this epoc32 directory.</p>
            <p class="note"><b>NOTE</b> Always include the epoc32 folder in this path.</p></td>
      </tr>
      <tr>
        <td>
          <p class="style8">
              <b>Log unresolved modules</b></p></td>
        <td class="note"><p>Check this box to have the debugger output a list of components from the specified ROMBUILD log file that do not have debugger symbolic information. The list is displayed in the debugger console window at the beginning of the debug session.</p>
            <p class="note"><b>NOTE</b> You cannot perform source-level debugging on components that do not include symbolic information.</p></td>
      </tr>
      <tr>
        <td>
          <p class="style8"><b>Debug non-XIP Executables</b></p></td>
        <td><p>Check this box to debug a project, or a dynamically loaded module, that is loaded from NAND-Flash or other removable media (MMC, memory stick, etc.) at run time and executed in RAM. Use this option to debug modules that work fine when executed in place as part of the ROM image, but sometimes fail when placed in NAND-Flash or other removable media.</p>
            <p class="note"> <b>NOTE</b> Selecting this option will affect debugging performance. When the debugger needs to load a module (DLL, EXE, etc.) it will stop the target, read information from it, then restart it.</p></td>
      </tr>
      <tr>
        <td>
          <p class="style8"><b>Symbian ROM Image</b></p></td>
        <td>Controls the logging of communication with Trace32. Enable to log communications with Trace32 to the console window.</td>
      </tr>
      <tr>
        <td>
          <p class="style8"><b>Download Address (hex) </b></p></td>
        <td><p>Enter the physical address in memory at which the debugger should place the ROM image. This address is target-specific. The address should be in hexadecimal format with the 0x prefix. For example, 0x000FFF00 is a valid entry.</p>
          <p class="note"> <b>NOTE</b> The address entered in this field must match the download address specified in the source code used to build the Symbian OS ROM image to be debugged. If you leave this field blank, the debugger does not download the ROM image to the device at the beginning of the debug session. The Download address must match the Start address.</p></td>
      </tr>
      <tr>
        <td>
          <p class="style8"><b>Ask for download at the start of each debug session</b></p></td>
        <td>Check this box to have the debugger display a dialog box at the beginning of every debug session that lets you choose whether or not you want the debugger to download the ROM image to the device.</td>
      </tr>
    </table>
  </ol>
</div>
<h5>Related Tasks</h5>
<ul>
  <li><a href="stop_mode_debug_precond.htm">Stop Mode On-Device Debugging Preconditions</a></li>
</ul>

<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>

</body>
</html>