CodeWarrior For Symbian OS
CodeWarrior For Symbian OS
CodeWarrior For Symbian OS
for Symbian ™ OS
Version 3.1; November 29, 2005
Revised <Date>
Table of Contents
1 Introduction 9
1.1 What is New. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.2 System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.3 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.3.1 For everyone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.3.2 If you are new to CodeWarrior IDE . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.3.3 For information on the Symbian operating system . . . . . . . . . . . . . . . 11
1.4 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.5 Features Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.5.1 SDKs and Development Kits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.5.2 Builds Tools. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.5.3 Emulation Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.5.4 Device Debugging. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.5.5 Device Debugging in ROM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.5.6 Kernel Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.6 Contacting Us . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.7 Legal Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5 Emulation Debugging 75
5.1 Target Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75
5.1.1 Runtime Settings Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76
5.1.2 Debugger Settings Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77
7 Creating Packages 95
7.1 Step 1: Creating .pkg Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
7.1.1 .pkg Files Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
7.1.2 .pkg File Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
7.1.3 Project Files and .pkg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
7.2 Step 2: Creating .sis Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
7.2.1 .sis File Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
7.2.2 Symbian Installer Post-Linker. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
7.2.3 .sis File Settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
7.3 Step 3: Uploading .sis Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Index 223
• “Supporting Dynamic Targets (OEM only)” supports dynamic targets, enabling you
to tell the IDE how to support new releases of both hardware and operating systems.
NOTE This manual describes all the features available for Symbian development.
Access to a specific feature is controlled by the version of the CodeWarrior
Development Studio installed and your licensing agreement.
Table 1.1 Support Package Used for Development with each CodeWarrior Edition
1.3 Documentation
You do not have to read the chapters in this manual sequentially. Use this manual to learn
about using CodeWarrior tools to develop software for the Symbian operating system.
You will find the manuals mentioned in this section on the CodeWarrior Development
Studio for Symbian OS CD.
• Read the Release Notes for additional release informaton. To view, choose Help >
CodeWarrior Help from the CodeWarrior menu bar, then click Release Notes in
the Contents list.
1.4 Glossary
The glossary terms in Table 1.2 are used throughout this manual.
Table 1.2 Symbian OS glossary
Table 1.1 lists each edition of the CodeWarrior for Symbian OS product along with the
SDK or devkit used with each.
The CodeWarrior debugger builds and debugs both EKA1 and EKA2 based software
projects that run on Symbian OS hardware devices.
NOTE TRK must be enabled on the target device to support device debugging.
NOTE TRK must be enabled on the target device to support device debugging in
ROM.
1.6 Contacting Us
We welcome and consider all comments and suggestions. Please send them to:
Headquarters Nokia
Developer Platform Tools - IDE Solutions
701 Brazos Street, Suite 1000
Austin, Texas, 78701
USA
Sales sales.codewarrior@nokia.com
Licensing license.codewarrior@nokia.com
NOTE Although the CodeWarrior IDE User's Guide describes how to import UNIX-
style make files, this IDE feature is not available with CodeWarrior
Development Studio for Symbian OS software.
NOTE Projects created using these steps work for Symbian OS v7, v8, and v9 (with
Platform Security) targeted projects.
copy an example .mmp file from a development kit or SDK and convert to a project for
the IDE. Importing a .mmp file saves you the trouble of creating a new CodeWarrior
project.
NOTE The list of vendors and SDKs that are available varies, depending on which
SDKs are installed on your computer.
NOTE If a message box appears containing the message “No stationery projects found
in selected SDK,” the SDK or devkit you selected does not include
CodeWarrior stationery.
In this case, you cannot use the Symbian Importer to create a CodeWarrior
project that uses the chosen SDK or devkit. You can, however, create a
CodeWarrior project that uses the desired kit by importing one of its makmake
files. See “Importing a Project from a makmake Project File” for instructions.
3. Set import file and platform values in the Symbian Importer - MMP File Selection
(Figure 2.2) window
a. Type the file name of .mmp file in the MMP File Selection text field.
You must include the absolute path to the .mmp file. Alternatively, you can click
on the Browse button to locate the .mmp file.
b. In the Platform Selection field, type the names of the platforms for which you
want to build software in the CodeWarrior IDE project, separated by commas (“,”).
For specific platform builds that are different from the default, the Symbian OS
DevKit that is being targeted must support the platform. To determine which
platforms are supported in the DevKit, open a command prompt and type
“makmake /?” (without the quotes). This command shows the specific makmake
version that is currently set as the default target along with the supported platforms.
Phone ABI
c. Type the makmake file name into the Specify alternate ‘makmake’ name
Enter a script name of no more than 32 characters into this text box if you need to
invoke a makmake script that differs from the default makmake.pl during the
build process. This information is stored into the registry and displayed on the next
project import. Any errors are reported to a new empty editor window.
NOTE Because there is no way to determine what script was used to create a project,
the re-importer option will use the last known makmake name to import a
project.
e. Click Next
The IDE displays the Symbian Importer - Project Template Selection window
(Figure 2.3).
4. Select the import template to apply to the new project in the Symbian Importer -
Project Template Selection window (Figure 2.3)
a. Select the Symbian Project Import Template to apply to the imported project. The
choices include:
• Enable the Default Symbian Project Import Template option to apply the
default Symbian project template setting. This template provides the default
settings necessary to create a Symbian project.
or
• Enable the Alternate Symbian Project Import Template, and select a
template from the list with the desired template settings. Use this option when
you import a project that requires special settings or setup. See “Using Symbian
Project Import Templates” for information on how to create your own template
projects.
b. Click Finish
The CodeWarrior IDE converts the .mmp file to a CodeWarrior project and
displays it in a project window (Figure 2.4).
The CodeWarrior IDE creates a project with the same name as the .mmp file that you
imported, except that the CodeWarrior project file ends with the .mcp extension. The
CodeWarrior IDE saves the .mcp file in the same directory where the .mmp file resides.
In addition to the .mcp file, the IDE creates two other files:
• .xml file - used to facilitate the import process
• .pref file - includes information such as the UID, target name, and target type for
EKA1-based projects only. They are not used for EKA2-based projects. For EKA2-
based projects, makmake adds the <project>_uid.cpp file to the project.
The CodeWarrior IDE also creates a directory named ProjectName Data, where
ProjectName is the name of your project. The CodeWarrior IDE uses this directory to
store internal data. Do not modify or move any files in this directory.
The CodeWarrior project contains the source files and other files that were specified in the
.mmp file.
When you import a .mmp file, the CodeWarrior IDE defines the path to project
dependencies. This means that the CodeWarrior project contains the definition of paths to
all libraries and include directories. The project defines these directory paths relative to
the root directory of the SDK or development kit. You can view path definitions in the
Source Trees settings panel. For more information about the Source Trees panel, see the
IDE User’s Guide.
When the CodeWarrior IDE imports a .mmp file, it also adds a preference (.pref) file to
the CodeWarrior project. For more information about the .pref file, see “Preference
(.pref) File”.
Changes that you make to the CodeWarrior project do not affect the original makmake
project (.mmp) file.
NOTE Before you can create a CodeWarrior project from stationery, you must install
at least one Symbian software development kit (SDK) or OS development kit
(devkit).
In practice, whether you will use an SDK, a devkit, or both depends on the edition of
CodeWarrior for Symbian OS you are using (see Table 2.2). Further, if you are using an
OS devkit, it must be version 7.0.7 or higher.
Table 2.2 Support Package Used for Project Creation by CodeWarrior Edition
NOTE Many Symbian SDKs and devkits do not include CodeWarrior stationery. If
you are using such a kit, you can still create a CodeWarrior project by
importing any of the kit’s makmake files. See “Importing a Project from a
makmake Project File”.
NOTE The CodeWarrior project manager also creates a directory named ProjectName
Data, where ProjectName is the name of your project. The CodeWarrior IDE
uses this directory to store internal data. Do not modify or move any files in
this directory.
3. Select vendor and SDK or development kit in the Symbian Project Wizard - SDK
Selection window
The Symbian Project Wizard - SDK Selection window lists the SDKs and
development kits installed on your computer that are compatible with the CodeWarrior
IDE. The SDKs and development kits are grouped by vendor.
a. Select a vendor
The left hand pane in the Symbian Project Wizard - SDK Selection window
shows a list of vendors. The right-hand pane lists all the SDKs or development kits
available from the chosen vendor.
NOTE The list of vendors and SDKs that are available varies, depending on which
SDKs are installed on your computer.
Figure 2.9 Symbian Project Wizard - Target and File Gen Options window
5. Select target and file options in the Symbian Project Wizard - Target and File Gen
Options window
The Symbian Project Wizard - Target and File Gen Options (Figure 2.9) window
shows information about the target application or file.
a. In the Platform Selection field, type the names of the platforms for which you
want to build software in the CodeWarrior IDE project, separated by commas (“,”).
For specific platform builds that are different from the default, the Symbian OS
DevKit that is being targeted must support the platform. To determine which
platforms are supported in the DevKit, open a Command Prompt window and type
“makmake /?” (without the quotes). This command shows the specific makmake
version that is currently set as the default target along with the supported platforms.
b. Enter Application Identifiers information into the Application Title and Unicode
UID text boxes. The application identifiers include:
• Application Title–program title substituted in the Nokia stationery. Not used
anywhere else at this time.
• Unicode UID–enter the UID3 value, the application’s unique identifier. Click
Test UID to generage a temporary value. Permanent values must be requested
from Symbian (uid@symbiandevnet.com, subject = UID Request) to
commercially distribute the program.
c. Enter File Comment Information into the Copyright and Author text boxes
A project created from stationery contains example source files, a .pref file, and
other files that give you a starting point for your project. You can modify these
files and save them with a new name or replace them with your own files.
NOTE A .def file must be included in the project target to export a project. The IDE
will not create one if it is missing.
CAUTION All changes made to the .mcp file are lost when the MMP settings are re-
imported.
Before the IDE can re-import an MMP file, the following information is required:
• {SDK Root} must be specified–this enables the plug-in to locate the correct SDK
version of makmake.pl to use when re-importing the MMP file.
• The MMP file must be in the project target.
• Build target–the build targets that makmake.pl understands are part of the
CodeWarrior project's name. To locate the correct target, the IDE uses this naming
convention:
[PROJECT_NAME] <BUILD TARGET> <UDEB | UREL>
Where <BUILD TARGET> is the target list passed to makmake.pl during re-
import. Here are some target name examples that work:
HELLOWORLD WINSCW UDEB
ARM4 UREL
These XML template files contain all the preferences settings for all IDE supported build
types (e.g. WINSCW, ARMV5, THUMB, etc.):
• cw_project_template_v4.xml–the template used for Symbian OS v3.0
• cw_project_template_v3.xml–the template used for Symbian OS v2.8.
• cw_project_template_v2.xml–the template used for Symbian OS v2.0-2.5.
These templates are located in the {SDK Root}\epoc32\tools directory.
TIP When using template files, we recommend simply choosing the latest version and
modify as required.
1. Select the File > Manage Symbian Project Template > Export Symbian Template
for Project Project_Name menu item from the CodeWarrior menu bar
The Export Symbian Project Template window appears.
2. Enter a name for Symbian Project Import Template file in the File name text field
The XML file is stored in the default Project_Import_Templates folder. If
you change this default save location the filename does not appear as a template option
when you import a MMP file.
3. Click Save
The IDE saves the Symbian Project Import Template in XML format. The next time
you import a project, the Symbian Project Import Template appears as one of the
alternates.
See “Importing a Project from a makmake Project File” for information on importing a
project.
2.4 Troubleshooting
When attempting to import and make a project, the IDE reports the error:
makmake tool failed to generate the project XML file
What is wrong?
This error indicates that Perl is not installed, or that the wrong version of Perl is present.
To correct, remove the current Perl installation, if any, and rerun the UIQ or Series 60
SDK installer. This installs the correct supported version of ActivePerl version 5.6.1.
How can I get more useful diagnostic information from MMP Importer reported errors
that would help track down the problem?
Enter the string “-keeptempfiles” into the Platform Selection text box on Page 2 of
the Importer Wizard. This tells the IDE to save the temporary files it creates during an
import operation. For example:
-keeptempfilesARM4,WINSCW
The MMP Importer first checks this flag, and deletes it if it exists. The two files that
appear in the MMP project import directory are:
generate_cw.pl -> Perl script that calls makmake
cw_log.txt -> Verbose output of makmake
ARMV6 Yes
GCC-E Yes
NOTE The CodeWarrior IDE does not support the direct conversion of a v1 compiler
project to a v2 compiler project. Instead, users should adjust their .mmp files
and re-import into the IDE as a new project.
These panels are common between Symbian Linker v2 and Symbian Linker projects:
• “Build Extras Panel”
• “Source Trees Preference Panel”
• “Target Settings Panel”
The following panels are available to control project options when you choose Symbian
Linker v2 in the Target Settings panel.
• “Symbian Compiler Panel”
• “Symbian Linker Panel”
• “Symbian Common Panel”
• “Symbian Tools Panel”
Option Explanation
Prefix File Specify the name of the prefix file for the build target. If
a path is not specified, the compiler searches for the file
in the access paths, then passes it to the language
parser for browser database generation. The Prefix File
name is limited to 256 characters.
Option Explanation
• canRun – The makmake utility sets this value to ‘0’ or ‘1’ based upon the linker
output file type. This argument is disabled for all non-WINSCW targets. Default
setting is ‘0’.
NOTE To modify a hidden argument, you must Export the panel settings to an XML
file, modify the option in the XML file, then Import the updated XML file to
the settings panel.
Option Explanation
Importer Library Specifies the path to the import library. If a path is not
specified, the compiler searches for the file in the access
paths, then passes it to the language parser for browser
database generation. The Import Library name is
limited to 256 characters.
Option Explanation
Development Kit EPOCROOT Specifies the path to the selected development kit’s
epoc32 directory. The IDE sets the PATH for the tool
executing the current build process using a source tree
relative format. For example, the root directory used for
tools is: \\epoc32\tools.
Display generated commands in Controls whether the IDE displays the command lines
the message window generated by the various tools in the Messages window.
Turn this option on to display the generated command
lines. Turn this option off to prevent display of any
generated command lines.
NOTE The x86 compiler supports the precompile command for Symbian OS projects
although others may do so in the future.
You can precompile a header file by opening it and selecting Project > Precompile from
the CodeWarrior menu bar. You can also right-click the file name in the project window
and select Precompile from the contextual menu.
A precompiled header file (.pch++) outputs to a new identically named file with the
.mch++ extension. For example, HelloWorld.pch++ outputs as
HelloWorld.mch++. C++ source files must use the .pch++ extension.
Listing 3.1 shows an example of a precompiled header source file called
pch_test.pch++.
#include <e32def.h>
#define FOO 1
#define LATIDA 345
The resultant output file, pch_test.mch++ can be included in other source or prefix
files as:
#include pch_test.mch++
For more information on precompiled headers, see the C Compiler Manual and IDE
User’s Guide.
TARGET pch_test_ignore.dummy
TARGETTYPE lib
UID 0x100039CE 0X10008ACE
TARGETPATH \system\apps\pch_test
SOURCEPATH .
SOURCE pch_test.pch++
USERINCLUDE .
SYSTEMINCLUDE \epoc32\include
SYSTEMINCLUDE \epoc32\include\techview
WARNING! Because an XML file can be edited in any text processor, care must be
exercised to ensure that the XML is valid; otherwise, errors in linking
will occur, stopping the build process.
The skeleton of a . cwlink descriptor file appears in Listing 3.3. It is not complete, but
illustrates the link descriptor file format.
<template-file xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.forum.nokia.com/schemas/
2005/CWIDE/SymbianLinkDescriptor.xsd">
<template>
<version>1</version>
<setting uuid-alias="." entry="linkCommandSet">
<array inheritance="none">
<struct>
</struct>
<!-- next link command -->
</array>
</setting>
</struct>
<!-- next env variable -->
</array>
</setting>
</template>
</template-file>
The link descriptor file starts with a reference to the XML Schema Definition (.xsd)
which defines how the tags and content are arranged within the document. In this case, the
.xsd file is called SymbianLinkDescriptor.xsd.
The next line opens the file with a template command, followed by the version of the
file. The setting command next defines the start of the first LinkCommandSet,
followed by the array of setting definitions required to implement the
LinkCommandSet elements. Note that multiple linkCommandSets definitions are
possible in a file.
Settings that don’t follow this format will fail validation or fail to be
read during parsing.
NOTE You can use Win32 system calls like "Del" if you prepend the call with
cmd.exe like this "cmd.exe /C".
Symbol Description
Symbol Description
Symbol Description
NOTE When not defining a parser, the Linker Adapter uses the default parser that is
built into the Linker Adapter. This parser assumes a gcc message-style format.
NOTE Exporting parser functionality is only supported for the Linker Adapter. The
compiler uses the same parser as Symbian 2.5 and its predecessors.
3.5.1 Exporting
Assuming that the linker adapter has loaded the Parser DLL correctly, the following
exported interface is located and called:
{ … do work here }
The ParseMessages() method is required to fill in the following data structure (one
per message):
__declspec(dllexport) std::vector<sToolParseInfo>
*NewMWCustomParser(long version) {
// allocate and return pointer to vector<sToolParseInfo>
}
To de-allocate the memory block, use the method shown in Listing 3.5.
__declspec(dllexport) DeleteMWCustomParser(std::
vector<sToolParseInfo>*tpi) { delete tpi; }
NewMWCustomParser()
{
std::vector<sToolParseInfo> *tpi= new std::vector<sToolParserInfo>;
return tpi;
}
4 Symbian OS v7 Build
Tools Guide
This chapter describes how to use the CodeWarrior IDE to configure build targets in a
Symbian OS v7 project, and build them into applications, executable files, and DLLs. The
topics include:
• Creating a Symbian OS v7 Project
• Target Settings for Symbian OS v7 Projects
• Building DLLs with Exports
• Assembler Overview
NOTE Although the CodeWarrior IDE User's Guide describes how to import UNIX-
style make files, this IDE feature is not available with CodeWarrior
Development Studio for Symbian OS software.
Refer to Resource Editor and Resources for information on building resources that work
with Symbian OS projects.
NOTE The .pref file is only used for projects that employ the Symbian Linker to
target Symbian OS v7 executables. Projects that target executables for
Symbian Linker v2 use link descriptor files instead. See “Refer to Resource
Editor and Resources for information on building resources that work with
Symbian OS projects.” for more information.
TARGET Required
TARGETTYPE Required
UID Required
BASEADDRESS Optional
EPOCALLOWDLLDATA Optional
EPOCCALLDLLENTRYPOINTS Optional
EPOCDATALINKADDRESS Optional
EPOCFIXEDPROCESS Optional
EPOCHEAPSIZE Optional
EPOCPROCESSPRIORITY Optional
EPOCSTACKSIZE Optional
EXPORTUNFROZEN Optional
LINKAS Optional
TARGET
Specifies the name of the executable file that the IDE generates.
TARGET filename.ext
This command takes one string parameter, filename.ext. That parameter will be the output
filename generated by the linker. This is a required command and an error will be
generated if it is not found.
TARGETTYPE
Specifies the kind of executable file to generate.
TARGETTYPE target-type
This command takes one string parameter, target-type. That parameter will be the type of
executable the linker generates. The target types are listed in Table 4.2. This is a required
command and an error will be generated if it is not found.
CTPKG a package
RDL recognizer
WLOG
UID
Specifies the unique identifiers, UID2 and, optionally, UID3, for a build target.
UID uid2 [ uid3 ]
This command takes at least one and no more than two numbers as parameters, uid2 and,
optionally, uid3. These values should be valid hex or decimal numbers and will be used to
uniquely identify the program to the operating system. This is a required command and an
error will be generated if it is not found.
BASEADDRESS
BASEADDRESS hexadecimal-address
Specifies the address to build, and if possible, load, a DLL. This command only applies to
WINSCW/WINS build targets.
When using more than one DLL, use this command to give each DLL a different base
address so that the Windows loader does not have to do any relocation while loading
Symbian OS and its DLLs. Reducing relocation considerably speeds up the initialization
of Symbian OS applications running under WINSCW/WINS.
EPOCALLOWDLLDATA
Specifies that a dynamic link library (DLL) may contain writable data.
Typically, a DLL resides in read-only memory (ROM), which implies that any data it has
must not be writable. To ensure that a DLL can be run reliably from ROM, the petran
tool issues an error if it finds a writable data section in a DLL. Use this option to tell
petran not to issue an error if a DLL has writable data.
This command takes no parameters. Its presence in the preference file tells the linker to
pass this flag to the petran tool in the link phase. This command is optional.
EPOCCALLDLLENTRYPOINTS
This command takes no parameters. Its presence in the preference file tells the linker to
pass this flag to the petran tool in the final link phase. This command is optional.
EPOCFIXEDPROCESS
This command takes no parameters. Its presence in the preference file tells the linker to
pass this flag to the petran tool in the final link phase. This command is optional.
EPOCDATALINKADDRESS
This command takes one number parameter. This value should be a valid hex or decimal
number and will be passed to the petran tool in the link phase. This command is optional.
EPOCSTACKSIZE
This command takes one number parameter. This value should be a valid hex or decimal
number and will be passed to the petran tool in the link phase. This command is optional.
EPOCHEAPSIZE
This command takes two number parameters. These values should be valid hex or decimal
numbers and will be passed to the petran tool in the link phase. This command is optional.
EPOCPROCESSPRIORITY
This command takes one string parameter. The valid values are low, background,
foreground, high, windsurfer, fileserver, realtimeserver, and
supervisor. The value will be passed to the petran tool in the link phase. This
command is optional.
EXPORTUNFROZEN
Specifies that unfrozen exports are to appear in the project’s import library.
When this command appears in a preference file, the IDE creates an import library as a
side-effect of linking so that all exported functions, even unfrozen ones, appear in the
import library. Import libraries for compatible ABIs are not created.
When this command is not in a preference file, you must supply a .def file with the
frozen exports.
Use of EXPORTUNFROZEN is recommended just for the early stages of development,
when the Application Programming Interface is likely to be subject to change.
LINKAS
This command takes one string parameter. That parameter is the internal name of the
output file. Use this value when calling dlltool in the link phase. This command is
optional.
There are two scopes that source trees in the IDE encompass:
• Global source trees, specified in the IDE’s Preferences window, apply to all
projects.
• Project source trees, specified in the Target Settings window for a particular project,
apply only to files in that project.
Project source trees always take precedence over global source trees. Except for the
difference in scope, global and project source trees operate identically.
The CodeWarrior Development Studio for Symbian OS product uses global source trees,
source trees specified in the IDE’s Source Trees preference panel, to provide a defined
subdirectory into the installed Symbian development kit or SDK. The IDE applies entries
in this preferences panel to all applicable targets that are created within a project
(WINSCW, ARM, ARMI, Thumb).
The IDE uses source trees to determine where to look for the files and programs it needs to
build a project’s build target:
• build tools
• output directories
• access paths for header files and libraries
A global source tree entry will provide the absolute path to the location of the epoc32
directory of the Symbian OS development kit or SDK.
The IDE sets up source trees preferences by reading entries in the devices.xml
file. Each development kit that is installed provides the required information for the IDE
to assign a name to the installation and resolve the location of epoc32.
Use the Symbian Environment Editor to add, remove, and edit device entries in the
devices.xml file. For more information on editing devices, see the appendix
“Symbian Environment Editor”.
Each time the Symbian Environment Editor is launched, it checks for the presence of the
devices.xml file. If the devices.xml file does not exist, it asks if it should
create one. If the devices.xml file already exists, the user can immediately begin
editing device information.
Option Explanation
Target Name Enter into the Target Name edit field the name of the
build target. The IDE uses this name to identify the build
target.
The IDE displays this name in the Edit menu, in the
Targets view of the project window, and in the build
target pop-up menu on the project window. For more
information, see the CodeWarrior IDE User's Guide.
Linker Choose a linker from the items listed in the Linker pop-
up menu.
If you are developing a Symbian OS application there
are different linkers to choose from based upon the
targeted device. The choices are:
Select Symbian Linker if the executable is targeted at
devices that support Symbian OS v6.1 or v7.0
Select Symbian Linker v2 if the executable is targeted at
devices that support Symbian OS v8.0
The available settings panels and options will change
based upon the chosen linker.
Option Explanation
Output Directory This text area displays the path to the directory where
the final linked output file is placed.
Save project entries using When enabled, this checkbox lets the IDE distinguish
relative paths between files with the same names but in different
directories. When disabled, the IDE saves project entries
by name instead of path.
If you do not have files with the same name in your
project, you can leave this option unchecked.
Option Explanation
Gnu Tools Location Shows the path the IDE uses to locate the GNU tools.
Click the Browse button to navigate to the directory that
contains the GNU build tools for your SDK or
development kit.
Epoc32 Tools Location Shows the path the IDE uses to locate the Epoc32 tools.
Click the Browse button to navigate to the directory that
contains the Symbian build utilities for your SDK or
development kit.
Option Explanation
Display generated commands in Check the Display generated commands in the message
the message window window option if you want to see the command line
equivalent that the IDE uses to start the compiler, linker,
and other build tools. The Errors and Warnings window
displays the command line as a message.
Suppress warning messages Check the Suppress warning messages check box if you
do not want the Errors and Warnings window to display
warning messages.
Generate symbolics Check the Generate symbolics check box if you want
your application to include symbolics information. You
must check the Generate symbolics check box to debug
your application.
Prefix File A prefix file is a source code file, typically a header file,
that is included at the beginning of each source code
file in a project's build target. To use a prefix file, type
the name of the file in the Prefix File option.
The CodeWarrior C compiler automatically includes this
file (and any files that it, in turn, includes) in every
source file in the project’s current build target. This is an
excellent way to include a precompiled header file in a
project.
TIP: This field is also used as an alternative to the -
include option commonly issued for compilers that
operate at the command line.
Additional Command Line If you want to add command line options for the
command that starts the compiler, type the options in
the Additional Command Line text box. The IDE includes
the command line options when it starts the compiler.
Import Library Location Shows the path to the import library used by this
project. Click the Browse control to locate the import
library and show its path in the text box.
Option Explanation
Project Definition File (.mmp) Specifies the directory of the makmake project file
Location (.mmp). This option is usually set to specify the IDE
project’s directory; when importing a .mmp file, the
IDE saves its project file in the same directory as the
imported .mmp file.
Add .resource Dependencies to Adds all dependencies to user resources to the project.
Project at Compile Time This option ignores all resources from
EPOC32\include directory.
Option Explanation
Output Filename Defines the name of the .sis file to create. If this field is
empty, the default is Application.sis.
Create stub format file Generates a residual .sis file for each language
defined in the package file. The extension is .sxx,
where xx is the number of the language. For example,
.s10.
Option Explanation
Content Search Location Specifies where the IDE looks for files it uses to create
the .sis file.
NOTE: All files required by an application must be in this
directory in order for the Symbian Installer post-linker
to create a valid .sis file. This means that some files,
may have to be manually moved to this directory from
where they are created. For example, .rss files are
normally created in a directory separate from the .app
file.
For post-linker information, see “Post-linker”.
Output Location Specifies the directory where the IDE creates the.sis
file.
Consequently, configuring the IDE to debug such software is similar to setting it up for
debugging Windows-hosted software.
This chapter describes the settings that are specific to Symbian OS debugging on the
emulator. To see and change the settings in these panels, from the IDE’s Edit menu,
choose Target Settings, where Target is the name of the active build target in the project
window.
• “Runtime Settings Panel”
• “Debugger Settings Panel”
Option Explanation
Host Application for Libraries & To debug a program that is called by another program,
Code Resources type the name of the calling program here. For example,
to debug a DLL called by an application, you must
specify the application that loads the DLL.
Option Explanation
Working Directory Specifies the directory to use for debugging the non-
executable files. Leave this field blank to use the same
directory that contains the non-executable files. See the
CodeWarrior IDE User's Guide for more information.
Program Arguments This field lets you specify command line arguments to
the application or executable that you are debugging.
Option Explanation
Stop on application launch When this option is on, the debugger will set a
breakpoint at the function specified in the User
Specified option. Note that the Program entry point and
Default language entry point options are not supported
when debugging Symbian OS software running on the
emulator.
Update data every n seconds Check this box to have the debugger update displayed
debugging information at regular intervals during a
debug session. Enter in the text field the number of
seconds to wait before the debugger updates the data
displayed in debugger windows.
Uncheck this box to have the debugger update
displayed debugging information only when you issue
debug commands such as Run, Stop, Step Over, Step
Into.
Cache symbolics between runs When checked, the debugger will cache symbolic
information between debug sessions as long as the
executable being debugged has not changed. This
option is turned on by default.
Files and directories placed in this folder on the host computer appear in the Symbian OS
file system that runs on the emulator:
SymbianDir\epoc32\RELEASE\winscw\udeb\Z\
where SymbianDir is the directory of your Symbian OS development software.
All applications with resources that you build for emulator development should be placed
in
SymbianDir\epoc32\RELEASE\winscw\udeb\Z\System\Apps\Name
where SymbianDir is the directory of your Symbian OS development software and Name
is the name of your application.
To specify the location for the application to be stored, type or browse to the location in
the Output Directory option in the Target Settings panel.
If you imported your project from a makmake project file (“.mmp”), the build target’s
settings will already be configured correctly. Also, resources files and bitmaps built with
the application will be placed in the folders where the emulator expects to find them.
If your application requires additional files, add them to the same directory as your build
target’s output directory.
Specify the path and name of the emulator on your host computer that will use the
application in the Host Application for Libraries & Code Resources option in the
Runtime Settings settings panel. If you imported the project from a .mmp file, the IDE
will set this option for you.
Set a breakpoint or breakpoints in your source code and from the IDE’s Project menu,
choose Debug. After launching the emulator, you will see a debugger thread window with
the name of your emulator. Navigate through the emulator’s file system to the directory
where the application was stored by the IDE and launch the application to start debugging
it.
NOTE How an application is launched varies between emulators. See the Symbian
documentation that came with your SDK or development kit for more
information.
NOTE Because of the way the emulator was written to emulate Symbian OS running
on the Microsoft Windows operating system, the threads belonging to the
EPOC process actually represent processes running inside of Symbian OS.
expression’s value is scoped in reference to the PC. This may be impractical, especially
when you want to compare two identically named variables that exist in two different
functional scopes.
The debugger now supports the following enhancements to variable scoping, which
includes:
• Setting a breakpoint condition on a specified variable scope. This enables you to
specify a line within a particular variables scope if you want that particular variable’s
condition met. For example, the breakpoint condition “{@85}myVariable==5”
is scoped to the variable “myVariable” within the range of line 85.
• Tie variables with multiple scopes to a line number within the scope where the
variable resides. For example, you can bind an expression to a scope such as
"{@5}someVar" or "{@5}someVar + {@15}someVar".
– The context operator must appear just before an identifier referring to a variable.
If casting is specified, it can be included before the operator (e.g., (int*)
{@147} varA).
– Lines within a block scope “{}” that do not contain code are considered invalid.
– If a variable cannot be found within the block scope, it is searched for in the
function scope, the file scope, and then in global scope. If not found at all, the
expression is considered invalid.
• There is no file, module, thread, nor target tied to this context. Thus, if another
variable with the same name exists in another file, that expression will be evaluated
also.
• An expression of the form, “{context} varA + varB”, will apply the context
only to varA. The scope of varB will be taken to be the current PC.
• Without this operator, expressions are evaluated as they currently are. That is, the
scope of all identifiers is taken to be the current PC.
• If this operator is used for a non-local variable, it is ignored.
• Line numbers will not automatically adjust when the file is edited.
• The expressions are persistent across debug sessions.
• Only the x86 tools are supported. Other tools may or may not provide the block
scoping debug information necessary for this to work.
NOTE The resource (.resource) files are stored in a well defined XML format that
can be edited with any text editor.
b. Click OK
The Resource Editor window (Figure 6.2) appears.
Option Explanation
Resources The Resources list shows all of the resource (.rss) files
associated with the target. If more than one resource file
appears in the list, select it to specify its Resource File Settings
options. If no resource file is selected or the list is empty, the
Resource File Settings options are disabled.
Click the Add control to locate and add a resource file to the
target. Resource files must be specified as relative to the .mmp
file location. If not, move the resource file to a suitable relative
location before attempting to add it to the project. Once a new
resource file is added to the Resources list, it becomes the
selected file and its Resource File Settings ready for
modification.
Click the Remove control to delete the selected resource file
from the target.
Source Path Shows the name of the currently selected file in the Resources
list.
Target Path Shows the path to the target destination for the resource file.
Languages Click to select the language used by the selected resource file.
Option Explanation
Generate Header Enable to set the Header attribute true in the .resources file. If
unchecked, the Header attribute is set to false.
Option Explanation
MBM Output Files The MBM Output Files list shows all of the MBM files associated
with the target. Select a file name in this list to edit the file
attributes or remove the file.
Click the Add control to add a MBM file to the MBM Output Files
list.
Click the Remove control to delete the currently selected MBM
file from the MBM Output Files list.
Generate Header Enable to set the Header attribute true in the .mbm file. If
unchecked, the Header attribute is set to false.
Output Path Shows the path to the target destination for the MBM file.
Target Path Shows the path to the currently selected file in the AIF Files list.
Bitmap Files Shows the bitmap files associated with the currently selected
MBM Output file. Select a file name in this list to edit the file
attributes or remove the file.
Click the Add control to add a bitmap file to the Bitmap Files
list.
Click the Remove control to delete the currently selected
bitmap file from the Bitmap file list.
BPP Use the BPP (Bits Per Pixel) option list to select the the number
of bits assigned to the selected bitmap image. Range is from 1-
bit (black-and-white) to 24-bit color.
Source Path Shows the name of the currently selected file in the Bitmap
Files list.
Option Explanation
AIF Files The AIF Files lists shows all the AIF files associated with the
current target. You select a file in the AIF Files list to modify its
attributes. If no file is selected, all of the attribute options are
disabled.
Click the Add control to add a new AIF file to the AIF Files list.
The AIF Output File dialog appears.
Click the Remove control to delete the selected AIF file from
the AIF Files list.
Source File Shows the name of the currently selected file in the AIF Files
list.
Source Path Shows the path to the currently selected file in the AIF Files list.
Option Explanation
Target Path Shows the path to the target destination for the AIF file.
Bitmap Files Shows the bitmap files associated with the currently selected
AIF file. Select a file name in this list to edit the file attributes
or remove the file.
Click the Add control to add a bitmap file to the Bitmap Files
list.
Click the Remove control to delete the currently selected
bitmap file from the Bitmap file list.
BPP Use the BPP (Bits Per Pixel) option list to select the the number
of bits assigned to the selected bitmap image. Range is from 1-
bit (black-and-white) to 24-bit color.
Source Path Shows the name of the currently selected file in the Bitmap
Files list.
NOTE Because the Resource Manager is not part of the IDE, the IDE is left unaware
that a .resource file has been updated by this process. To avoid this issue,
enable the Use Modification Date Caching option to force the IDE to check
the file for modification prior to a build oepration.
<resources>
<mbm
targetfile = "EXAMPLE.MBM"
targetpath = "Z\SYSTEM\APPS\EXAMPLE"
header = "true">
<bmp
bpp = "c8"
sourcepath = "..\EDATA"
sourcefile = "example1.bmp"/>
<bmp
bpp = "c8"
sourcepath = "..\EDATA"
sourcefile = "example2.bmp"/>
</mbm>
<aif
sourcefile = "EXAMPLE.RSS"
sourcepath = "..\EDATA"
targetfile = "EXAMPLE.AIF"
targetpath = "Z\SYSTEM\APPS\EXAMPLE">
<bmp
bpp = "c8"
sourcepath="..\EDATA"
sourcefile = "EXAMPLE24.BMP"/>
<bmp
bpp = "c8"
sourcepath="..\EDATA"
sourcefile = "EXAMPLE2M.BMP"/>
</aif>
<rsc
sourcefile = "EXAMPLE.RSS"
targetpath = "Z\SYSTEM\APPS\EXAMPLE"
header = "true"
sourcepath = ".">
<language id = "SC"/>
</rsc>
</resources>
Table 6.5 lists the attributes that each of the tags listed in Table 6.4 may have.
Replace filename with the bitmap or AIF file. Replace depth with the bits per pixel and
color depth of the image.
will use it and the information entered in the “Symbian Installation Panel” to create a .sis
file.
NOTE Many of the .mmp files you import from a SDK may already have a .pkg file
associated with it. Always check before creating your own .pkg file.
#{"HelloWorld"},(0x10004299),1,0,0
; Only two files to install for the minimal application
"HelloWorld.app"-"!:\system\apps\HelloWorld\HelloWorld.app"
"HelloWorld.rsc"-"!:\system\apps\HelloWorld\HelloWorld.rsc"
Figure 7.1 The File Mapping panel in the TargetName Settings window
Extension .pkg
Compiler None
4. Click OK
The IDE saves the settings and closes the TargetName Settings window.
NOTE If the .pkg extension is not present in the File Mappings settings panel, use the
Add button to create a new entry with the above settings in the File Mappings
list. See the CodeWarrior IDE User’s Guide for additional details.
that can be uploaded to a target device. See “Symbian Installer Post-Linker” for
details.
• Symbian Installation settings panel–provides the post-linker with basic .sis file
information like filename, files to include, and more. See “Symbian Installation
Panel” for details.
For more information on .sis files, see the Symbian Developer Library documentation.
Setting a Post-Linker
For the IDE to create a .sis file, the Symbian Installer post-linker must be activated for the
build target represented by TargetName.
1. Open the TargetName Setting panel for the build target
The TargetName Setting window appears.
2. Select the Target Settings panel
The Target Setting panel appears (Figure 7.2).
Figure 7.2 The Target Settings panel in the TargetName Settings window
Figure 7.3 The Symbian Installation panel in the TargetName Settings window
• Content Search Location–source directory the post-linker looks at for the files it
adds to the .sis file
NOTE During the development process, some files (like resource files) are placed in a
different directory, which may or may not be the directory pointed to by the
Symbian Installation panel’s Content Search Location field. In those
situations, you must copy those files to the directory indicated in the Content
Search Location field in order for the post-linker to find them and create the
.sis file.
NOTE See the “Symbian Installation Panel” for more information on the other options
available in this panel. See the Symbian Developer Library for details on the
various .sis file options.
4. Click Apply
The IDE saves your changes to the build target.
5. Build the application and the .sis file
Select the Project > Make menu item, or press F7, to build the target. When the post-
linker runs, the .sis file is also generated.
You can now use the .sis file to deploy your program to a target device. Refer to the
documentation of your devkit or SDK for instructions that explain how to do this.
NOTE A simple outline is provided to show the basic steps necessary to upload a .sis
file to a target device. The actual steps required by the specific Symbian
Connect program that ships with the SDK you are using may differ, so always
refer to that SDK’s documentation for details.
NOTE You must have the appropriate Symbian OS development kit or SDK in order
to employ the Symbian Environment Editor. Doing so installs the tools
required in the \Common Files\Symbian\Tools directory.
Figure 8.1 Symbian Environments window shows all currently known Symbian devices
Option Explanation
<devices version="1.0">
<device
id="Series60_v21_CW"
name="com.nokia.series60"
default="no" userdeletable="yes">
<epocroot>C:\Symbian\Series60_v21_CW\</epocroot>
</device>
...
</devices>
The Symbian Environment Editor window components are described in Table 8.2.
Option Explanation
EPOC Root Type the path or click Choose to specify the root of
the SDK used for this device.
Make Device Default Marks this device as the default device. All other
devices are set to ‘no’ if OK is clicked. The default
setting is ‘no.’
Option Explanation
3. Click Delete
The chosen device is removed from the device list.
4. Click OK
The editor saves the devices.xml file and closes the Symbian Environments
window.
NOTE TRK must be enabled on the target device to activate device debugging.
Start TRK.exe or TRK.app on the target device. Once TRK is running, the target device
displays a message similar to the text in Listing 9.1.
PDD: EUART1
LDD: ECOMM
CSY: ECUART
Port Number: 0
Baud rate: 115200
NOTE The configuration settings are board specific and may vary.
NOTE The CodeWarrior IDE User's Guide describes target settings panels and IDE
preference panels that are common to all CodeWarrior projects.
Many types of CodeWarrior projects use the settings in this panel; however only some
settings in this panel are relevant for Symbian OS device debugging. The settings in this
panel that pertain to device debugging are shown in Table 9.1.
Table 9.1 Runtime Settings panel—device debugging options
Option Explanation
Host Application for Libraries & If you want to debug a DLL from the project that creates
Code Resources that DLL, you must specify the host application or
executable that loads the DLL.
Click the Choose button to select the host application, or
type the full path to the host application or executable
into the text field. Click the Clear button to clear the
setting.
Program Arguments Enter in this field any command line arguments you
would like sent to the application or executable you are
debugging.
NOTE If you debug an application or executable target,
the IDE passes these arguments to that program. If you
debug a DLL target, the IDE passes these arguments to
the program specified in the Host Application for
Libraries & Code Resources setting.
This settings panel is always visible in the Target Settings window. To view the Target
Settings window, select Edit > TargetName Settings from the CodeWarrior menu bar
(where TargetName is the name of the build target you want to modify).
Option Explanation
Stop on application launch Check this box to have the debugger halt program
execution at the beginning of a debug session. When
this box is checked, the Program entry point, Default
language entry point, and User specified options are
enabled.
NOTE The Program entry point and Default language
entry point options are not supported for Symbian OS
device debugging.
Option Explanation
Update data every n seconds Check this box to have the debugger update displayed
debugging information at regular intervals during a
debug session. Enter in the text field the number of
seconds to wait before the debugger updates the data
displayed in debugger windows.
Uncheck this box to have the debugger update
displayed debugging information only when you issue
debug commands such as Run, Stop, Step Over, Step
Into, or Step Out.
Cache symbolics between runs Check this box to have the debugger cache symbolic
information between debug sessions as long as the
executable you are debugging has not changed.
Checking this box can improve debug session start
times.
Many types of CodeWarrior projects use the settings in this panel; however only some
settings in this panel are relevant for Symbian OS device debugging.
Option Explanation
Edit Connection Click this button to modify the connection associated with the
currently-selected Connection menu item. When you click this
button, the IDE displays a dialog box that lets you edit the
connection properties. For more information about this dialog
box, refer to “Remote Connections Panel”.
Option Explanation
Remote download path Enter in this text field the path to the location on the target
device where you want the CodeWarrior debugger to
download the output of the current build target. The path
must be the path to a RAM drive (usually C:\).
If you leave this text field blank, the debugger downloads the
build target output to the root of the C drive on the target
device.
NOTE You can run command-line executables from any
location in the Symbian OS for non-platform security devkit
SDKs. For these SDKs, applications must be located in the
C:\System\Apps\AppName\ directory to run properly
(where AppName is the name of the application).
Statically linked libraries may reside in the same directory as
the executable that calls them. Dynamically-linked libraries,
however, must be located in the C:\System\Libs\
directory to function properly.
With Symbian OS v9.1 and later that use platform security, all
executables and DLLs must reside in the c:\sys\bin
directory.
Launch remote host Check this box to have the debugger launch an executable on
application the target device when the debug session starts. Enter the
path to the executable on the target device in the associated
text field.
You can use this feature to debug a DLL project by specifying
the path to the executable that calls the DLL.
NOTE To help speed up future debug sessions, the debugger does not download files
if they already exist on the target device and have not been changed on the host
since the last download.
Option Explanation
File List The file list displays a list of the files you want the IDE to
download to the target device at the start of a debug
session. For each file, the list displays the Host Path, the
path to the file on the machine running the CodeWarrior
debugger, and the Target Path, the path to the file on
the target device where the debugger places the file at
the start of a debug session.
Host File Path Enter in this text field the full path to the file on the
machine running the CodeWarrior debugger. Click
Browse to use the standard file dialog box to navigate
to and select a file.
Target File Path Enter in this text field the full path to the file on the
target device to indicate where you want the debugger
to place the file at the start of a debug session.
NOTE This path must include the destination file name.
The IDE creates the file with this name on the target
device.
Add Click the Add button to add the information in the Host
File Path and Target File Path text fields as a new entry
to the file list.
Option Explanation
NOTE The Symbian TRK remote connection is already defined for use in debugging
Symbian OS devices connected to the COM1 port of the host computer.
4. Click Add.
The IDE displays the New Connection dialog box (Figure 9.8).
a. Enter in the Name text field a name for the new connection, such as TRK
Connection.
b. Select Symbian TRK Protocol from the Debugger menu.
The IDE displays Symbian TRK-related settings in the panel.
c. Select Serial from the Connection Type menu.
d. Select the communications port to which the device is connected from the Port
menu.
e. Select the appropriate Rate, Data Bits, Parity, Stop Bits, and Flow Control for
the device.
f. If you would like the debugger to display a log of all communications through this
connection, check the Log Communications Data to Log Window box.
g. Click OK.
The IDE saves your changes. The new connection appears in the Remote
Connections list (Figure 9.9).
3. Select Project > Set Default Target > TargetName from the CodeWarrior menu bar
to switch to the build target you want to debug (where TargetName is the name of the
build target).
The IDE makes the build target you select the active build target.
TIP If you created this project by importing a MMP file, the debug build target names
in the project end with “UDEB”. Select one of these build targets.
8. Enter the following path in the Remote download path text field (where AppName is
the name of the application generated by the current build target.
• For v8.x or earlier, use: C:\System\Apps\AppName\
• For v9.1 with platform security, use: C:\sys\bin\AppName\
9. Select Remote Download from the Target Settings Panel list.
The IDE displays the Remote Download settings panel (Figure 9.12).
10. For each file the application requires to be present on the device in order to run
properly (for example, resource files or bitmap files):
a. Click Browse.
The IDE displays the file selection dialog box.
b. Navigate to the directory containing the file you want the debugger to download to
the device when you debug the application.
c. Select the file you want the debugger to download to the device.
d. Click Open.
The IDE closes the file selection dialog and displays the path to the file in the Host
File Path text field.
e. Enter in the Target File Path text field the full path and filename on the target
device where you want the debugger to place the file.
NOTE The Target File Path must include the destination file name. The IDE creates
the file with this name on the target device.
TIP You must include the TRK program in the ROM of the device before you can run
it on the target device.
TIP For instructions showing how to start the TRK program on the target device, see
“Starting TRK”
16. Select Project > Debug from the CodeWarrior menu bar.
The IDE builds the current target, downloads the application and associated files to the
device, starts a debug session, stops at the breakpoint you set, and displays the Thread
window (Figure 9.13).
You can now use the Thread window to start, stop, and step through your code. You can
interact with the application using the device.
NOTE During TRK debug sessions, the Kill button in the Thread window kills the
process you are debugging and ends the debug session.
See the CodeWarrior IDE User's Guide for complete information on using the
CodeWarrior debugger.
3. Select Project > Set Default Target > TargetName from the CodeWarrior menu bar
to switch to the build target you want to debug (where TargetName is the name of the
build target).
The IDE makes the build target you select the active build target.
TIP If you created this project by importing a MMP file, the debug build target names
in the project end with “UDEB”. Select one of these build targets.
NOTE For v9.1 or later with platform security, use the path C:\sys\bin.
NOTE If one or more of the directories in the path you supply do not exist on the
target device, the debugger creates them before downloading the executable to
the device.
NOTE If you imported this project from a MMP file, the IDE has already configured
the target settings to download the executable to the root of the C: drive.
8. For each file the executable requires to be present on the device in order to run
properly (for example, DLL files):
a. Click Browse.
The IDE displays the file selection dialog box.
b. Navigate to the directory containing the file you want the debugger to download to
the device when you debug the executable.
c. Select the file you want the debugger to download to the device.
d. Click Open.
The IDE closes the file selection dialog and displays the path to the file in the Host
File Path text field.
e. Enter in the Target File Path text field the full path and filename on the target
device where you want the debugger to place the file.
NOTE The Target File Path must include the destination file name. The IDE creates
the file with this name on the target device.
NOTE The IDE sets the User specified field to E32Main by default. If you want to
stop execution in a different function, replace the contents of this field with the
name of another function.
TIP You must include the TRK program in the ROM of the device before you can run
it on the target device.
TIP For instructions showing how to start the TRK program on the target device, see
“Starting TRK”.
12. Select Project > Debug from the CodeWarrior menu bar.
The IDE builds the current target, downloads the executable and associated files to the
device, starts a debug session, stops on entry to the function you specified in the
Debugger Settings panel, and displays the Thread window (Figure 9.18).
You can now use the Thread window to start, stop, and step through your code. You can
interact with the executable using the device.
NOTE During TRK debug sessions, the Kill button in the Thread window kills the
process you are debugging and ends the debug session.
See the CodeWarrior IDE User's Guide for complete information on using the
CodeWarrior debugger.
3. Select Project > Set Default Target > TargetName from the CodeWarrior menu bar
to switch to the build target you want to debug (where TargetName is the name of the
build target).
The IDE makes the build target you select the active build target.
TIP If you created this project by importing a MMP file, the debug build target names
in the project end with “UDEB”. Select one of these build targets.
a. Click Choose.
The IDE displays a file selection dialog box.
b. In the DLL project, navigate to the directory on the host machine of the application
or executable that uses the DLL.
c. Select the application or executable that uses the DLL.
d. Click Open.
The IDE closes the file selection dialog box and displays in the Host application
for Libraries & Code Resources text field the full path of the application or
executable that uses the DLL.
8. Select Remote Debugging in the Target Settings Panels list.
The IDE displays the Remote Debugging settings panel (Figure 9.21).
NOTE For v9.1 or later with platform security, use the path C:\sys\bin.
TIP Enter the appropriate path to download the library or application. These include:
NOTE If one or more of the directories in the path you supply do not exist on the
target device, the debugger creates them before downloading the executable to
the device.
c. If this is a DLL project, check the Launch remote host application checkbox.
NOTE You should not enable this option in the application project.
d. If this is a DLL project, enter in the Launch remote host application text box the
full path and name of the application or executable that uses the DLL you want to
debug.
The CodeWarrior debugger launches this application or executable when you start
a debug session.
10. Select Remote Download from the Target Settings Panels list.
The IDE displays the Remote Download settings panel (Figure 9.22).
NOTE The Remote Download settings panel is only used for debugging projects in
RAM. It is not required to debug projects in ROM.
NOTE When setting the Remote Download options remember that the host
application project should list every DLL it calls or loads while the DLL only
needs to list the host application project.
If the application or executable that uses the DLL is not already on the target device,
add the application or executable using this panel. Debugging a DLL requires that each
file the application or executable requires be present on the device in order to run
properly (for example, resource files or bitmap files). To add files:
a. Click Browse.
The IDE displays the file selection dialog box.
b. Navigate to the directory containing the file you want the debugger to download to
the device when you debug the DLL.
c. Select the file you want the debugger to download to the device.
d. Click Open.
The IDE closes the file selection dialog and displays the path to the file in the Host
File Path text field.
e. Enter in the Target File Path text field the full path and filename on the target
device where you want the debugger to place the file.
TIP Enter the appropriate path to download the library or application. These include:
NOTE The Target File Path must include the destination file name. The IDE creates
the file with this name on the target device.
TIP You must include the TRK program in the ROM of the device before you can run
it on the target device.
TIP For instructions showing how to start the TRK program on the target device, see
“Starting TRK”.
17. Select Project > Debug from the CodeWarrior menu bar.
The IDE builds the current target, downloads the application or executable that uses
the DLL and the DLL itself to the device, starts a debug session, stops at the
breakpoint you set, and displays the Thread window (Figure 9.23).
You can now use the Thread window to start, stop, and step through your code. You can
interact with the executable using the device.
NOTE During TRK debug sessions, the Kill button in the Thread window kills the
process you are debugging and ends the debug session.
See the CodeWarrior IDE User's Guide for complete information on using the
CodeWarrior debugger.
following steps describe the guidelines to set up a Sony Ericsson P800 phone for
debugging via USB.
NOTE The name of the connecting software used for your device is probably different
than the one used below (PC Suite). Always refer to the documentation that
came with the device for any device-specific information.
4. Select Project > Set Default Target > DebugTargetName (where DebugTargetName
is the name of a debug build target in the project).
The IDE switches to the build target you specified.
5. Select Project > Debug from the CodeWarrior menu bar.
The IDE downloads the project output files to the device, starts a debug session, and
displays the Thread window (Figure 9.25).
7. Select Symbian TRK from the Target Machine menu at the top-left of the window.
The IDE displays the processes running on the target device (Figure 9.27).
The Processes window displays process names, ID’s, and priorities. To see all of this
information, expand the Processes window and the Process pane.
You can select any process to display a list of the threads that belong to that process.
a Symbian OS equivalent for character strings. There are several types of descriptors and
they all have TdesC as their superclass. Every descriptor stores and manages data
differently, which makes it difficult for the programmer to know the meaning of a
descriptor’s contents. The CodeWarrior IDE’s debugger has the ability to automatically
identify Descriptors and display their value in a programmer-friendly C-string like format.
Figure 9.28 shows an example of TdesC descriptor display in IDE debugger. In this
example, aString is a descriptor and has “Hello!” for its value.
9.9 Troubleshooting
This section contains answers to common problems specific to device debugging:
• TRK Displays an Error Code
• Cannot Connect to TRK
• Device Displays Not Found Error
TIP To view or edit a remote connection, Select Edit > IDE Preferences from the
CodeWarrior menu bar, and click Remote Connections in the IDE Preferences
window.
TIP You instruct the IDE to download application support files to the target device
using the Remote Download Panel settings panel. See “Remote Download Panel”
for more information.
NOTE TRK must be enabled on the target device to debug the ROM.
building process to get the addresses of each component on the target device and the
locations of symbolic information files stored on the host computer.
Option Explanation
Parse ROMBUILD Log File Turn on this option and fill in the other fields to specify
the information that the debugger needs 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.
Symbian OS Kit Epoc32 Specifies the epoc32 directory in which the ROM image
Directory 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.
NOTE: Always include the epoc32 folder in this path.
Log unresolved modules Check this box to have the debugger output a list of
modules from the specified ROMBUILD log file that the
debugger cannot resolve. The IDE displays this list in the
debugger console window at the beginning of the
debug session.
Option Explanation
Log unresolved .sym files 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 IDE
displays this list in the debugger console window at the
beginning of the debug session.
NOTE Typically, Z is the drive letter assigned to the ROM file system of a Symbian
OS image.
NOTE For Symbian OS v9.1 or later with platform security, use the path
C:\sys\bin.
Whether or not the project you are debugging resides in ROM, you will see symbolic
information for other components if those components were built with symbolic
information. If a function in the stack crawl is in a ROM module and the IDE is able to
find a file containing symbolic information for that module, the IDE will load it
automatically and display function names. The IDE will also allow source level debugging
and let you set breakpoints in this module.
The symbolics window (Figure 10.3) appears when files containing symbolic information
are loaded. From the symbolics window you can easily navigate the sources for each
component and set breakpoints if necessary. If there are no symbolics available for a
component, you will see the name of the module containing the function in the stack crawl
of the debugger window.
process gets targeted automatically and the thread window(s) would open and be stopped
at that location.
If you want to set a breakpoint in a module residing in ROM before starting a debug
session, you can open the module or its .sym file by choosing File > Open from the
IDE’s menu or simply drag-and-dropping the .sym file on the IDE. Typically, a
module’s .sym file matches its name and is stored in the output directory of the
module’s build target.
Once the file is opened by the IDE, the Choose Debugger dialog box appears asking you
to select a debugging protocol. Note that selecting the wrong protocol at this point causes
all currently set breakpoints to be ignored.
If more than one remote connection is defined, you must select which debugger to use
when debugging that module. If more than one connection is defined but you only ever
use one of them, you can remove the unused connections and you will no longer be
prompted to select a debugger. Once the file is opened and the debugger selected, the
symbolics window will now contain the module and you can set breakpoints in it.
CAUTION Killing a thread on the device may place the Symbian OS in an unstable
state, possibly making it crash. Note that it is always better to resume than
to kill a process.
NOTE You can’t attach to a running process in RAM and source level debug it,
although you can if the process is in ROM. The debugger can do this because
the .log file contains the addresses of everything in ROM. For RAM, the
debugger relies on getting the addresses of the executable and library processes
when they are started. Since a running executable started before the debug
session, the host debugger never gets notified when the program is loaded and
can’t determine what its address is.
You cannot attach to a system process, a protected process, or the TRK process because
stopping a thread in one of those processes could stop the system. Once attached to a
process, you can open a thread window for any of its threads by double-clicking on it.
descriptor’s contents. The CodeWarrior IDE’s debugger has the ability to automatically
identify Descriptors and display their value in a programmer-friendly C-string like format.
Figure 10.5 shows an example of TdesC descriptor display in IDE debugger. In this
example, aString is a descriptor and has “Hello!” for its value.
10.6 Troubleshooting
11.1 Overview
The CodeWarrior Development Studio for Symbian OS software lets you debug Symbian
OS v7 through v9 start-up code, kernel code, device drivers, and any other executable in a
Symbian ROM image. CodeWarrior for Symbian OS supports this type of debugging if
the host PC is connected to the JTAG interface of a Symbian target device by an ARM
RDI or Lauterbach Trace32 compliant in-circuit emulator.
NOTE If you are using a TI TargetServer compliant emulator, you must use Texas
Instruments’ Code Composer Studio software to create a configuration for this
emulator.
the CPU is stopped, the operating system and user programs running on the device are also
stopped and are therefore not able to modify processor registers or memory.
For kernel debugging, the CodeWarrior debugger does not download and launch
individual Symbian executable files on the device. Instead, you must build the executable
files you want to debug into the Symbian ROM image on the device before starting a
debug session. The CodeWarrior debugger can optionally install a ROM image onto the
device for you when you start a debug session. See “Symbian Kernel Debugging” for
more information.
NOTE The CodeWarrior IDE User's Guide describes target settings panels and IDE
preference panels common to all CodeWarrior projects.
These settings panels are of particular interest to developers doing kernel debugging:
• “Debugger Settings”
• “Remote Debugging”
• “Symbian ARM Debugger Settings”
• “Symbian Debugging”
• “Symbian Kernel Debugging”
• “Remote Connections”
Option Explanation
Option Explanation
Update data every n seconds Check this box to have the debugger update displayed
debugging information at regular intervals during a
debug session. In the text field, enter the number of
seconds to wait before the debugger updates the data
displayed in debugger windows.
Uncheck this box to have the debugger update
displayed debugging information only when you issue
debug commands such as Run, Stop, Step Over, Step
Into, or Step Out.
Cache symbolics between runs Check this box to have the debugger cache symbolic
information between debug sessions as long as the
executable you are debugging has not changed.
Checking this box can improve debug session start
times.
Uncheck this box to have the debugger load symbolic
information each time you start a new debug session,
regardless of whether or not the executable has
changed since the last debug session.
Option Explanation
Option Explanation
Option Explanation
Use Target Initialization File 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.
Option Explanation
Use Memory Configuration File Controls whether the debugger uses a memory
configuration file when a debug session starts.
WARNING! This option is not available for stop-mode
debugging and should always be disabled.
Reset Target at the Start of each Forces the IDE to reset the target at the start of each
Debug Session debug session. This ensures that the debugging session
uses the most up-to-date program code.
Selecting the Hardware Board option automatically updates the Target Processor list to
only include processors the hardware board supports. For example, if you choose “TI H4”
as the hardware baord, then the Target Processor list updates to only show the
“OMAP24xx” processor.
To take complete advantage of all debugger features it is strongly recommended that you
choose the correct processor for the target device. Choosing the wrong target processor
can result in the following behaviors:
• If “Generic” is selected, only register groups common to all ARM processors are
visible. Whenever a processor is selected, the processor specific register groups are
visible in addition to the common register groups. Currently, only the CP15 register
group is supported.
NOTE You can modify the contents of the Target Processor field to support new target
processors. See “Supporting Dynamic Targets (OEM only)” for for
information.
TIP Use the Debugger menu in the Edit Connection window to assign a debugger to a
remote connection. View the Edit Connection window by clicking the Change
button in the Remote Connections IDE preference panel.
Option Explanation
Start address Enter in this text field the physical address in memory
from which the execution of Symbian OS start code
begins. This address is target-specific. The address
should be in the form of a hexadecimal number with
the 0x prefix. For example, 0x00100000 is a valid entry.
Debug from start address Select this option to have the debugger halt the
program at the address specified in Start Address. You
can then step through start-up code or run the target in
bare-board mode.
Option Explanation
Run from start address Select this option to have the debugger start the code at
the address specified in Start Address. If you have
breakpoints set, the debugger stops at the first
breakpoint encountered. You can click the Break button
to halt the device.
Download .img File Check this box to have the debugger download a binary
ROM image file to the target device before starting the
debug session. The debugger places the image onto the
device at the memory location specified by the
Download address text field.
Download address Enter in this text field the physical address in memory at
which the debugger should place the ROM image. This
address is target-specific. The address should be in the
form of a hexadecimal number with the 0x prefix. For
example, 0x000FFF00 is a valid entry.
Option Explanation
Ask at the start of each debug Check this box to have the debugger display a dialog
session box at the beginning of every debug session letting you
choose whether or not you want the debugger to
download the ROM image to the device.
Debug Bootrom .sym file Check this box to have the debugger use the symbolics
file for the start-up bootstrap code at the start of the
ROM image, enabling you to do source-level debugging
of bootstrap code. Click the Browse button to open the
bootrom symbolics file for the ROM image you want to
debug.
If this box is unchecked, you will only be able to do
assembly-level debugging of bootstrap code in the ROM
image.
4. Click Add.
The IDE displays the New Connection dialog box (Figure 11.8).
5. In the Name field, type the name for the new connection.
6. If your in-circuit emulator uses the ARM remote debugger interface (RDI):
a. Select ARM RDI from the Debugger dropdown list.
The IDE displays ARM RDI-related settings in the bottom of the New Connection
dialog box (Figure 11.9).
b. Click the Browse button under the Choose an RDI DLL text box.
The IDE displays a standard Windows file selection dialog box.
c. Use this dialog box to select the RDI DLL supplied by the vendor of your in-circuit
emulator.
The IDE displays the path to the selected RDI DLL in the Choose an RDI DLL
field.
NOTE A partially configured ARM RDI remote connection already exists. It is named
Symbian RDI.
If you would like to use this connection instead of creating a new one, finish
setting up the Symbian RDI connection by assigning it the RDI DLL
included with your emulator.
Figure 11.9 New Connection Dialog Box Configured for an ARM RDI ICE
d. Use the RDI Log Level field to define the RDI events you want logged.
See the ARM RDI documentation for more information about this setting.
e. Ensure that all options in the Vector Catch group box are disabled.
f. Click OK.
The IDE saves your configuration. The name of the new ARM RDI connection
appears in the Remote Connections list (Figure 11.10).
Figure 11.10 Remote Connections Preference Panel with the New RDI Connection
7. Click OK.
The IDE saves your changes and closes the IDE Preferences window.
You can now use the new remote connection in your projects. For further details about this
preference panel, refer to the CodeWarrior IDE User's Guide.
3. Select the vendor whose DevKit you want to use for this project from the Vendor list.
4. Select the DevKit you want to use from the SDK list.
5. Click Next.
The IDE displays the MMP File Selection page of the wizard (Figure 11.12).
6. Click Browse.
The IDE displays a Select File dialog box (Figure 11.13).
7. Navigate to SDKRoot\7.0s\Series60_v21_CW\Examples\graphics\
folder (where SDKRoot is the root directory of the SDK you want to use for this
project).
8. Select the graphicshell.mmp file.
9. Click Open.
The wizard displays the path to the file you selected in the MMP File Selection text
field.
10. Enter in the Platform Selection text field the ASSP name corresponding to the target
device (Figure 11.14).
Examples:
• If the target device is the ARM SPP2 Integrator, enter mint
• If the target device is the Texas Instruments Innovator, enter MOMAP15xx
NOTE If the menu does not contain an item for the target device you want to debug,
select Generic from the Target Processor menu.
c. Select the name of the DevKit you want to use for this project from the Path Type
menu (for example, TechView OS7_7.0.15).
d. Select the log file for the ROM image you built earlier in this tutorial.
The log file is located at: SDKRoot\epoc32\rom\LogFileName (where
SDKRoot is the root directory of the DevKit you want to use for this project and
LogFileName is the name of the ROM image log file).
e. Click Open.
The IDE displays the path to the log file you selected.
f. Click the Browse button next to the Symbian OS Kit Epoc32 Directory text field.
The IDE displays the Please Select an Access Path dialog box (Figure 11.21).
g. Select the name of the DevKit you want to use for this project from the Path Type
menu (for example, TechView OS7_7.0.15).
h. Select the epoc32 subdirectory of the SDK you want to use for this project (for
example, SDKRoot\bin\TechView\epoc32).
i. Click OK.
The IDE displays the path to the epoc32 directory you selected in the Symbian
OS Kit Epoc32 Directory text field.
9. Select Symbian Kernel Debugging from the Target Settings Panels list.
The IDE displays the Symbian Kernel Debugging settings panel (Figure 11.19).
TIP The Symbian OS documentation lists the correct start address for each supported
device.
e. Select the ROM image file you built earlier in this tutorial.
This ROM image file is located here: SDKRoot\epoc32\rom\ (where
SDKRoot is the root directory of the DevKit you want to use for this project).
f. Click Open.
The IDE displays the path to the ROM image file you selected in the Download
.img file text field.
g. In the Download address text field, enter the memory address on the target device
to which the debugger should place the ROM image file.
TIP The Symbian OS documentation lists the correct download address for each
supported device.
2. Click in the left column of the editor window adjacent to the first line of code in the
CreateLogicalDevice() function.
The IDE sets a breakpoint for the CreateLogicalDevice() function. A red dot
appears in the left column next to the line with the breakpoint.
3. Select Project > Debug from the IDE’s menu bar.
The Symbian Image Download dialog box appears (Figure 11.25).
4. Click OK.
The IDE displays a status dialog box as it downloads the ROM image to target device
(Figure 11.26).
The device begins execution of the ROM image under control of the CodeWarrior
debugger.
When execution reaches the line of code with the breakpoint, the CodeWarrior
debugger halts the device and displays the Thread window (Figure 11.27).
You can now use the Thread window to start, stop, and step through assembler code on
the device or board.
NOTE During kernel debug sessions, the Kill button in the Thread window does not
kill the process you are debugging. Instead, the debugger continues execution
of the process you were debugging and detaches from the device, and ending
the debug session if it was the only thread open.
3. Select Project > Set Default Target > TargetName from the CodeWarrior menu bar
(where TargetName is the name of a build target whose remote debugging connection
uses an in-circuit emulator).
The IDE switches to the build target selected.
4. Select Edit > TargetName Settings from the CodeWarrior menu bar (where
TargetName is the name of the current build target).
The IDE displays the Target Settings window (Figure 11.29).
NOTE If the Symbian Kernel Debugging settings panel is not in the list, ensure that
you have selected a connection that uses an in-circuit emulator from the
Connection menu of the Remote Debugging settings panel.
5. Select Symbian Kernel Debugging from the Target Settings Panels list.
The IDE displays the Symbian Kernel Debugging settings panel (Figure 11.30).
6. Enter in the Start address text field the address at which target device starts executing
ROM images.
7. Select the Debug from start address option to indicate you want the debugger to halt
the device or board before the operating system loads.
8. If the ROM image you want to debug is not already downloaded to the device or
board, configure the debugger to download the ROM image:
a. Check the Download .img file box.
b. Click Browse to display a standard file selection dialog box.
c. Open the ROM image you want to debug.
d. Enter in the Download address text field the download address appropriate for the
target device or board.
9. If you have built a debug version of your start-up code (bootrom.bin),
configure the debugger to let you debug this code:
a. Click Debug Bootrom .sym file.
b. Click Browse to display a standard file selection dialog box.
c. Open your bootrom .sym file.
NOTE Ensure that the selected file was built with symbolics information and included
in the ROM image that was downloaded. For more information on building
bootrom, refer to the DevKit documentation.
11. Select Project > Debug from the CodeWarrior menu bar.
The IDE builds the target and starts a debug session. If you instructed it to do so, the
debugger downloads the ROM image to the device. Once the ROM image is
downloaded, the debugger halts the device and displays the Thread window (Figure
11.31).
You can now use the Thread window to start, stop, and step through assembler code
on the device or board.
NOTE During kernel debug sessions, the Kill button in the Thread window does not
kill the process you are debugging. Instead, the debugger continues execution
of the process you were debugging and detaches from the device, and ending
the debug session if it was the only thread open.
NOTE The project you use to attach to processes or threads on the device must have
Symbian EKA1 or Symbian EKA2 selected from the Target OS menu in the
Symbian ARM Debugger Settings panel.
5. Select Symbian RDI (or whatever protocol you are using) from the menu at the top-
left corner of the Processes window.
The IDE displays all processes running on the target device (Figure 11.35).
Note that because the target device is halted, the Thread window may display a thread
that is currently inactive. Therefore, you may not be able to use some debugger execution
controls such as Step, Step Over, or Step Into.
If you wish to debug an inactive thread:
1. Add a breakpoint next to the line you want to debug by clicking in the left column of
the Source pane in the Thread window.
2. Click the Run button in the Thread window to continue execution of the device.
When the device executes the line of code containing the breakpoint, the CodeWarrior
debugger halts the device and brings the Thread window to the foreground. At this
point you can use all of the debugger execution controls.
In order to set breakpoints in an executable and debug it with the CodeWarrior debugger,
you must first build a debug version of the executable with symbolics using the
CodeWarrior IDE or command-line. When you do so, the compiler generates a symbolics
file (SYM file) containing all of the symbolic information associated with the executable.
This information enables the CodeWarrior debugger to do source-level debugging with
the executable.
NOTE The rest of this section assumes you already have a SYM file for the executable
you want to debug.
The name of the SYM file is typically the name of the executable plus the .sym file name
extension. The IDE places the file in the same directory as the executable file.
In addition, for breakpoint to work you must have a project open in the IDE that is
configured for stop-mode debugging. It does not have to be the actual CodeWarrior
project used to create the SYM file, any correctly configured project will work.
To insert breakpoints into an executable or debug an executable without having the
associated CodeWarrior project open:
1. Drag the SYM file for the executable and drop it over the IDE icon or the CodeWarrior
IDE’s menu bar.
The IDE displays the Choose Debugger dialog box (Figure 11.37). This dialog box
lists each entry in the Remote Connections settings panel.
2. Select the debugger that corresponds to the in-circuit emulator you are using.
NOTE The choices available in the Choose Debugger dialog box will vary based
upon the installed remote connections.
3. Click OK.
The CodeWarrior debugger displays the Symbolics Window (Figure 11.38). Notice
that the Executables pane of the window lists the SYM file for the executable.
NOTE The IDE must have any project open and configured for stop-mode debugging
for breakpoints to work with a SYM file.
8. Click the Run button in the Thread window to continue execution of the device.
When the device executes the line of code containing the breakpoint, the CodeWarrior
debugger halts the device and brings the Thread window to the foreground.
You can now use the Thread window to start, stop, and step through assembler code on
the device or board.
NOTE During kernel debug sessions, the Kill button in the Thread window does not
kill the process you are debugging. Instead, the debugger continues execution
of the process you were debugging and detaches from the device, and ending
the debug session if it was the only thread open.
NOTE You must have met the following condition to view any kernel object
properties:
– Symbian Linker or Symbian Linker v2 is chosen in the Target Settings
panel
– an active debug session
For each process on the target device, this window shows you the following information:
• Name
• Process ID
• Priority
• Text size
• Const data size
• Bss size
• Code run address
• Code home address
• Process Threads
• Process Chunks
• Name
• mwThreadID
• Priority
• Status
• Type
• Owning Process
For each library on the target device, this window shows you the following information:
• Name
• Code Size
• Data Size
• Constant Data Size
• Bss Size
• Code Address
• Code Load Address
• Data Run Address
• Data Home Address
For each chunk on the target device, this window shows you the following information:
• Name
• Size
• Run Address
• Home Address
• Owning Process
<hardwaretargets>
<hardwaretarget>
<name>TiH4</name>
<osVersions>
<osVersion>
<osName>v9.1</osName>
<kernelDataAddress>0xC8000000</kernelDataAddress>
<kernelSuperPageBaseAddress>
0xC0000000
</kernelSuperPageBaseAddress>
<ROMLinearBaseAddress>0x80000000</ROMLinearBaseAddress>
<kdebugPointerOffset>0x144</kdebugPointerOffset>
<signatureOffset>0x138</signatureOffset>
<timeOffset>0x80</timeOffset>
</osVersion>
<osVersion>
<osName>v8.1b</osName>
<kernelDataAddress>0xC8000000</kernelDataAddress>
<kernelSuperPageBaseAddress>
0xC0000000
</kernelSuperPageBaseAddress>
<ROMLinearBaseAddress>0x80000000</ROMLinearBaseAddress>
<kdebugPointerOffset>0x144</kdebugPointerOffset>
<signatureOffset>0x7c</signatureOffset>
<timeOffset>0x80</timeOffset>
</osVersion>
</osVersions>
<processors>
<-- Do not modify the processor list for a hardware board -->
<processor>OMAP24xx</processor>
</processors>
</hardwaretarget>
<hardwaretarget>
<-- another hardware target board -->
</hardwaretarget>
<processors>
<processor>Generic</processor>
<processor>ARM920T</processor>
<processor>ARM926TEJ</processor>
<processor>ARM1136J(F)-S</processor>
<processor>OMAP3xx</processor>
<processor>OMAP1510</processor>
<processor>OMAP16xx</processor>
<processor>OMAP1710</processor>
<processor>OMAP24xx</processor>
<processor>XScale</processor>
</processors>
<osVersions>
<osVersion>v7.0-v8.0a</osVersion>
<osVersion>v8.1b</osVersion>
<osVersion>v9.1</osVersion>
</osVersions>
</hardwaretargets>
You can modify or add both the <hardwaretarget> and <osVersion> types
within the XML file to enable kernel-awareness for new or different hardware.
NOTE If the Generic target is selected in the “Symbian ARM Debugger Settings
Panel” the debugger sets the Kernel data dependencies in hardware
Descriptors.xml file to the values for Symbian OS 9.1 and the TI H2
board.
Field Description
<hardwaretargets>... Describes the start and end sections for defining one or
</hardwaretargets> more <hardwaretarget> entries.
<osVersions>... Describes the start and end sections for defining one or
</osVersions> more <osVersion> entries.
Field Description
<processors>... Describes the start and end sections for defining one or
</processors> more <processor> entries.
WARNING: Do not modify the <processors> list. The
debugger cannot display processor registers it has no
knowledge of and attempts to do so can cause program
error.
NOTE Do not use the name “Generic” as this will cause conflicts with the built-in
default “Generic” configuration.
a. Modify the entries within the <osVersions> section to match the OS versions
available to the hardware target.
b. Modify the entries within the <processors> section to list the processors
supported by the hardware target.
NOTE You should never modify the <processors> list to add a new
<processor>. The debugger cannot display processor registers it has no
knowledge of and attempts to do so can cause program error.
Modifying an OS Version
To modify an OS version, follow these steps.
The next time you open the “Symbian ARM Debugger Settings” target settings panel, and
choose the new target hardware, only the OS versions you defined for that
<hardwaretarget> appear in the OS Versions field.
12.1 Lauterbach
The IDE supports the ARM Lauterbach Trace32 debugging protocol.
You must configure the Connection Type setting of the remote connection to use the
Lauterbach Trace32 protocol. Figure 12.1 shows the default configuration when choosing
ARM Lauterbach TRACE32 as the Debugger in the New Connection window. Your
settings may vary depending upon the remote device. Always refer to the device
documentation for connection setting details.
Refer to the section “Remote Connections Panel” for information on creating remote
connections.
For more information, visit www.lauterbach.com.
Option Explanation
Trace32 Driver location 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.
Trace32 Configuration File Specify the path to the config.t32 file or other custom
config file. The default path assumes that the Trace32
configuration file is installed in the default location:
C:\T32\config.t32.
You can modify the config.t32 file to support UDP
(User Datagram Protocol) connections by adding the
following lines:
PBI=USB
RCL=NETASSIST
PACKLEN=1024
PORT=20000
Option Explanation
UDP Port Sets the port the IDE uses to communicate with Trace32.
It should always match the UDP port setting in the
config.t32 file.
NOTE You must have the RTE for Windows program installed on your PC in order to
debug using the RTE for Windows protocol.
NOTE You will not be able to create a remote connection setting unless the Midas
JTAG emulator is connected to the PC.
Figure 12.2 Configuring a Midas RTE for Win32 connection (default settings shown)
Option Explanation
Midas RTE for Win32 Specify the path to the RTE for Win32 configuration file
configuration file supplied with the product. Ensure that RTE for Win32 is
installed before selecting a configuration file located at:
<CW_FOLDER>\Symbian_Support\Midas\
Midas_Config_H4.txt\
NOTE: Always make sure the boot configuration file is
appropriate for the chosen target.
RTE message language Specify the language used for RTE messages.
NOTE: Only English messages supported.
Once you have the RTE for Windows remote connection configured, import a MMP file
in the CodeWarrior IDE and create projects that use this setting.
work_addr unused
nc 10000000 4400 # NO CACHE area : i.MX21 internal registers
accenv jall
accenv jsbp
armopt resetrecovery
armopt !resetautorun
Option Explanation
Sophia Target Interface Specify the path to the Sophia Target Interface file
(WTL.dll) location (WTL.dll) supplied with the product.
Option Explanation
RomBuild Command Line Enter the command line that the post-linker uses to
build the ROM image.
Output Location Displays the path where the ROM image is generated
and stored. Click the Browse control to specify a new
location.
Display RomBuild Messages Controls the ability to view all messages generated
during the ROM build process. Enable this option to view
all messages generated by the Rom build command in
the Errors & Warnings window. Note that warning and
error messages are always shown no matter what the
Display RomBuild Messages option state.
1. Select Edit > TargetName Settings from the CodeWarrior menu bar
The TargetName Settings window appears.
2. Select the Target Settings panel from the Target Settings Panels list.
The Target Settings panel appears in the TargetName Settings window.
3. Select the Post-Linker > Symbian RomBuild option (Figure 13.2)
4. Click OK
The Symbian RomBuild post-linker is added to the build process and the TargetName
Settings window closes.
5. Select the Symbian RomBuild panel from the Target Settings Panels list.
The Symbian RomBuild panel appears in the TargetName Settings window.
6. Set the Symbian RomBuild post-linker options (Figure 13.1).
7. Click OK.
The Symbian RomBuild options are saved and the Target Settings window closed. The
next time a build is executed, the RomBuild options will be applied as part of the build
process.
The SymbianRomBuild window contains options that define how the IDE creates the
Symbian OS image when Project > Symbian Rom Build is selected from the
CodeWarrior menu bar.
Option Explanation
Rom Build Cmd Line Enter the command line that the tools use to build the
ROM image.
Working Directory Displays the path where the ROM image is generated
and stored. Click the Browse control to specify a new
location.
NOTE You do not need to use an initialization file when debugging with TRK.
writemem.b
Writes data to a memory location using a byte as the size of the write.
Usage
writemem.b <address> <value>
Parameters
<address>
The hex, octal, or decimal address in memory to modify.
<value>
The hex, octal, or decimal value to write at the address.
Example
writemem.b 0x0001FF00 0xFF # Write 1 byte to memory
writemem.w
Writes data to a memory location using a word as the size of the write.
Usage
writemem.w <address> <value>
Parameters
<address>
The hex, octal, or decimal address in memory to modify.
<value>
The hex, octal, or decimal value to write at the address.
Example
writemem.w 0x0001FF00 0x1234 # Write 2 bytes to memory
writemem.l
Writes data to a memory location using a long as the size of the write.
Usage
writemem.l <address> <value>
Parameters
<address>
The hex, octal, or decimal address in memory to modify.
<value>
The hex, octal, or decimal value to write at the address.
Example
writemem.l 0x00010000 0x00000000 # Write 4 bytes to
memory
writereg
Writes data to the specified register on the target. All register names that are part of
the core processor are supported including GPRs and SPRs.
Usage
writereg <registerName> <value>
Parameters
<registerName>
The name of the register to modify.
<value>
The hex, octal, or decimal value to write at the register.
Example
writereg MSR 0x00001002
V
Validating the File Mapping 96
View menu 80
Viewing Processes 139
W
window
Project Re-import Settings 35
windows
Symbian Environments 103
Symbian Environments Editor 104