CodeWarrior Development Studio Common
CodeWarrior Development Studio Common
Contents
Chapter 1 Introduction.....................................................................................11
1.1 Release notes...................................................................................................................................11
1.2 Documentation structure.................................................................................................................. 11
1.2.1 Documentation formats.......................................................................................................11
1.3 Manual conventions..........................................................................................................................12
1.3.1 Figure conventions............................................................................................................. 12
1.3.2 Keyboard conventions........................................................................................................ 12
1.4 CodeWarrior IDE overview............................................................................................................... 12
1.4.1 Development cycle............................................................................................................. 12
1.4.2 CodeWarrior IDE advantages.............................................................................................13
Chapter 3 Debugger........................................................................................91
3.1 About debugger................................................................................................................................ 92
3.2 Breakpoints.......................................................................................................................................92
3.2.1 Breakpoints view.................................................................................................................93
3.2.2 Breakpoint annotations....................................................................................................... 94
3.2.3 Regular breakpoints............................................................................................................94
3.2.3.1 Setting line breakpoint.......................................................................................... 95
3.2.3.2 Setting method breakpoint.................................................................................... 95
3.2.4 Special breakpoints............................................................................................................ 96
3.2.4.1 Setting special breakpoint using IDE.................................................................... 96
3.2.5 Breakpoint persistence....................................................................................................... 97
3.2.6 Breakpoint preferences.......................................................................................................97
3.2.7 Working with breakpoints....................................................................................................99
3.2.7.1 Modify breakpoint properties.................................................................................99
3.2.7.2 Restricting breakpoints to selected targets and threads..................................... 101
3.2.7.3 Limiting new breakpoints to active debug context.............................................. 102
3.2.7.4 Grouping breakpoints..........................................................................................103
3.2.7.5 Disabling breakpoints..........................................................................................103
3.2.7.6 Enabling breakpoints.......................................................................................... 104
3.2.7.7 Removing breakpoints........................................................................................ 104
3.2.7.8 Removing all breakpoints....................................................................................104
3.2.7.9 Undo delete breakpoint.......................................................................................104
3.2.7.10 Redo delete breakpoint.....................................................................................105
3.2.7.11 Skipping all breakpoints.................................................................................... 105
3.2.8 Breakpoint actions............................................................................................................ 105
4.5.13 disassemble....................................................................................................................256
4.5.14 display.............................................................................................................................257
4.5.15 evaluate.......................................................................................................................... 260
4.5.16 finish............................................................................................................................... 261
4.5.17 fl::blankcheck.................................................................................................................. 262
4.5.18 fl::checksum....................................................................................................................262
4.5.19 fl::device..........................................................................................................................263
4.5.20 fl::diagnose..................................................................................................................... 264
4.5.21 fl::disconnect...................................................................................................................265
4.5.22 fl::dump........................................................................................................................... 265
4.5.23 fl::erase........................................................................................................................... 266
4.5.24 fl::image.......................................................................................................................... 266
4.5.25 fl::protect......................................................................................................................... 267
4.5.26 fl::secure......................................................................................................................... 267
4.5.27 fl::target...........................................................................................................................268
4.5.28 fl::verify........................................................................................................................... 269
4.5.29 fl::write............................................................................................................................ 269
4.5.30 funcs............................................................................................................................... 269
4.5.31 getpid.............................................................................................................................. 269
4.5.32 go....................................................................................................................................269
4.5.33 help................................................................................................................................. 270
4.5.34 history............................................................................................................................. 271
4.5.35 jtagclock..........................................................................................................................271
4.5.36 kill....................................................................................................................................271
4.5.37 launch............................................................................................................................. 272
4.5.38 linux::displaylinuxlist....................................................................................................... 272
4.5.39 linux::loadsymbolics........................................................................................................273
4.5.40 linux::refreshmodules......................................................................................................273
4.5.41 linux::selectmodule......................................................................................................... 273
4.5.42 linux::unloadsymbolics....................................................................................................273
4.5.43 loadsym.......................................................................................................................... 273
4.5.44 log................................................................................................................................... 274
4.5.45 mc::config....................................................................................................................... 274
4.5.46 mc::go............................................................................................................................. 275
4.5.47 mc::group........................................................................................................................275
4.5.48 mc::kill.............................................................................................................................276
4.5.49 mc::reset......................................................................................................................... 276
4.5.50 mc::restart.......................................................................................................................276
4.5.51 mc::stop.......................................................................................................................... 277
4.5.52 mc::type.......................................................................................................................... 277
4.5.53 mem................................................................................................................................278
4.5.54 next................................................................................................................................. 280
4.5.55 nexti................................................................................................................................ 280
4.5.56 oneframe.........................................................................................................................280
4.5.57 pwd................................................................................................................................. 281
4.5.58 quitIDE............................................................................................................................ 281
4.5.59 radix................................................................................................................................ 281
4.5.60 redirect............................................................................................................................282
4.5.61 refresh.............................................................................................................................283
4.5.62 reg...................................................................................................................................283
4.5.63 reset................................................................................................................................286
4.5.64 restart..............................................................................................................................286
4.5.65 restore.............................................................................................................................287
4.5.66 run...................................................................................................................................288
4.5.67 save................................................................................................................................ 288
Index.................................................................................................................................. 301
Chapter 1
Introduction
This manual describes the CodeWarrior IDE and debugger features that are common across all the CodeWarrior
products. This chapter presents an overview of the manual and the CodeWarrior IDE.
NOTE
The CodeWarrior Common Features Guide (document CWCFUG) may describe
features that are not available for your product. Further, the figures show a typical user
interface, which may differ slightly from your CodeWarrior product. See your product's
Targeting Manual for details of its product-specific features.
NOTE
The release notes for specific components of the CodeWarrior IDE are located in the
Release_Notes folder in the CodeWarrior installation directory.
Port software to new processors without having to learn new tools or lose an existing code base. The
CodeWarrior IDE supports many common desktop and embedded processor families, such as x86, PowerPC,
and MIPS.
• Plug-in tool support
Extend the capabilities of the CodeWarrior IDE by adding a plug-in tool that supports new features. The
CodeWarrior IDE currently supports plug-ins for compilers, linkers, pre-linkers, post-linkers, preference panels,
version controls, and other tools. Plug-ins make it possible for the CodeWarrior IDE to process different
languages and support different processor families.
Chapter 2
IDE Extensions
The CodeWarrior IDE is composed of various plug-ins, each of which provide a specific functionality to the IDE.
This chapter explains how to work with various extensions (plug-ins) in the Eclipse IDE.
This chapter explains:
• CodeWarrior Projects view on page 16
• Command line interface on page 21
• Commander view on page 27
• Concurrent compilation on page 30
• Console view on page 32
• Shortcut menus on page 32
• Diagnostic Information export on page 33
• Extracting CodeWarrior configuration details on page 39
• Find and Open File on page 41
• Importing files on page 41
• Key mappings on page 47
• Linker Command File navigation on page 48
• Multiple compiler support on page 50
• New External File on page 51
• Exporting and importing macros on page 52
• Problems view on page 54
• Referenced projects on page 55
• Target management via Remote System Explorer on page 59
• Viewing CodeWarrior plug-ins on page 85
• Editing cwide-env file on page 88
• Handling message alerts on page 89
The CodeWarrior Projects view is an enhanced version of the C/C++ Projects view.
Improvements provided by the CodeWarrior Projects view are discussed in the following sections.
• Active configuration on page 16
• Tree and list view on page 17
• Column headers on page 18
• Quick search on page 19
• Filtering on page 20
Icon Description
Click the Show files in a hierarchal view icon in the
CodeWarrior Projects view toolbar to display the
resources in hierarchal tree view.
Click the Show files in a flat view icon in the
CodeWarrior Projects view toolbar to display the
resources in flat list view.
NOTE
The files can be sorted in both hierarchal and flat list views. Sorting is not case-sensitive
for strings.
2. Select a checkbox to display or hide the corresponding column in the CodeWarrior Projects view.
Alternatively, you can click Select All or Deselect All to display or hide all the columns listed in the dialog.
3. Click OK .
NOTE
You cannot customize the FileName column using the Customize Column Headers
dialog.
NOTE
The CodeWarrior Projects view automatically switches to the flat view when an
expression is entered in the Search Text textbox.
Click the Popup icon in the CodeWarrior Projects view toolbar to specify the fields in which the Eclipse IDE
searches for the expression typed in the Search Text textbox.
NOTE
When you click the Popup button, the fields appear depending on the headers enabled
in the view.
Click the Erase Text icon in the CodeWarrior Projects view toolbar to clear the Quick Search query. The
CodeWarrior Projects view reverts to the normal view displaying all the folders and files in the workspace.
2.1.5 Filtering
The CodeWarrior Projects view lets you filter the elements being displayed.
The following four filters has been added to filter the content in the CodeWarrior Projects view.
• Generated Files - Filters the output directory associated with each build configuration. This contains all files
generated by a build including the executable files, object files, ephemeral makefiles, dependency files,
map files, and other such elements. Typically, these files are all contained within a directory named after the
build configuration. The entire directory is filtered.
• Includes - Filters out the Includes element, which shows the include paths the project is using and the
included files.
• Launch Configurations - Filters .launch files, which are the launch configurations stored with the project.
Typically, these files are stored in a Debug_Settings folder. In such case, the entire folder is filtered.
• Referenced Projects - Filters the Referenced Projects element that shows what other projects and build-
configurations are referenced by the project.
To filter the content of the CodeWarrior Projects view:
1. Click the inverted triangle icon in the CodeWarrior Projects view.
The shortcut menu appears.
2. Choose Filters.
The C Element Filters dialog appears.
3. Select the filter element you want to exclude from the CodeWarrior Projects view.
4. Click OK.
NOTE
Projects specified by the -project flag that are not present in the workspace (either
the default one or the one specified by the -data flag) are automatically imported in
the workspace as existing project in the file system, and recorded in the workspace
metadata.
2.2.1 build
Builds a set of C/C++ projects.
Multiple-project flags can be passed on the same command invocation. The build tool output is generated on
the command line, and the build result is returned by ecd.exe return code, as 0 for success, and -1 for failure.
Syntax
Parameters
-cleanBuild
-cleanAll
-config
The build configuration name. If the -config flag isn't specified, the default build configuration is used.
Examples
Builds the debug configuration of my_first_project, then cleans and builds the release configuration of
my_second_project.
2.2.2 getOptions
Prints to the standard output C/C++ managed build, launch configuration or RSE system settings.
Syntax
ecd.exe -getOptions -project path [-config name | -allConfigs] [- file path] [-option
option-name] [-launchConfig name | - allLaunchConfigs] [-rseSystem name | -allRseSystems]
Parameters
-config
The build configuration name. If the -config flag isn't specified, the default build configuration is used.
-allConfigs
-file
The file path of a file included in the project. If the -file flag is specified, a file-level setting is retrieved instead
of a build configuration level setting(s). The -file flag does not apply to the -launchConfig , -
allLaunchConfigs , -rseSystem , and -allRseSystems flags.
-option
If the option setting isn't specified, all options are printed in a key=value format instead of a single option value,
which could be used for discovering the list of option ids in a given build configuration, launch configuration or
RSE system.
-option-name
-launchConfig
-allLaunchConfigs
-rseSystem
-allRseSystems
Gets the RSE options of the specified RSE system. The quotes are necessary for escaping the space in the
RSE system name.
2.2.3 generateMakefiles
Creates the makefiles required to build a C/C++ project.
Syntax
Parameters
-config
The build configuration name. If the -config flag isn't specified, the default build configuration is used.
-data workspace-path
Generates the makefiles for the active configuration of each of the two projects.
ecd.exe -build -data c:\my_workspace -project c:\my_first_project -config Debug –project c:
\my_second_project -config Release
Generates the makefiles for the debug configuration of my_first_project, then for the release configuration of
my_second_project.
2.2.4 references
Lists, adds or removes all the referenced project and build configurations in a project.
Syntax
ecd.exe -references -project path [-config name | -allConfigs] ( - list | -add | -remove)
referencedProjectLocation [buildConfigurationName]
Parameters
-config name
The name of the build configuration to edit or list referenced project. If the -config flag is omitted, the active build
configuration will be used.
-allConfigs
-list
Adds a new referenced project, specified by the 'referencedProjectLocation', which can be either an absolute
path, or a variable relative path (relative to the path variables defined in the project specified by the -project flag).
If the buildConfigurationName is specified, a specific build configuration rather than the active build
configuration will be referenced.
Removes an existing referenced project, specified by the 'referencedProjectLocation', which can be either an
absolute path, or a variable relative path (relative to the path variables defined in the project specified by the -
project flag). If the buildConfigurationName is specified, only the specific referenced build configuration will
be removed, otherwise all references to the specified project will be removed.
Examples
ecd.exe -references -project c:\my_first_project
Adds a reference of the active configuration of my_second_project to the active configuration of my_first_project.
ecd.exe -references -project c:\my_first_project -remove c:\my_second_project
Removes all the references of my_second_project from all configurations of my_first_project.
ecd.exe -references -project c:\my_first_project -config Debug -add c:\my_second_project
Release
2.2.5 setOptions
Modifies C/C++ managed build, launch configuration or RSE system settings.
Syntax
Parameters
-config
The build configuration name. If the '-config' flag isn't specified, the default build configuration will be used.
-file
The path of a file included in the project. If the '-file' flag is specified, a file-level setting is changed instead of a
build configuration level setting. The -file flag does not apply to the -launchConfig, -allLaunchConfigs ,
-rseSystem, and -allRseSystems flags.
A setting can be either changed by replacing its previous value by the new specified one, using the -set flag,
or prepended or appended to the existing value using the -prepend and -append flags respectively. The -
insert flag can be used for updating exist macros values in macro settings.
option-name
A complete option-name list can be obtained by using the -getOptions command documented above.
option-value
-launchConfig
-allLaunchConfigs
-rseSystem
The RSE system name. Allow modifying the value in the specific RSE systems.
Examples
Sets FOO as a defined symbol with value BAR in the list of defined symbols for every configuration.
Adds the macro in the list of defined symbols for the debug configuration. If this command is preceded by the
previous example, the list of defined symbols will contain FOO=BAR and __SOME_MACRO_FOR_DEBUG__ separated
by a line break.
Updates FOO as a defined symbol with value BAZ in the list of defined symbols for every configuration. If this
command is preceded by the first example, it will change BAR to BAZ.
Adds the macro in the list of defined symbols for this file for the active configuration. If this command is preceded
by the previous examples, the list of defined symbols for main.c will contain __SOME_MACRO_FOR_FILE__,
FOO=BAZ and __SOME_MACRO_FOR_DEBUG__ separated by a line break.
2.2.6 updateWorkspace
Updates a workspace .metadata by including any project already located in the workspace file system
directory.
Optionally, it supports redirecting the standard output to a logfile. It also supports leaving the Workbench UI
open with the -noclose flag.
Syntax
ecd.exe -updateWorkspace -data workspace-path [-logfile path] [-noclose]
Example
ecd.exe -updateWorkspace -data c:\my_workspace
The Commander view is not only a new place for existing commands, but also for new commands which optimize
common user workflows. Some commands map directly to existing commands in the IDE. For example, the
Welcome screen command and the Build All command. These two commands behave identically to the
commands in the IDE menu and toolbar. However, most commands are either improvements on existing
commands or commands which reduce the number of steps to get to an existing user interface or functionality.
In the Commander view, some commands have variant commands that appear next to the root command. The
root command works for a single project; while the All variant works for all projects in the workspace. For example,
the All command next to the Build command. These are two independent commands on a single line. The All
variant is always available because it does not need a project context, while the Build command is available only
when there is a selection in the CodeWarrior Projects view or the view is pinned to a project (Pinning Commander
view on page 30). A variant action does not have an icon and is visible only if its base command is shown.
Commands in the Commander view, are grouped in the following four groups:
• Project Creation
• Build/Debug
• Settings
• Miscellaneous
Each group is a collapsible section and each command has a key binding, which appears in the tooltip of the
command. By default, the Commander view is docked under the CodeWarrior Projects view but like any other
view it can be moved to any location within the CodeWarrior IDE.
NOTE
Commands displayed in the Commander view may vary from product to product.
NOTE
Clicking the Restore Default button sets the command set choices to the default
combination.
NOTE
CodeWarrior Power Architecture does not support using parallel jobs. For this reason,
the Use parallel jobs option is not available in the latest versions of the CodeWarrior
Development Studio for Power Architecture Processors.
7. Click Apply.
8. Click OK.
You have now specified number of processes to compile the project.
TIP
To discover additional features, try right-clicking in each IDE view to see what
commands are presented in the shortcut menu that appears.
The following figure shows the shortcut menu displayed in the Variables view.
• Enter Contact Name and Contact Email in the contact information textbox. This information is optional
though Freescale will not share this information with anyone.
• Click Restore Defaults to apply default factory settings.
• Click OK .
3. Click Next.
The Diagnostic Information Export Wizard appears.
4. Select the checkbox under the Source column to select the information that will be exported into the
archive file.
NOTE
You must select at least one file for export.
NOTE
You can open the Customize Filters dialog through Customize button in the Diagnostic
Information Export Wizard ( Figure 16. Diagnostic Information Export Wizard on page
37)or in the Preferences dialog ( General settings for Diagnostic Information on page
33).
7. Click Preview to view the text that will be sent to Freescale from the wizard.
You can also check if more filters are needed to protect any sensitive information from leakage.
8. Click OK .
9. Click Next in the Diagnostic Information Export Wizard.
The Reproducible Details page appears.
10.Enter the reproducible steps and any other relevant information in the Details to recreate the issue textbox.
11.Click Add to add additional files to the archive file for diagnosis.
12.Click Finish.
2. Enter a file descriptor. The file descriptor can be a simple file name, a partial path or a full path. The path
delimiters can also be different from that of the native platform delimiters. For example, you can use "/" on
a Windows host instead of "\".
3. Click OK.
Eclipse IDE performs the following actions:
• Scans for a matching file descriptor in all the open editor windows. If a match is found, the IDE activates the
open editor window in the Editor area.
• If no open editor windows match the specified file descriptor, IDE searches for a matching file in the
accessible paths of the current project. If a match is found, IDE opens the file in a new editor window in the
Editor area. If the file is not found, IDE generate a beep sound.
NOTE
The Open Path feature is also invoked when a file name is selected in an #include
directive in a source file. In such a case, the IDE opens the file in the Editor area without
displaying the Find and Open File dialog.
NOTE
A classic project file has the .mcp extension.
• Resolves potential handling ownership conflict between different components over the dropped objects.
• Automatically imports all projects found in a folder and its subfolders into the workspace. The projects are
opened from their location, not copied into the workspace.
For example, to create a link to a project existing in a different workspace from the current workspace:
1. Open the workspace using Windows Explorer (In Linux, you can open the workspace using Shell).
2. Drag the project folder over the CodeWarrior IDE.
The CodeWarrior IDE effectively handles the files and folders dropped to the Workbench. A link to the existing
project is created in the CodeWarrior Projects view.
4. Select Select root directory or Select archive file option and click the associated Browse to locate the
directory or file containing the projects.
The list of existing projects appear under the Project group.
5. Under Projects , select the project or projects which you would like to import.
NOTE
When there are projects with the same name in the list, only one of them is selected by
default and allow you to change the selections as needed. If any error occurs during the
import, the project list is updated and all the projects that were already imported are
disabled.
NOTE
You may select Copy projects into workspace checkbox to copy the project into
workspace. You may also select Add Project to working sets checkbox to include the
project in working sets.
6. Click Finish.
4. Select the Select root directory or the Select archive file option and click the associated Browse to locate
the directory or file containing the projects.
The list of existing projects appear under the Projects group.
5. Under Projects, select the project or projects which you would like to import.
NOTE
When there are projects with the same name in the list, only one of them is selected by
default and allow you to change the selections as needed. If any error occurs during the
import, the project list is updated and all the projects that were already imported are
disabled.
NOTE
You may select Copy projects into workspace checkbox to copy the project into
workspace. You may also select Add Project to working sets checkbox to include the
project in working sets.
6. Click Finish.
NOTE
Key bindings can vary based on the current context of Eclipse, platform and locale. The
current platform and locale is determined when Eclipse starts, and does not vary over
the course of an Eclipse instance.
The following table lists and defines the key mappings for Classic IDE and Eclipse IDE.
NOTE
The CodeWarrior Editor recognizes the files with .lcf , .cmd , and .l3k file
extensions as LCF files. A file with .txt file extension is not recognized as a LCF file.
The following table lists and defines the Build Tool Versions pane controls.
Control Description
Build Tool Versions table Lists multiple toolchain versions.
Add button Adds a new toolchain version.
Edit button Edits the currently selected toolchain version.
Delete button Deletes a toolchain version.
Set as Default button Sets the currently selected toolchain versions as
default toolchain version for building projects.
Restore Defaults button Restores the default toolchain version.
NOTE
The default toolchain version is highlighted in bold letters in the Build Tool Versions
table.
4. Click Apply.
5. Click OK.
Clicking the Toggle visibility of the details pane button in the Problems view displays the Details pane. The Details
pane displays full description of the selected error/warning.
Figure 32: Problems view - Details pane
NOTE
You can also create a project reference by dragging Project B onto Project A in the
CodeWarrior Projects view.
The following table lists various options available in the C/C++ Build > References page.
Option Description
Build referenced projects and build If selected, enable building referenced projects and build
configurations when building this configurations while building project. This option is also available from
project the CodeWarrior Projects view, by right-clicking on the `Referenced
Projects' element.
Expand All Click to expand all referenced projects in the tree.
Option Description
Collapse All Click to collapse all the referenced projects in the tree.
Move Up/Move Down Changes the referenced project build order. The first project shown
will be built first.
Edit Location Allows you to change the location of referenced project. The project
location is recorded automatically as a project-relative path, and can
make use of the project path variables to be portable across machines
Build Projects referencing this build Causes projects that include the current project as a referenced project
configuration to be included in the current build dependency, and be built when the
current project is built.
Severity level for missing references Allows you to select Error or Warning to display severity level for
projects build error makers missing references.
Restore Defaults Restores default factory settings
Apply Saves your changes without closing the dialog.
OK Saves your changes and close the dialog.
Cancel Closes the dialog without saving.
NOTE
All the project references appear under a Referenced Projects folder, which only shows
if the project contains at least one referenced project.
The following table shows the shortcut menu commands available through the CodeWarrior Projects view:
Command Description
Include in Build It allows you to quickly toggle whether all referenced
projects and build configurations will be included in the
build or not.
Open/Import Project It is available when the referenced project element is
selected and is either closed or does not exist in the
workspace. The action imports and/or opens the
referenced project in the workspace.
Close Project It is available when the referenced project element is
selected and is opened in the workspace. It allows you
to close the referenced project in the workspace.
Edit Location Allows you to edit the location of the referenced
project.
Remove Referenced Project Allows you to delete the referenced project.
NOTE
The differences between reference template and current configuration is highlighted.
You can disable highlighting from Remote Systems view's pop-up menu. The color used
for highlighting can be changed from global preferences.
NOTE
This feature is not available in StarCore.
3. Choose the item to apply the target configuration to the connection configuration.
The connection is selected with a check mark displayed.
2. Choose any one of the options available in the Remote System Settings pop-up menu.
• Do nothing
• Show a dialog; ask me what to do
• Delete the Remote System
3. Click OK.
The unreferenced remote systems are removed.
APSC feature allows you to update the Remote System tree when a project is open in the workspace and its
APSC cache doesn't match the current Remote System settings. APSC provides following two operations:
• Remote System Missing on page 73
• Remote System Changed dialog on page 74
NOTE
By default, the Remote System Missing dialog does not appear unless the Remote
System Project Cache workspace preferences are changed. Any missing host will be
automatically re-created.
If you click Yes to create the missing Remote System, a new remote system will be created and initialized with
the cached settings.
If you click No, the Remote System Missing dialog will be closed.
You can click the Configure Project Cache Settings link to directly change the Remote System Project Cache
preferences to avoid automatically displaying this dialog in future.
This section includes the following topic:
• Remote system project cache preferences on page 73
2. Expand the Remote System tree control from the left-pane of the Preferences dialog.
You can configure the way the dialog appears by changing the Remote System Project Cache page as shown
in the above figure.
3. Select an option from how to handle differing RSE System.
4. Select an option from how to handle missing RSE Systems.
5. Choose an action from the When a RSE System is no longer referenced by an open project pop-up menu.
6. Click OK to apply changes.
You have set the preferences for Remote System to handle differing Remote Systems and missing Remote
Systems.
case, you will be asked to update, discard or create a new set of objects for the cached Remote System
settings.
The Remote System Changed dialog provides following three options to resolve the version differences:
1. Replace the current version with the project version.
2. Discard the project version and update the project to use the current version.
3. Create a new Remote System for the project version.
4. Choose an appropriate option and click OK.
You can click the Configure Project Cache Settings link to directly change the Remote System Project Cache
preferences, to avoid automatically displaying this dialog in future. For details, see Remote system project cache
preferences on page 73.
NOTE
You may keep the file containing the referenced remote systems available in the
<Project_name>/Referenced Systems folder in a version control system for
future use.
3. Choose a value from the Available migrations can be shown in the workbench as problems or applied
automatically pop-up menu.
• Ignore - Ignores the migration candidates.
• Show as information - Displays migration candidates as information in the Problems view.
• Show as warning - Displays migration candidates as warnings in the Problems view.
• Show as error - Displays migration candidates as errors in the Problems view.
• Apply automatically - Automatically migrates all migration candidates.
4. Click Apply.
5. Click OK.
NOTE
Selecting the No, ignore the problem for now option stops the migration process. You
can still migrate launch configuration using Quick Fix or by directly editing the launch
configurations.
4. Select the Do this every time; don't show this dialog again checkbox to save your selection as general
preference.
5. Click OK.
The Migrate Launch Configuration for RSE dialog appears.
6. Specify a name for the launch configuration in the Create new RSE system named: textbox.
7. Click OK.
NOTE
Remote systems compatible with the chosen launch configuration are only listed in the
pop-up menu.
• Select Create new RSE system named to create a new remote system by the specified name in the
textbox.
7. Click OK.
Alternatively, You can invoke the launch configuration migration dialog using the Preferences dialog:
1. Choose Window > Preferences .
The Preferences dialog appears.
2. Choose Run/Debug > Launching > Launch Configurations in the left pane of the Preferences dialog.
The launch configuration preferences appear in the right pane of the Preferences dialog.
3. Click Migrate.
The Select Launch Configurations dialog appears.
4. Select a feature and click the Plug-in Details button to view the list of plug-ins associated with the selected
feature.
For example, if you select the Eclipse TM Project feature and click the Plug-in Details button, the Feature
Plug-ins dialog containing the list of plug-ins associated with the Eclipse TM Project feature appears.
where
• <environment variable name> represents the name of the environment variable that you want to customize.
• <command> represents the command that you can use on the environment variable. Following options are
available:
• -add - Adds the environment variable to the list, or erase the value of an existing variable.
• -remove - Removes the environment variable from the list.
• -append - Appends the value to the existing environment variable content.
• -prepend - Prepends the value to the existing environment variable content.
• <value> represents the value of the environment variable.
The expression can contain macros of the syntax %VAR%, which will be expanded before the environment variable
is set.
The cwide-env file can also include other files to be passed as cwide-env files by adding a line with the following
syntax.
-include <file name>
NOTE
The changes to the environment variable list only affect the java process created by the
cwide.exe, cwidec.exe, and ecd.exe tools.
To rest the settings of such message boxes, that is to display the previously hidden message boxes when
needed, perform the following steps.
1. Choose Window> Preferences to open the Preferences dialog.
2. Select C/C++ in the left pane.
3. Click the Clear button in the C/C++ dialogs group.
Figure 64: Preferences dialog
Chapter 3
Debugger
This chapter explains how to work with the debugger to control program execution.
This chapter describes the following topics.
• About debugger on page 92
• Breakpoints on page 92
• Build while debugging on page 110
• Cache view on page 111
• CodeWarrior debugger settings on page 116
• Core index indicators in homogeneous multicore environment on page 118
• Debug perspective on page 120
• Debug view on page 121
• Disassembly view on page 125
• Environment variables in launch configuration on page 126
• Flash programmer on page 127
• Flash File to Target on page 137
• Hardware diagnostics on page 139
• Import/Export/Fill memory on page 146
• Launch group on page 153
• Load multiple binaries on page 157
• Memory view on page 159
• Memory Browser view on page 167
• Memory Management Unit configurator on page 168
• Multicore debugging on page 183
• Multicore Groups on page 185
• Multicore reset on page 192
• Path mappings on page 195
• Redirecting standard output streams to socket on page 201
• Refreshing data during runtime on page 203
• Registers view on page 204
• Register Details view on page 209
• Remote launch on page 214
• Stack crawls on page 216
• Symbolics on page 219
• System Browser view on page 220
3.2 Breakpoints
You use a breakpoint to halt program execution on a particular line of source code.
Once execution halts, you can examine your program's current state and check register and variable values.
You can also change these values and alter the flow of normal program execution. Setting breakpoints helps
you debug your program and verify its efficiency.
The types of breakpoints are:
• Regular - Halts the program execution.
• Conditional - Halts the program execution when a specified condition is met.
• Special - Halts the program execution and then removes the breakpoint that caused the halt.
Breakpoints have enabled and disabled states. The following table defines these states.
TIP
Alternatively, press the Alt+Shift+Q, B key combination to open the Breakpoints view.
The following figure shows an editor window and the marker bar to the left of the source code. Breakpoint icons
appear in this marker bar.
Figure 67: Setting regular breakpoints
NOTE
You can add a breakpoint while debugging your project. Double-click the marker bar to
the left of a source code line to set a breakpoint at that line.
• Outline - From the shortut menu of the selected C++ class method.
• In the editor area, directly to the left of the line where you want to add the breakpoint, choose Toggle
Breakpoint from the shortcut menu. You can also double-click the marker bar next to the source code
line.
A new special breakpoint marker appears on the marker bar, directly to the left of the line, where you added
the breakpoint.
TIP
To add a special breakpoint while debugging your project, right-click the marker bar to
the left of a source code line and choose Breakpoint Types > C/C++ Software Breakpoint
or C/C++ Hardware Breakpoint from the shortcut menu.
3. Deselect the Activate the workbench when a breakpoint is hit checkbox and the Activate the debug view
when a breakpoint is hit checkbox.
4. Click Apply.
5. Click OK.
NOTE
The breakpoint preferences are set to default after completion of the debug session.
Alternatively, to ensure that CodeWarrior remains in the background, every time a breakpoint is hit, add the
following lines of code at the end of the <CWInstall>\eclipse\cwide.properties file, where <CWInstall> is
the CodeWarrior installation path:
org.eclipse.debug.ui/org.eclipse.debug.ui.activate_debug_view=false
org.eclipse.debug.ui/org.eclipse.debug.ui.activate_workbench=false
Option Description
Actions Allows you to attach one or more breakpoint actions to
a single breakpoint. For example, when a breakpoint
is encountered you could both log a message and play
a sound. Actions are executed in the order they appear
in the Actions for this breakpoint table.
Common Displays common properties of a breakpoint.
Additionally, you can define a condition that
determines when the breakpoint will be encountered.
A condition for a breakpoint can be any logical
expression that returns true or false value.
Option Description
Filtering Allows you to restrict the breakpoint to the selected
targets and threads. The Filtering option is available
during a debug session.
Instances Displays real-time breakpoint information that helps
identify the address and the way a breakpoint is
installed on a target.
4. From the Restrict to Selected Targets and Threads list, select the checkboxes adjacent to threads you
want to restrict the breakpoint.
5. Click OK.
The breakpoint is applied to the selected targets and threads.
NOTE
If no debug context exists, the breakpoint is installed in all contexts as normal.
Once set, the breakpoint filtering is maintained for the individual context during a Restart but is lost after a
Terminate. After a Terminate, the breakpoint is installed in all debug contexts.
NOTE
Disabled breakpoints can be enabled without losing any information. To know how to
enable breakpoints, see Enabling breakpoints on page 104.
NOTE
Enabled breakpoints can be disabled without losing any information. To know how to
disable breakpoints, see Disabling breakpoints on page 103.
NOTE
Alternatively, click the Remove Selected Breakpoints icon in the Breakpoints view.
NOTE
Alternatively, click the Remove All Breakpoints icon in the Breakpoints view.
NOTE
Skipped breakpoints do not suspend execution until they are turned on.
Click the Skip All Breakpoints icon again to turn on all breakpoints.
Action Description
Debugger Shell Action Executes Debugger Shell commands or a Debugger
Shell script.
Sound Action Plays the specified sound.
Log Action Logs messages to a console. The messages can be
literal strings or the result of an expression that the
debugger evaluates.
Resume Action Halt the program execution for a specified time and
then resumes the program execution.
External Tool Action Invokes a program, which is external to the debugger.
3. In the Action name textbox, enter a name for the new action.
4. Use the Action type pop-up menu to choose the type of action you want to create.
5. Specify additional breakpoint-action properties, according to the action type that you specified.
For example, to display a specified log message when the debugger encounters a breakpoint, specify the
log message in the Log Action breakpoint action.
6. Click OK.
The New Breakpoint Action dialog closes. The new breakpoint action appears in the Breakpoint Actions
preferences page table.
NOTE
To attach breakpoint actions to a breakpoint, add the associated breakpoint actions in
the Breakpoint Actions preference page.
NOTE
The debugger executes the breakpoint actions in the order shown in the Actions for this
breakpoint table.
8. To reorder the breakpoint actions in the Actions for this breakpoint table:
a. Select the action in the table.
b. Click Up to move the selected action up in the table.
c. Click Down to move the selected action down in the table.
During a debugging session, the debugger executes the breakpoint actions when the breakpoint is encountered.
4. Deselect the checkbox for the core for which you do not want the breakpoint applied.
3. Select the Automatically terminate debug session on project rebuild, don't ask checkbox.
4. Click Apply.
5. Click OK.
NOTE
Applying this setting immediately effects the project.
Now the debug session will automatically terminate while initiating a build that produces executables locked by
those debug sessions
TIP
Alternatively, start typing Cache in the type filter text textbox. The Show View dialog
filters the list of the views and displays only the views matching the characters typed in
the textbox. Select Cache from the filtered list and click OK.
NOTE
If the Select Cache pop-up menu is dimmed in the Cache view then the current target
does not support viewing cache.
NOTE
The Preserve Sorting command is not available by default. If available, every operation
that triggers cache refresh, such as step, and run to breakpoint will have to wait for the
cache data loading and sorting.
Command Description
Write Commits changes in the Cache view to the cache register of the target hardware, if
supported by the target hardware.
Refresh Reads data from the target hardware and updates the cache display.
Invalidate Invalidates the entire content of the cache.
Flush Flushes the entire content of the cache. Flushing the cache involves committing
uncommitted data to the next level of the memory hierarchy, and then invalidating
the data within the cache.
Lock Locks the cache. Locking cache prevents the cache from fetching the new lines or
discarding the current valid lines.
Synchronize Synchronize cache data with memory data.
Enable Turns on the cache.
Disable LRU Removes the Least Recently Used attribute from the existing display for each cache
line.
Inverse LRU Displays the inverse of the Least Recently Used attribute for each cache line.
Copy Cache Copies the cache contents to the system clipboard.
Export Cache Exports the cache contents to a file.
Search Finds an occurrence of a string in the cache lines.
Search Again Finds the next occurrence of a string in the cache lines.
Preserves sorting Preserves sorting of the cache when the cache data is updated and the cache is
refreshing. This option is not available by default. If available, every operation that
triggers cache refresh (like step, run to breakpoint) will have to wait for cache data
loading and sorting.
View Memory Views the corresponding memory for the selected cache lines.
Lock Line Locks the selected cache lines.
Invalidate Line Invalidates the selected cache lines.
Flush Line Flushes the entire contents of the selected cache lines.
Synchronize Line Synchronize selected cache data with memory data.
Lock Way Locks the cache ways specified with the Lock Ways menu command. Locking a
cache way means that the data contained in that way must not change. If the cache
needs to discard a line, it will not discard the locked lines, such as the lines explicitly
locked, or the lines belonging to locked ways.
Unlock Way Unlocks the cache ways specified with the Lock Ways command.
Lock Ways Specifies the cache ways on which the Lock Way and Unlock Way commands
operate.
NOTE
You can select other pages and modify their settings. When you finish, you can click
the Debug button to start a new debugging session, or click the Close button to save
your changes and close the Debug Configuration dialog.
NOTE
To stop the debugger at a user-specified function, select the User specified option and
type the function name in the textbox.
8. Click Apply.
The IDE saves the settings for the debugger to remain stopped at program entry point.
3.6.1.2 OS application
OS Application debugging happens through a connection with an agent running on the OS.
The connection to the agent is through TCP/IP or COM port. In this scenario, the agent does not have information
about the core it is running on, nor does the user specify it when configuring the launch. The user simply specifies
the IP address or COM port where the agent is running.
The System Browser view shows the IP address or COM port in the context label.
Figure 81: System Browser view - OS application
NOTE
Some projects require additional configuration before a debugging session can begin.
For more information, see the product's Targeting Manual.
Alternatively, choose Run > Step Over or click the Step Over button (shown at left) in the Debug view on page
121 toolbar to step over a routine. The current statement or routine executes; then program execution stops.
NOTE
When working with a processor that has multiple cores, you can choose Run > Multicore
Terminate to stop selected group of cores.
NOTE
The run command is shortcut for debug, go, and disconnect actions. The run command
downloads the code to the target, puts the core in running mode, and then disconnects
from the target.
• Right-click Thread in the Debug view and choose Restart from the shortcut menu.
• Click the Restart button in the Debug view toolbar to restart debug session.
NOTE
Restart action is considerable faster to relaunch a debug session as it skips over loading
executable debug information and target register descriptors.
CAUTION
Changing the program-counter value because doing so can cause your program to
malfunction. For example, if you set the program counter outside the address range of
the current function, the processor will skip the instructions that clean up the stack and
return execution to the correct place in the calling function. Your program will then
behave in an unpredictable way.
NOTE
Click the Save button or press Ctrl+S to save task settings.
The flash programmer runs as a target task in the Eclipse IDE. To program the flash memory on a target board,
you need to perform the following tasks:
• Create a flash programmer target task on page 128
• Configure flash programmer target task on page 130
• Execute flash programmer target task on page 136
4. Click the Create a new Target Task button in the Target Tasks view toolbar.
The Create New Target Task wizard appears.
Figure 89: Create New Target Task window
5. In the Task Name textbox, enter a name for the new flash programming target task.
6. Choose a launch configuration from the Run Configuration pop-up menu.
• Choose Active Debug Context when flash programmer is used over an active debug session.
• Choose a project-specific debug context when flash programmer is used without an active debug
session.
7. Choose Flash Programmer from the Task Type pop-up menu.
8. Click Finish.
The target task is created and the Flash Programmer Task editor window appears. You use this window to
configure the flash programmer target task.
• Flash Devices - Lists the devices added in the current task.
• Target RAM - Lets you specify the settings for Target RAM.
• Flash Program Actions - Displays the programmer actions to be performed on the flash devices.
NOTE
You can select multiple flash devices to add to the Flash Devices table. To select
multiple devices, hold down the Control key while selecting the devices.
4. Click Done.
The Add Device dialog closes and the flash device appears in the Flash Devices table in the Flash
Programmer Task editor window.
NOTE
For NOR flashes, the base address indicates the location where the flash is mapped in
the memory. For SPI and NAND flashes, the base address is usually 0x0.
NOTE
The Target RAM memory area is not restored by flash programmer. If you are using
flash programmer with Active Debug Context, it will impact your debug session.
The Target RAM (Add flash device on page 130) group contains fields to specify settings for the Target RAM.
• Address textbox: Use it to specify the address from the target memory. The Address textbox should contain
the first address from target memory used by the flash algorithm running on a target board.
• Size textbox: Use it to specify the size of the target memory. The flash programmer does not modify any
memory location other than the target memory buffer and the flash memory.
• Verify Target Memory Writes checkbox: Select this checkbox to verify all write operations to the hardware
RAM during flash programming.
NOTE
Actions can also be enabled or disabled using the Enabled column. The Description
column contains the default description for the flash programmer actions. You can also
edit the default description.
NOTE
Flash Programmer will not erase a bad sector in the NAND flash. After the erase action
a list of bad sectors is reported (if any).
NOTE
Press the Control or the Shift key for selecting multiple sectors from the Sectors table.
3. Click the Add Blank Check button to add a blank check operation on the selected sector.
4. Select the Erase All Sectors Using Chip Erase Command checkbox to erase the entire flash memory.
NOTE
After selecting the Erase All Sectors Using Chip Erase Command checkbox, you need
to add either erase or blank check action to erase all sectors.
5. Click Done.
The Add Erase/Blank Check Action dialog closes and the added erase/blank check actions appear in the
Flash Programmer Actions table in the Flash Programmer Task editor window.
NOTE
The program action will abort and fail if it is performed in a bad block for NAND flashes.
3. Select the Use File from Launch Configuration checkbox to use the file from the launch (run) configuration
associated with the task.
4. Specify the file name in the File textbox. You can use Workspace, File System, or Variables buttons to
select the desired file.
5. Choose a file type from the File Type pop-up menu. You can select any one of the following file types:
• Auto - Detects the file type automatically.
• Elf - Specifies executable in ELF format.
• Srec - Specifies files in Motorola S-record format.
• Binary - Specifies binary files.
6. Select the Erase sectors before program checkbox to erase sectors before program.
7. [Optional] Select the Verify after program checkbox to verify after the program.
NOTE
The Verify after program checkbox is available only with the processors supporting it.
8. Select the Restricted To Address in this Range checkbox to specify a memory range. The write action is
permitted only in the specified address range. In the Start textbox, specify the start address of the memory
range sector and in the End textbox, specify the end address of the memory range.
9. Select the Apply Address Offset checkbox and set the memory address in the Address textbox. Value is
added to the start address of the file to be programmed or verified.
10.Click the Add Program Action button to add a program action on the flash device.
11.Click the Add Verify Action button to add a verify action on the flash device.
12.Click Done.
The Add Program/Verify Action dialog closes and the added program/verify actions appear in the Flash
Programmer Actions table in the Flash Programmer Task editor window.
8. Select the Apply Address Offset checkbox and set the memory address in the Address textbox. Value is
added to the start address of the file to be programmed or verified.
9. Click the Add Checksum Action button.
10.Click Done.
The Add Checksum Action dialog closes and the added checksum actions appear in the Flash Programmer
Actions table in the Flash Programmer Task editor window.
NOTE
Flash Programmer will report bad blocks, if they are present in the NAND flash.
NOTE
Select the Perform Full Diagnostics checkbox to perform full diagnostics on a flash
device.
4. Click Done.
The Add Diagnostics Action dialog closes and the added diagnostics action appears in the Flash Programmer
Actions table in the Flash Programmer Task editor window.
NOTE
Press the Control or Shift key for selecting multiple sectors from the Sectors table.
3. Click the Add Unprotect Action button to add an unprotect action on the selected sector.
4. Select the All Device checkbox to add action on full device.
5. Click Done.
The Add Protect/Unprotect Action dialog closes and the added protect or unprotect actions appear in the
Flash Programmer Actions table in the Flash Programmer Task editor window.
NOTE
The Secure/Unsecure flash actions are not supported for StarCore devices.
NOTE
You can use predefined target tasks for supported boards. To load a predefined target
task, right-click in the Target Tasks view and choose Import Target Task from the
shortcut menu. To save your custom tasks, right-click in the Target Tasks view and then
choose Export Target Task from the shortcut menu.
You can check the results of flash batch actions in the Console view. The green color indicates the success and
the red color indicates the failure of the task.
• Erase and Program button - Erases the sectors that are occupied with data and then programs the file. If
the flash device can not be accessed at sector level then the flash device is completely erased.
This feature helps you perform these basic flash operations:
• Erasing flash device on page 138
• Programming a file on page 138
NOTE
If a connection is already established with the target, this control is disabled.
The Flash Configuration File pop-up menu is updated with the supported configurations for the processor
from the launch configuration.
3. Choose a flash configuration from the Flash Configuration File pop-up menu.
4. Select the Unprotect flash memory before erase checkbox to unprotect flash memory before erasing the
flash device.
5. Click the Erase Whole Device button.
NOTE
If a connection is already established with the target, this control is disabled.
The Flash Configuration File pop-up menu is updated with the supported configurations for the processor
from the launch configuration.
3. Choose a flash configuration from the Flash Configuration File pop-up menu.
4. Select the Unprotect flash memory before erase checkbox to unprotect flash memory before erasing the
flash device.
5. Type the file name in the File textbox. You can use the Workspace, File System, or Variables buttons to
select the desired file.
6. Type the offset location in the Offset textbox.
7. Click the Erase and Program button.
NOTE
If the task does not successfully launch the configuration that you specify, the Execute
button on the Target Tasks view toolbar stays unavailable.
NOTE
You can perform various actions on a hardware diagnostic task, such as renaming,
deleting, or executing the task, using the shortcut menu that appears on right-clicking
the task in the Target tasks view.
The Hardware Diagnostics Action editor window includes the following groups:
• Action Type on page 140
• Memory Access on page 141
• Loop Speed on page 141
• Memory Tests on page 142
Item Description
Read Select to have the hardware diagnostic tools perform read tests.
Write Select to have the hardware diagnostic tools perform write tests.
1 unit Select to have the hardware diagnostic tools perform one memory unit access size
operations.
2 units Select to have the hardware diagnostic tools perform two memory units access size
operations.
4 units Select to have the hardware diagnostic tools perform four memory units access size
operations.
Target Address Specify the address of an area in RAM that the hardware diagnostic tools should
analyze. The tools must be able to access this starting address through the remote
connection (after the hardware initializes).
Value Specify the value that the hardware diagnostic tools write during testing. Select the
Write option to enable this textbox.
Verify Memory Writes Select the checkbox to verify success of each data write to the memory.
NOTE
For all values of Speed, the time between operations depends heavily on the processing
speed of the host computer.
For Read operations, the Scope Loop test has an additional feature. During the first read operation, the hardware
diagnostic tools store the value read from the hardware. For all successive read operations, the hardware
diagnostic tools compare the read value to the stored value from the first read operation. If the Scope Loop test
determines that the value read from the hardware is not stable, the diagnostic tools report the number of times
that the read value differs from the first read value. Following table lists and describes the items in Loop Speed
pane.
Item Description
Set Loop Speed Enter a numeric value between 0 to 1000 in the textbox to adjust the speed.
You can also move the slider to adjust the speed at which the hardware
diagnostic tools repeat successive read and write operations. Lower speeds
increase the delay between successive operations. Higher speeds decrease
the delay between successive operations.
Item Explanation
Walking 1's Select the checkbox to have the hardware diagnostic tools perform the Walking
Ones on page 143 test. Deselect to have the diagnostic tools skip the Walking
Ones on page 143 test.
Address Select to have the hardware diagnostic tools perform the Address on page 143
test. Deselect to have the diagnostic tools skip the Address on page 143 test.
Bus Noise Select to have the hardware diagnostic tools perform the Bus noise on page 144
test. Deselect to have the diagnostic tools skip the Bus noise on page 144 test.
Test Area Size Specify the size of memory to be tested. This setting along with Target Address
defines the memory range being tested.
Number of Passes Enter the number of times that you want to repeat the specified tests.
Use Target CPU Select to have the hardware diagnostic tools download the test code to the
hardware device. Deselect to have the hardware diagnostic tools execute the test
code through the remote connection interface. Execution performance improves
greatly if you execute the test code on the hardware CPU, but requires that the
hardware has enough stability and robustness to execute the test code.
NOTE
The option is not applicable for CodeWarrior StarCore
devices.
Download Algorithm to Specify the address where the test driver is downloaded in case the Use target
Address CPU is selected.
NOTE
The option is not applicable for CodeWarrior StarCore
devices.
• Ones Retention: This subtest immediately follows the Walking Ones subtest. The Walking Ones subtest
should leave each memory location with all bits set to 1. The Ones Retention subtest verifies that each
location has all bits set to 1.
• Walking Zeros: This subtest first initializes memory to all ones. Then the subtest writes, reads, and verifies
bits, with each bit successively set from the LSB to the MSB. The subtest configures bits such that by the
time it sets the MSB, all bits are set to a value of 0. This pattern repeats for each location within the memory
range that you specify. For example, the values for a byte-based Walking Zeros subtest occur in this order:
• Zeros Retention: This subtest immediately follows the Walking Zeros subtest. The Walking Zeros subtest
should leave each memory location with all bits set to 0. The Zeros Retention subtest verifies that each
location has all bits set to 0.
3.13.2.4.2 Address
This section provides details on the Address test. This test detects memory aliasing.
Memory aliasing exists when a physical memory block repeats one or more times in a logical memory space.
Without knowing about this condition, you might conclude that there is much more physical memory than what
actually exists.
The address test uses a simplistic technique to detect memory aliasing. The test writes sequentially increasing
data values (starting at one and increasing by one) to each successive memory location. The maximum data
value is a prime number and its specific value depends on the addressing mode so as to not overflow the memory
location.
The test uses a prime number of elements to avoid coinciding with binary math boundaries:
• For byte mode, the maximum prime number is 28-5 or 251.
• For word mode, the maximum prime number is 216-15 or 65521.
• For long word mode, the maximum prime number is 232-5 or 4294967291.
If the test reaches the maximum value, the value rolls over to 1 and starts incrementing again. This sequential
pattern repeats throughout the memory under test. Then the test reads back the resulting memory and verifies
it against the written patterns. Any deviation from the written order could indicate a memory aliasing condition.
2. In the Task Name textbox, enter a name for the new task.
3. Use the Run Configuration pop-up menu to specify the configuration that the task launches and uses to
connect to the target.
NOTE
If the task does not successfully launch the configuration that you specify, the Execute
button of the Target Tasks view toolbar stays unavailable.
Figure 95: Import/Export Memory Action editor - Importing data into memory
Item Explanation
Memory space and address Enter the literal address and memory space on which the data transfer is
performed. The Literal address field allows only decimal and hexadecimal
values.
Expression Enter the memory address or expression at which the data transfer starts.
Access Size Denotes the number of addressable units of memory that the debugger
accesses in transferring one data element. The default values shown are 1,
2, and 4 units. When target information is available, this list shall be filtered
to display the access sizes that are supported by the target.
Select file Enter the path to the file that contains the data to be imported. Click the
Workspace button to select a file from the current project workspace. Click
the System button to select a file from the file system the standard File Open
dialog. Click the Variables button to select a build variable.
Table 14: Controls used for importing data into memory (continued)
Item Explanation
File Type Defines the format in which the imported data is encoded. By default, the
following file types are supported:
• Signed decimal Text
• Unsigned decimal Text
• Motorola S-Record format
• Hex Text
• Annotated Hex Text
• Raw Binary
Table 15: Controls used for exporting data from memory into file
Item Explanation
Memory space and address Enter the literal address and memory space on which the data transfer is
performed. The Literal address field allows only decimal and hexadecimal
values.
Expression Enter the memory address or expression at which the data transfer starts.
Access Size Denotes the number of addressable units of memory that the debugger
accesses in transferring one data element. The default values shown are 1,
2, and 4 units. When target information is available, this list shall be filtered
to display the access sizes that are supported by the target.
Select file Enter the path of the file to write data. Click the Workspace button to select
a file from the current project workspace. Click the System button to select a
file from the file system the standard File Open dialog. Click the Variables
button to select a build variable.
Table 15: Controls used for exporting data from memory into file (continued)
Item Explanation
File Type Defines the format in which encoded data is exported. By default, the
following file types are supported:
• Signed decimal Text
• Unsigned decimal Text
• Motorola S-Record format
• Hex Text
• Annotated Hex Text
• Raw Binary
Table 16: Controls used for filling memory with data pattern
Item Explanation
Memory space and Enter the literal address and memory space on which the fill operation is
address performed. The Literal address field allows only decimal and hexadecimal values.
Expression Enter the memory address or expression at which the fill operation starts.
Access Size Denotes the number of addressable units of memory that the debugger accesses
in modifying one data element. The default values shown are 1, 2, and 4 units.
When target information is available, this list shall be filtered to display the access
sizes that are supported by the target.
Fill Pattern Denotes the sequence of bytes, ordered from low to high memory mirrored in the
target. The field accept only hexadecimal values. If the width of the pattern exceeds
the access size, an error message.
Number of Elements Enter the total number of elements to be modified.
Verify Memory Writes Select the checkbox to verify success of each data write to the memory.
Control Description
Name Specify a name for the launch group
Up button Click to move up the selected launch configuration
Down button Click to move down the selected launch configuration
Edit button Click to edit the selected entry in the launch group
Add button Click to add a launch configuration to the launch group
Remove button Click to remove a launch configuration from the launch group
4. Specify a name for the launch group configuration in the Name textbox.
5. Click Add.
The Add Launch Configuration dialog appears.
Option Description
Launch Mode Allows you to specify launch mode for the selected launch configuration. This
can also be used to filter launch configurations.
• debug - specifies that the launch configuration will be launched in debug
mode.
• run - specifies that the launch configuration will be launched in run mode.
• profile - specifies that the launch configuration will be launched in profile mode.
Use default mode when Selecting this checkbox indicates that the child launch configuration should be
launching launched in the mode used to initiate the launch group launch.
Post launch action Allows you to specify a post launch action for the selected launch configuration.
• None - the debugger immediately moves on to launch the next launch
configuration.
• Wait until terminated - the debugger waits indefinitely until the debug session
spawned by the last launch terminates and then it moves on to the next launch
configuration.
• Delay - the debugger waits for specified number of seconds before moving on
to the next launch configuration.
3. Click the Debugger tab to view the corresponding debugger settings page.
4. Click the Other Executables tab under the Debugger Options pane.
6. Enter the path to the additional executable file that the debugger controls in addition to the current project's
executable file. Alternatively, click the Browse button to specify the file path.
7. Select the Load Symbols checkbox to have the debugger load symbols for the specified file. Deselect to
prevent the debugger from loading the symbols. The Debug column of the File list corresponds to this
setting.
8. Select the Download to Device checkbox to have the debugger download the specified file to the target
device. Deselect this checkbox to prevent the debugger from downloading the file to the device. The
Download column of the File list corresponds to this setting.
9. Click OK to add the additional executable to the Other Executables file list.
10.Click Debug to launch a debug session with multiple binaries.
Multiple binary files within a debugging session are now available.
This section includes the following topic:
• Viewing binaries on page 158
NOTE
All executables listed in the Other Executables pane are added to the Modules view
whether or not they are marked to be targeted or downloaded.
• Floating Point
• Fixed Point
The default rendering is displayed automatically when a monitor is created.
The Memory view contains these two panes:
• Monitors - Displays the list of memory monitors added to the debug session currently selected in the Debug
view
• Renderings - Displays memory renderings.
The content of the Renderings pane is controlled by the selection in the Monitors pane. The Renderings pane
can be configured to display two renderings simultaneously.
This section includes the following topics:
• Opening Memory view on page 160
• Adding memory monitor on page 160
• Adding memory renderings on page 162
• Mixed source rendering on page 163
• Setting memory access size on page 164
• Exporting memory on page 164
• Importing memory on page 165
• Setting watchpoint in Memory view on page 166
• Clearing watchpoints from Memory view on page 166
NOTE
If you do not select a memory space and the expression does not contain a memory
space then the memory space is set to default data memory space that is specific for
each architecture
5. If you want to translate the memory address or the expression to another memory space, select the
Memory space checkbox.
The Memory space pop-up menu becomes available.
6. Choose one of the following values from the Memory space pop-up menu.
• Physical - Indicates that the specified address or expression refers to physical memory space.
• Data - Indicates that the specified address or expression refers to data memory space.
• Program - Indicates that the specified address or expression refers to program memory space.
7. Click OK.
The memory monitor is added to the Monitors pane and the default rendering is displayed in the Renderings
pane.
NOTE
The default value for the Column size depends on the architecture being debugged. For
example, for 32 bit architectures the default value for Column size is 4 and for 8 bit
architectures the default value is 1. To save the newly selected values as default values,
click the Save as Defaults button.
6. Click OK.
1. Open the Memory view (see Opening Memory view on page 160).
2. Click the Export button in the Memory view toolbar.
The Export Memory dialog appears.
Figure 109: Export Memory dialog
• Format pop-up menu - Lets you choose the format in which the memory data is exported.
• SRecord - Exports memory data in Motorola S-record format.
• Plain Text - Exports memory data in ASCII format.
• RAW Binary - Exports memory data in binary format.
• Start address textbox - Specify the start address of memory range to be exported.
• End address textbox - Specify the end address of the memory range to be exported.
• Length textbox- Displays the length of the memory range.
• File name textbox - Specify the file name to save the exported memory. Click the Browse button to select
a file on your system.
• Choose memory format from the Format pop-up menu.
• Specify the start address of the memory range to be exported in the Start address textbox.
• Specify the end address of the memory range to be exported in the End address textbox.
• Type a file name in the File name textbox. Click Browse to select a file on your system.
• Click OK.
Memory data is now exported.
NOTE
All watchpoints clear automatically when the target program terminates or the debugger
terminates the program. Your watchpoints are reset the next time the program runs.
To browse to a desired memory location, type the memory address in the Memory Address textbox and click
the Go button. The memory location is highlighted in the Memory Browser view.
NOTE
If you do not select a memory space and the expression does not contain a memory
space then the memory space is set to default data memory space that is specific for
each architecture.
If you want to translate the memory address or the expression to another memory space, choose one of the
following values from the Memory space pop-up menu.
• Physical - Indicates that the specified address or expression refers to physical memory space.
• Data - Indicates that the specified address or expression refers to data memory space.
• Program - Indicates that the specified address or expression refers to program memory space.
4. Enter in the Container textbox the path to the directory in which you want to store the MMU configuration.
Alternatively, click Browse and use the resulting dialog to specify the directory.
5. Enter in the File name textbox a name for the MMU configuration. Alternatively, leave the default name
intact.
NOTE
If you enter a new name, make sure to preserve the .mmu filename extension.
6. Expand Device Number, and select the target hardware for which you are creating the MMU configuration.
( SC3x50)
7. Click Finish.
The IDE generates the MMU configuration file in the specified container directory and opens the MMU
Configuration File Editor view.
Save TCL Source Save the generated TCL script to a new .tcl file.
Read Target Registers Updates the content of the MMU Configuration File Editor pages
to reflect the current values of the target hardware registers.
Write Target Registers Writes the modified content of all the MMU Configuration File
Editor pages. You must click this button, or use the
corresponding toolbar menu command to write the MMU
Configurator modifications to the target hardware registers.
The following table explains each option on the Program MATT page.
Option Explanation
Virtual Enter the virtual base address of the program segment. This option corresponds to
the Program Segment Virtual Base Address and Size (PSVBAS) bits of the Program
Segment Descriptor Registers A (M_PSDAx) that configure the virtual base address.
Physical Enter the most-significant part of the physical address to use for translation. This
option corresponds to the Data Segment Physical Base Address (DSPBA) bits of the
Data Segment Descriptor Registers B (M_DSDBx)."
Size Specify the PMATT Units number in Number box. Select the PMATT Units type from
the Type pop-up menu: B, KB, MB, GB
Permissions Specify whether to share the program segment. This option corresponds to the
System/Shared Virtual Program Memory (SSVPM) bit of the Program Segment
Descriptor Registers A (M_PSDAx).
Burst Specify the number of transactions (beats) on the bus that the bus controller cannot
interrupt. This burst size applies in the region to a cacheable segment. This option
corresponds to the Program Burst Size (PBS) bits of the Program Segment
Descriptor Registers B (M_PSDBx).
Option Explanation
L2 Cache Policy Determines the cache policy for the L2 cache for accesses from the core through L1
Instruction cache: Cacheable, NonCacheable, and Reserved. The pop-up menu has
two Reserved values.This is because the L2 Cache Policy Values is stored on 2 bits
so they are 4 possible values (2 valid and 2 reserved). Every entry in the combo box
corresponds to a combination of bits.
Cacheable Selected - Allows caching of the segment in instruction cache. Deselected - Disables
caching of the segment in instruction cache. This checkbox corresponds to the
Instruction Cacheability (IC) bit of the Program Segment Descriptor Registers A
(M_PSDAx).
PAPS Selected-The segment has supervisor-level fetch permission for program accesses.
If you select the PAPU checkboxas well, you disable program-protection checks for
this segment. Deselected - The segment does not have supervisor-level fetch
permission for program accesses. This checkbox corresponds to the Program
Access Permission in Supervisor Level (PAPS) bit of the Program Segment
Descriptor Registers A (M_PSDAx).
Entry Enabled Selected - The MMU enables this mapping entry. Deselected - The MMU disables
this mapping entry.
PAPU Selected - The segment has user-level fetch permission for program accesses. If you
select the PAPS checkbox as well, you disable program-protection checks for this
segment. Deselected - The segment does not have user-level fetch permission for
program accesses. This checkbox corresponds to the Program Access Permission
in User Level (PAPU) bit of the Program Segment Descriptor Registers A
(M_PSDAx).
Prefetch Line Selected - Allows the fetch unit's program-line pre-fetch to a segment cacheable in
instruction cache. Deselected - Disables the fetch unit's program-line prefetch to a
segment cacheable in instruction cache. This checkbox corresponds to the Program
Pre-fetch Line Enable (PPFE) bit of the Program Segment Descriptor Registers B
(M_PSDBx).
Program Next Line Selected - Allows the fetch unit's program next line pre-fetch mechanism to an ICache
Prefetch cacheable segment. Deselected - Enables the fetch unit's program next line pre-fetch
mechanism to an ICache cacheable segment.
The PMATT Table page as shown in figure below displays an alternate, tabular rendering of the settings that
you specify on the Program MATT page. Use this page to view the configuration of all Program MATT mappings.
The MMU configurator uses the settings that you specify on the Program MATT page to generate the column
headers of this page. The table data shows the validated records for each Program MATT entry. You can resize
the table columns to hide columns or view the larger data fields. A plus sign ( + ) in a table cell represents a
selected checkbox in the associated Program MATT configuration page.
NOTE
The PMATT Table page shows just a tabular summary of the settings that you specify
on the Program MATT page. To make changes, use the Program MATT page.
The following table explains each option on the Data MATT page
Option Explanation
Virtual Enter the virtual base address of the data segment. This option corresponds to the Data
Segment Virtual Base Address and Size (DSVBAS) bits of the Data Segment Descriptor
Registers A (M_DSDAx) that configure the virtual base address.
Physical Enter the most-significant part of the physical address to use for translation. The value
that you specify determines the size of the most- significant part. This option
corresponds to the Data Segment Physical Base Address (DSPBA) bits of the Data
Segment Descriptor Registers B (M_DSDBx).
Size Specify the PMATT Units number in Number box. Select the PMATT Units type from
the pop-up menu: B, KB, MB, GB
Permissions Specify whether to share the data segment: shared and non-shared This option
corresponds to the Supervisor/Shared Virtual Data Memory (SSVDM) bit of the Data
Segment Descriptor Registers A (M_DSDAx).
Burst Specify the number of transactions (beats) on the bus that the bus controller cannot
interrupt. This burst size applies in the region to a cacheable segment. This option
corresponds to the Data Burst Size (DBS) bits of the Data Segment Descriptor Registers
B (M_DSDBx).
Option Explanation
L2 Cache Policy Determines the cache policy for the L2 cache for accesses from the core through L1
Data Cache: Cacheable write through, Cacheable write-back, Non-cacheable, and
Adaptive write.
DAPU Specify whether to allow user-level read (r-), write (-w), both (rw), or neither(--) types of
data access. This option corresponds to the Data Access Permission in User Level
(DAPU) bits of the Data Segment Descriptor Registers A (M_DSDAx).
DAPS Specify whether to allow supervisor-level read (r-), write (-w), both (rw), or neither (--)
types of data access. This option corresponds to the Data Access Permission in
Supervisor Level (DAPS) bits of the Data Segment Descriptor Registers A (M_DSDAx).
Write Policy Specify the policy to use for data writes and cache:
• Cacheable write through-Writes are buffered in the write queue (WRQ) and goes both
to the cache and to the higher-level memory. The write-through is a non-write allocate,
and a cacheable write-through access is not updated in the cache unless there is a
hit.
• Cacheable write back-writes are buffered in the write queue (WRQ) and goes through
the DCache and the write back buffer (WBB). The information is written to the VBR
in the cache only. The modified cache VBR is written to higher-level memory only
when it is replaced. The resulting WBB is combined with a write-allocate write-miss
policy in which the required VBR is loaded to cache when a write-miss occurs.
• Non Cacheable write through-writes are buffered in the WRQ and goes through the
write through buffer (WTB) to the higher-level memory
• Non-cacheable write-through destructive area-writes are buffered in the WRQ and
goes through the write through buffer (WTB) to the higher-level memory. Speculative
read accesses are blocked in the platform level and does not goes to a higher level
memory.
Prefetch Line Selected - Enables the fetch unit's data-line prefetch to a segment cacheable in data
cache. Deselected - Disables the fetch unit's data-line prefetch to a segment cacheable
in data cache. This checkbox corresponds to Data Pre-fetch Line Enable (DPFE) bit of
the Data Segment Descriptor Registers B (M_DSDBx).
Entry Enabled Selected - The MMU enables this mapping entry. Deselected - The MMU disables this
mapping entry.
Figure 119: MMU Configuration File Editor - Data MATT Table page
The DMATT Table page shows an alternate, tabular rendering of the settings that you specify on the Data MATT
page. Use this page to view the configuration of all Data MATT mappings. The MMU configurator uses the
settings that you specify on the Data MATT page to generate the column headers of this page. The table data
shows the validated records for each Data MATT entry. You can resize the table columns to hide columns or
view the larger data fields. A plus sign ( + ) in a table cell represents a selected checkbox in the associated Data
MATT configuration page.
NOTE
The DMATT Table page shows the summary of the settings that you specify on the
Data MATT page in the tabular format. To changes these settings, use the Data MATT
page.
1. From the CodeWarrior IDE menu bar, choose MMU Editor > Save C to save the generated C code.
Alternatively, click the corresponding toolbar buttons in the MMU Configurator toolbar.
A standard Save dialog appears.
2. Specify the filename in the File name textbox and click Save to save the generated code as a new file.
NOTE
The MMU Configuration File Editor regenerates the C code when you change settings
in the configuration pages or when you click Change on the Program MATT or Data
MATT pages.
NOTE
The MMU Configuration File Editor regenerates the Assembly code when you change
settings in the configuration pages or when you click Change on the Program MATT or
Data MATT pages.
NOTE
The MMU Configuration File Editor regenerates the TCL script when you change
settings in the configuration pages or when you click Change on the Program MATT or
Data MATT pages.
NOTE
Because the MMU configurator view does not have an associated configuration file
initially, the MMU tab appears in place of the tab that shows the name of the
configuration file. Saving the MMU Configurator view settings to a file (by choosing File
> Save ) replaces the MMU tab with the name of the saved configuration file.
You just finished opening the MMU Configurator view. You can right-click the MMU Configurator tab to choose
the menu command that detaches the view into a floating window. Also, you can drag the MMU Configurator
tab to a different collection of view tabs.
NOTE
CodeWarrior for Microcontrollers v10.x does not support debugging multiple projects on
multiple cores in the same multi-core target. CodeWarrior for Microcontrollers v10.x
supports creating and/or debugging Single Multi Processing (SMP) projects.
NOTE
If Use all cores is enabled, then all cores in the processor are suspended. Otherwise, if
the core is in a multicore group, then all cores in the multicore group are suspended. In
either case, cores that are not being debugged can still be affected by the command. If
this is not the desired behavior, then reconfigure your multicore groups.
NOTE
If Use all cores is enabled, all cores in the processor are resumed. Otherwise, if the core
is in a multicore group then all cores in the Multicore Group are resumed. In either case,
note that cores that are not being debugged can still be affected by the command. If this
is not the desired behavior, reconfigure your multicore groups.
NOTE
If Use all cores is enabled then all Debug Threads for the processor will be terminated.
Otherwise, if the core is in a multicore group then all threads corresponding to the cores
in the multicore group will be terminated.
• New button - Creates a new group using the New Multicore Group dialog. The initial name of the group is
the name unless the name is already in use. If the name is already in use then an index is appended to
the group name. The initial enablement of the group and its descendants will be non-cores enabled,
cores disabled. This guarantees an initial state with no error due to overlap.
• Remove button - Removes a selected group.
• Remove All button - Remove all groups.
• Use all cores checkbox - If selected, all cores are used for multicore operations irrespective of multicore
groups.
• Limit new breakpoints to current group checkbox - If selected, all new breakpoints set during a debug
session are reproduced only on cores belonging to the group of the core on which the breakpoint is set.
When the Use all cores checkbox is selected, this checkbox appears dimmed and is not used on
breakpoints filtering, as all cores are considered on the same group for multicore operations.
• Click the New button.
The New Multicore Group dialog appears.
NOTE
You are not allowed to enable a group that overlaps with another group.
4. Click OK.
Command Description
mc::type Syntax mc::type Lists the available target types.
mc::type import Syntax mc::type import <filename> Imports a new specified using the
filename .
Command Description
mc::group rename Syntax mc::group rename <name>|<group-index> <new-name> Renames
an existing group. Specifying a duplicate name results in an error.
mc::group remove Syntax mc::group remove <name>|<group-index> ... Removes the
specified group or groups.
mc::group removeall Syntax mc::group removeall Removes all groups.
mc::group enable|disable Syntax mc::group enable|disable <index> ...|all Enables or disables
nodes in the group tree.
NOTE
Multicore breakpoint halt groups are supported by P4080 processor only.
NOTE
The system reset action is applicable for initial launch only.
• Execute system reset - Resets the entire Remote System. This checkbox is available only if the
processor supports system reset. Reset system is executed only for the initial launch.
• Core reset - Independently resets one or more cores from the Remote System. This is available only if
the processor supports core reset. Use this column in RSE configuration if you want to independently
reset the core on launch or restart. Initial launches with system reset and core reset options will execute
only the system reset.
• Run out of reset - Puts a core in run mode after reset. This is available only if System Reset or Core
Reset is selected.
• Initialize target - Allows initialize target script configuration
• Initialize target script - Script to initialize the target. This is available only if initialize target is selected.
Target initialization scripts and reset cores are applied to cores being launched.
4. Select the Execute system reset checkbox to perform system reset. The system reset applies only to initial
launch.
5. Select the Core reset checkbox adjacent to the core on which you want to perform a reset action.
6. Select the Run out of reset checkbox adjacent to the core on which you want to perform run out of reset
action.
7. Click OK.
NOTE
Initialization files are executed only for cores selected for debug.
The Path Mappings page appears. This page displays every path mapping settings for the launch
configurations associated with a project.
Figure 131: Automatic path mapping
You can edit either a single set of settings for all launch configurations associated with a project or the settings
for a given launch configuration by choosing the appropriate value from the Launch Configuration pop-up
menu.
Under each path mapping, the table displays a list of source files that exist in the binary executable that share
the same source mapping prefix. In the Local Path column, a green sign ( ) appears if the file exists after
being mapped by the destination path or a red ( ) if it does not. Also, the local path itself is displayed in red
if it does not exist on the local file system.
A default folder named Files Not Mapped is created if you explicitly remove existing mappings. All unmapped
files that are not found on the file system are automatically shown under this folder.
The following table describes various options available in the Path Mappings page.
Options Description
Auto Correct When clicked, iterates automatically through all the
files not found on the file system and attempt to
group them with their common prefix. This action
often generates satisfactory results from the source
files listed in the binaries so that the manual steps
required by the user are kept at a minimum.
Options Description
Add Allows you to create a new Path Mapping entry. If
any paths are selected, the dialog will be pre-
initialized with their common prefix.
Remove Allows you to remove any path mapping or default
entry.
Edit Allows you to change the values of the selected path
mapping entry. Editing non-path mapping entry is not
supported.
Up Allows you to reorder the entries by moving the
selected entry up in the list. Note that path mappings
need always to be grouped together, and as such
moving up the top most path mapping will always
move its siblings above the preceding entry as well.
Down Allows you to reorder the entries by moving the
selected entry down in the list. Note that path
mappings need always to be grouped together, and
as such moving down the bottom most path mapping
will always move its siblings below the following entry
as well.
Restore Defaults Resets the launch configuration path mappings
settings to their previous values, including the library
path mapping automatically generated by the APM
plug-in.
NOTE
If you create a new path mappings manually from the source lookup path, the source
files are automatically resorted to their most likely path mapping parent.
4. Click OK.
The Path Mappings dialog closes.
2. Click Add.
The Add Source dialog appears.
3. Select Path Mapping.
Figure 133: Add Source dialog
4. Click OK.
TIP
You can use the IDE to discover the path to the parent project of the executable file,
relative to the computer that generated the file. In the C/C++ Projects view of the C/C+
+ perspective, expand the project that contains the executable file that you want to
debug. Next, expand the group that has the name of the executable file itself. A list of
paths appears, relative to the computer that generated the file. Search this list for the
names of source files used to build the executable file. The path to the parent project of
one of these source files is the path you should enter in the Compilation path textbox.
8. In the Local file system path textbox, enter the path to the parent project of the executable file, relative to
your computer. Alternatively, click the Browse button to specify the parent project.
Suppose the computer on which you debug the executable file is not the same computer that generated that
executable file. On your current computer, the path to the parent project of the executable file is C:\projects
\thisproject. Enter this path in the Local file system path textbox.
9. Click OK.
The Path Mappings dialog closes. The mapping information now appears under the path mapping shown in
the Source Lookup Path list of the Source page.
10.If needed, change the order in which the IDE searches the paths.
The IDE searches the paths in the order shown in the Source Lookup Path list, stopping at the first match.
To change this order, select a path, then click the Up or Down button to change its position in the list.
11.Click Apply.
The IDE saves your changes.
This section also includes:
• Adding path mapping to workspace on page 200
3. Repeat steps 2-11 provided in the Manual path mappings on page 197 section for adding a path mapping
for a single launch configuration.
The Debug Configurations dialog appears. The left pane of the Debug Configurations dialog has a list of
debug configurations that apply to the current application.
3. Expand the CodeWarrior tree, and select the name of the debug configuration for which you want to
modify debugger settings.
The right pane of the Debug Configurations dialog shows the settings for the configuration that you selected.
4. Click the Common tab.
The common settings are available in the right pane of the Debug Configurations dialog.
Figure 136: Debug Configurations dialog
NOTE
You can also use the redirect command in the debugger shell to redirect standard
output streams to a socket.
6. Type the refresh interval in the Refresh while running period (seconds) textbox.
7. Click Apply.
The changes are applied to the selected debug configuration.
• Default
• Decimal
• Hexadecimal
• Octal
• Binary
• Fractional
The Registers view also allows you to cast existing data type to complex data types that may or may not exist
in the debugged executable. For more information on casting a data type, see Cast to Type on page 230.
NOTE
Casting a register to a type requires that the size of the register must match the size of
the type, otherwise the cast will fail. Therefore, if the type is a complex one (for example,
structure, union), it should be declared first to avoid padding done by compilers.
4. Enter a new value in the Enter a new value for ALTCAR textbox.
5. Click OK.
The debugger assigns the specified value to the selected register.
TIP
Alternatively, you can click on the value and edit it to change the Registers value.
• Registers group - Controls the scope of export operation. Selecting the All option exports all registers in
the Registers view. Selecting the Selected option exports selected registers. If a register group is
selected in the Registers view then the entire register tree, starting at the selected node, is exported.
NOTE
The Selected option is unavailable if no register is selected in the Registers view.
• File textbox - Specifies the name of the file to store the exported register information.
• Include register information checkbox - Select to export the location information for registers.
• Overwrite existing checkbox - Select this checkbox to overwrite an existing file.
• Cancel on error checkbox - Select to stop the export operation upon encountering any error.
3. Click Finish.
• File pop-up menu - Specifies the name of the register data file to import register information.
• Import all registers - Selecting this option allows you to import all registers from the register data file.
• Import selected registers - Selecting this option allows you to select registers you want to import.
• Verify checkbox - When selected, a register write to the target is followed by a read and a comparison
against the written value. This ensures that the import operation on the register is successful.
• Cancel on error checkbox - Select to stop the import operation upon encountering any error.
3. Click Finish.
NOTE
The default display of the Registers view shows register details, such as Bit Fields,
Description, and Actions. To see more register contents, use the pop-up menu in the
Registers view to choose Layout > Registers View Only. To restore the register details,
use the pop-up menu to choose a different menu command.
To open the Register Details view, right-click on a register name in the Registers view and choose Show Details
As > Register Details pane from the shortcut menu. You can also click the Register Details button on the toolbar
to open the Register Details view.
NOTE
If the Registers view loses focus, all pending changes are discarded. For more
information, see the <Product> Targeting Manual.
Following sections will help you with more details on the Register Details view:
• Viewing register details offline on page 210
• Loading register dump file in offline Register Details view on page 212
• Customizing Register Details pane on page 213
Click the Register Details button in the CodeWarrior IDE toolbar to open the offline Register Details view.
The register details are presented in the same way as in the Registers view. Choose a supported processor
from the Processors pop-up menu and a core available on the chosen processor from the Core pop-up menu.
Click the register from the list to view details offline. All registers appear in a tabular format similar to the online
Registers view. The value shown for each register is 0 and all registers are read-only. You can view all possible
values for bit fields, but the write operation is disabled.
The Register Details view also provides an editor for "regs" files (files exported from registers view). Choose
File > Open File and select the previously exported registers dump (. reg ) file, to open the Register Details
view for viewing and editing registry details offline. For details on how to create a .reg file, see Exporting
registers on page 207.
Figure 143: Viewing register details offline - Visual editor
Upon loading the registers file, you can view and edit the register details in the Visual Editor mode and click
Write to save the updated details to the .reg file. Alternatively, you can click the Text Editor tab to edit the
registers file.
NOTE
You can add optional columns to the Register Details view by right-clicking on the table's
header and choosing the required option from the shortcut menu.
The following table provides details of the various options that help you load register dump file for mapping on
MMR registers. These options are available in the shortcut menu that appears on right-clicking in the Register
Details view.
To load a dump file in the offline Register Details view, perform the following steps.
1. Right-click in the Register Detailsview, and choose Load Dump File from the shortcut menu. Alternatively,
you can drag and drop the dump file over the registers.
The Import Register Dump dialog appears.
2. Browse the dump file to be loaded.
3. Specify the Dump type, Destination offset, and dump Endianness in the respective fields. Destination
offset is the memory offset where the register dump file will be loaded.
4. Click Finish.
A column is added with the name same as that of the loaded dump file along with global offset for the file.
For example, dump.bin. To change the value of the destination offset, choose Change destination offset from
the shortcut menu.
In case you choose the drag and drop method to load the dump file, the Dump file and Destination offset are
automatically filled in. You can change the endianness for the dump file by choosing Endianness from the
shortcut menu. The value of the register will be loaded from dump file at displayed file offset and using the
displayed endianness. The registers that are mapped outside the dump file range display “NA” in the dump file
column.
NOTE
Click the Help/Examples link in the CodeWarrior Remote Launch web page for remote
launch examples.
The Jython Consoles view is a scripting view where you can work with Jython scripts. You can use this view to
test remote launches.
Figure 148: Jython Consoles view
The Show Only One Frame menu command is a two-state menu item which uses a checkmark to indicate the
state. If the Show Only One Frame menu command is chosen then a checkmark appears and only one frame
is displayed. The following figure shows the stack crawl in a one frame mode.
Figure 150: Stack crawls in One Frame mode
The decorator 1 in the stack frame element indicates that the stack crawl is limited to one.
3. Type the maximum frame depth in the Maximum stack crawl depth textbox.
NOTE
The upper limit for maximum frame depth is 100.
4. Click Apply.
5. Click OK.
Changing the stack crawl preference does not have an immediate effect on stack crawls currently displayed in
the Debug view. The limit takes effect the next time the stack crawl is constructed, which happens either on the
next suspended event, or after toggling in or out of the one frame mode.
When the actual stack crawl depth of a core exceeds the number of frames specified in the global preference,
the stack crawl contains a final frame that is labeled ... ( Figure 152. Exceeding stack crawl depth on page
219). This label indicates that frames are being omitted from display.
3.30 Symbolics
Use the Symbolics page to specify whether the debugger keeps symbolics in memory.
Symbolics represent an application's debugging and symbolic information. Keeping symbolics in memory, known
as caching symbolics, helps when you debug a large application.
Suppose that the debugger loads symbolics for a large application, but does not download program code and
data to a hardware device. Also, suppose that the debugger uses custom makefiles with several build steps in
order to generate the large application. In this situation, caching symbolics helps speed up the debugging
process. The debugger uses the cached symbolics during subsequent debugging sessions. Otherwise, the
debugger spends significant time creating an in-memory representation of symbolics during subsequent
debugging sessions.
NOTE
Caching symbolics provides the most benefit for large applications because doing so
speeds up application-launch times. If you debug a small application, caching symbolics
does not significantly improve launch times.
NOTE
The System Browser view shows information only when there is an OS running on the
target being debugged.
5. Click OK.
You have just configured target connection lost settings for debugger.
NOTE
The target board can be initialized either by the debugger (by using an initialization file),
or by an external boot loader or OS (U-Boot, Linux). In both cases, the extra use of an
initialization file is necessary for debugger-specific settings (for example, silicon
workarounds needed for the debug features).
NOTE
You do not need to use an initialization file if you debug using the CodeWarrior TRK
debug protocol.
4. Click the ellipsis button in the Initialize target script column corresponding to the core for which you want to
select the target initialization file.
TIP
Click in the specified cell of the Initialize target script column for the ellipsis button to
appear.
The target initialization file path appears in the Initialize target column.
5. Click OK.
3.35 Variables
The Variables view shows all global and static variables for each process that you debug.
Use the view to observe changes in variable values as the program executes.
Figure 160: Variables view
NOTE
In the Variables view, Freescale CDT (C/C++ Development toolkit) does not support the
Actual Type column. This column is relevant for C++ only when RTTI (Runtime type
information) is used. Choose Window > Preferences... > C/C++ > Debug > CodeWarrior
Debugger, and select the Attempt to show the dynamic runtime type of objects checkbox
to get declared types displaying the Actual types.
TIP
You can use the Select Columns dialog to hide/show different columns in the Variables
view.
• Decimal
• Hexadecimal
• Fractional
This topic includes:
• Fractional variable formats on page 229
NOTE
The Qn formats are available or dimmed depending on the size of the variable.
TIP
You can also add a global variable by choosing the Add Global Variable command from
the shortcut menu.
3. Specify a search criteria in the available textbox to filter the list of variables.
4. Select the global variable to be added.
NOTE
Global variables of other executables (other than the main one) are also listed in the
Add Globals dialog.
5. Click OK.
3.36 Watchpoints
You use watchpoints (sometimes referred to as access breakpoints or memory breakpoints) to halt program
execution when your program reads or writes to a specific memory location.
You can then examine the call chain, check register and variable values, and step through your code. You can
also change variable values and alter the flow of normal program execution.
You can set a watchpoint from the:
• Breakpoints view
• Memory view
• Registers view
• Variables view
NOTE
Not all targets support setting a watchpoint on a memory range. For example, if a target
has only one or two debug watch registers, you cannot set a watchpoint on 50 bytes.
The debugger handles both watchpoints and breakpoints in a similar way. You use the Breakpoints view to
manage both types. For example, you use the Breakpoints view to add, remove, enable, and disable both
watchpoints and breakpoints.
The debugger attempts to set the watchpoint if a session is in progress based on the active debugging context
(the active context is the selected project in the Debug view). If the debugger sets the watchpoint when no
debugging session is in progress, or when re-starting a debugging session, the debugger attempts to set the
watchpoint at startup as it does for breakpoints.
The Problems view displays error messages when the debugger fails to set a watchpoint. For example, if you
set watchpoints on overlapping memory ranges, or if a watchpoint falls out of execution scope, an error message
appears in the Problems view. You can use this view to see additional information about the error.
This section includes the following topics:
• Setting watchpoint on page 232
• Creating watchpoint on page 233
• Viewing watchpoint properties on page 234
• Modifying watchpoint properties on page 235
• Disabling watchpoint on page 236
• Enabling watchpoint on page 236
• Remove watchpoint on page 237
• Remove all watchpoints on page 237
Option Description
Expression to Watch Enter an expression that evaluates to an address on
the target device. The debugger displays an error
message when the specified expression evaluates to
an invalid address. You can enter these types of
expressions:
• An r-value, such as &variable
• A register-based expression. Use the $ character to
denote register names. For example, enter $SP-12
to have the debugger set a watchpoint on the stack-
pointer address minus 12 bytes.
The Add Watchpoints dialog does not support entering
expressions that evaluate to registers.
Memory Space Select it if you want to specify the memory space in
which the watchpoint is set. The pop-up menu to the
right of the checkbox lists each memory space
available for the active debug context. If no debug
session is active, the pop-up menu is empty and lets
you enter text. This feature lets you set a memory-
space-qualified watchpoint before starting a debug
session.
Range If selected - enter the number of addresable units that
the watchpoints monitors. If deselected - set the
watchpoint on the entire range of memory occupied by
the variable.
Write If selected - the watchpoint monitors write activity on
the specified memory space and address range. If
deselected - the watchpoint does not monitor write
activity.
Option Description
Read If selected - the watchpoint monitors read activity on
the specified memory space and address range. If
deselected - the watchpoint does not monitor read
activity.
Enabled Select the Enabled option to enable or disable a
breakpoint.
Condition Specifies an expression that is evaluated when the
watchpoint is hit.
Ignore count Set the ignore count of watchpoint number to an
integer n. The next n times the watchpoint is reached,
program's execution does not stop; other than to
decrement the ignore count, debugger takes no action.
To make the watchpoint stop the next time it is
reached, specify a count of 0 (zero).
Chapter 4
Debugger Shell
CodeWarrior supports a command-line interface to some of its features including the debugger. You can use
the command-line interface together with TCL scripting engine. You can even issue a command that saves the
command-line activity to a log file.
The Debugger Shell view is used to issue command lines to the IDE. For example, you enter the command
debug in this window to start a debugging session. The window lists the standard output and standard error
streams of command-line activity.
Figure 166: Debugger Shell view
NOTE
Alternatively, choose Window > Show View > Other. Expand the Debug tree control in
the Show View dialog, choose Debugger Shell, and click OK.
To issue a command-line command, type the desired command at the command prompt (%>) in the Debugger
Shell view, then press the Enter key. The command-line debugger executes the specified command.
If you work with hardware as part of your project, you can use the command-line debugger to issue commands
to the debugger while the hardware is running.
NOTE
To list the commands the command-line debugger supports, type help at the command
prompt and press Enter. The help command lists each supported command along with
a brief description of each command.
TIP
To view page-wise listing of the debugger shell commands, right-click in the Debugger
Shell view and choose Paging from the shortcut menu. Alternatively, click the Enable
Paging icon.
NOTE
Press the Esc key to exit code hints and return to the debugger shell.
TIP
If you enter the abbreviated form of an IDE command name, press the spacebar instead
of the Tab key to have the IDE auto-complete the command name
4.5.1 about
Lists the version information.
Syntax
about
4.5.2 alias
Creates an alias for a debug command, removes such an alias, or lists all current aliases.
Syntax
Parameters
alias
Command Description
alias Lists current aliases.
alias ls dir Issues the dir command when ls is typed.
alias ls Removes the alias ls.
4.5.3 bp
Sets a breakpoint, removes a breakpoint, or lists the current breakpoints.
Syntax
bp
Examples
The following table lists and defines examples of the bp command.
Command Description
bp Lists all breakpoints.
bp -hw fn Sets hardware breakpoint at function fn().
bp -auto file.cpp 101 1 Sets an auto breakpoint on file file.cpp at line 101,
column 1.
bp -auto file.cpp 101 "int foo<int>()" 1 Sets an auto breakpoint on file file.cpp at line 101 on
function template instance " int foo<int>() ",
column 1.
bp fn off Removes the breakpoint at function fn().
bp 10343 Sets a breakpoint at memory address 10343.
bp #4 off Removes the breakpoint number 4.
bp #4 disable Disables the breakpoint number 4.
bp #4 ignore 3 Sets ignore count to 3 for breakpoint number 4.
bp #4 cond x == 3 Sets the condition for breakpoint number 4 to fire only
if x == 3.
bp #4.1 off Removes the breakpoint instance number 4.1.
bp #4.1 ignore 3 Sets ignore count to 3 for breakpoint instance number
4.1.
bp #4.1 cond x == 3 Sets the condition for breakpoint instance number 4.1
to fire only if x == 3.
4.5.4 cd
Changes to a different directory or lists the current directory.
Pressing the Tab key completes the directory name automatically.
Syntax
cd [<path>]
Parameter
path
Command Description
cd Displays current directory.
cd c: Changes to the C: drive root directory.
cd d:/mw/0622/ test Changes to the specified D: drive directory
cd c:p*s Changes to any C: drive directory whose name starts with p and ends with
s.
4.5.5 change
Changes the contents of register, memory location, block of registers, or memory locations.
Syntax
change <addr-spec> [<range>] [-s|-ns] [%<conv>] <value>
Parameter
The following table lists and defines parameters of the change command.
Command Description
<ms> On architectures supporting multiple memory spaces, specifies the memory space in
which <addr> is to be found. See help for the option -ms of display or mem for more
information on memory spaces. If unspecified, the setting "config MemIdentifier" is used.
Command Description
<addr> Target address in hex format.
<count> Number of memory cells.
x<cell-size> Memory is displayed in units called cells, where each cell consists of <cell-size> bytes.
If unspecified, the setting "config MemWidth" is used.
h<access-size> Memory is accessed with a hardware access size of <access-size> bytes. If unspecified,
the setting "config MemAccess" is used.
{8,16,32,64}bit Sets both <cell-size> and <access-size>.
<a1>{..<a2>|#<n>} Specifies a range of memory either by two endpoints, <a1> and <a2>, or by a startpoint
and a byte count, <a1> and <n>. This alternate syntax is provided mainly for backwards
compatibility. The new form of <addr> and <count> should be easier to use and thus
preferred.
{r|nr} If multiple registers are specified, then the prefix r: causes a recursive, depth-first
traversal of the register hierarchy. The prefix nr: prevents recursion. If unspecified,
recursion is the default. Note that different levels of the register hierarchy are
represented in the manner of a path with forward-slashes '/' used to delimit the register
groups. A name that contains a slash itself can be represented with an escape backward-
slash '\' followed by the forward-slash. Further note that a backslash in a doubly-quoted
Tcl string is itself an escape character -- in this case two backslashes are required.
Alternatively, you may use curly braces '{' and '}' to denote your string in which case just
one backslash is necessary.
<reg> A register name or a register group name.
..<reg> The end point for a range of registers to access.
<n> Number of registers.
all Specifies all registers.
v: If this option appears with no <var> following it, then all variables pertinent to the current
scope are printed.
<var> Symbolic name of the variable to print. Can be a C expression as well.
v This alternate syntax is provided mainly for backward compatibility.
-s|-ns Specifies whether each value is to be swapped. For memory, specifies whether each
cell is to be swapped. With a setting of -ns, target memory is written in order from lowest
to highest byte address. Otherwise, each cell is endian swapped. If unspecified, the
setting "config MemSwap" is used.
%<conv> Specifies the type of the data. Possible values for <conv> are given below. The default
conversion is set by the radix command for memory and registers and by the config var
command for variables.
%x Hexadecimal.
%d Signed decimal.
%u Unsigned decimal.
Command Description
%f Floating point.
%[Q<n>]F Fixed or Fractional. The range of a fixed point value depends on the (fixed) location of
the decimal point. The default location is set by the config command option
"MemFixedIntBits".
%s ASCII.
Examples
The examples assume the following settings:
• radix x
• config MemIdentifier 0
• config MemWidth 32
• config MemAccess 32
• config MemSwap off
The following table lists and defines Memory examples of the change command.
Command Description
change 10000 10 Change memory range 0x10000-3 to 0x10 (because radix is hex).
change 1:10000 20 Change memory range 0x10000-3, memory space 1, to 0x20.
change 10000 16 20 Change each of 16 cells in the memory range 0x10000-3f to 0x20.
change 10000 16x1h8 31 Change each of 16, 1-byte cells to 0x31, using a hardware access size of
8-bytes per write.
change 10000 -s %d 200 Change memory range 0x10000-3 to c8000000.
The following table lists and defines Register examples of the change command.
Command Description
change R1 123 Change register R1 to 0x123.
change R1..R5 5432 Change registers R1 through R5 to 0x5432.
change "General Purpose Change register R1 in the General Purpose Register group to
Registers/R1" 100 0x100.
The following table lists and defines Variable examples of the change command.
Command Description
change myVar 10 Change the value of variable myVar to 16 (0x10)
4.5.6 cls
Clears the command line debugger window.
Syntax
cls
4.5.7 cmdwin::ca
Manages global cache operations.
That is, they affect the operation of the entire cache. For multi-core processors, these commands operate on a
specific cache if an optional ID number is provided. If the ID number is absent, the command operates on the
cache that was assigned as the default by the last cmdwin::ca::default command. The following table
summarizes cache commands.
Command Description
cmdwin::ca::default Sets specified cache as default
cmdwin::ca::enable Enables/disables cache
cmdwin::ca::flush Flushes cache
cmdwin::ca::inval Invalidates cache
cmdwin::ca::lock Locks/Unlocks cache
cmdwin::ca::show Shows the architecture of the cache
Syntax
Parameters
<cache ID>
[on | off]
4.5.8 cmdwin::caln
Manages cache line operations.
They affect memory elements within a designated cache. The following table summarizes these commands.
Command Description
cmdwin::caln::get Displays cache line
Command Description
cmdwin::caln::flush Flushes cache line
cmdwin::caln::inval Invalidates cache line
cmdwin::caln::lock Locks/unlocks cache line
cmdwin::caln::set Writes specified data to cache line
Syntax
Parameters
<cache ID>
Optional. Specifies the cache that the command affects, otherwise it affects the default cache.
<line>
<count>
Command Description
cmdwin::caln:get 2 Displays the second cache line.
cmdwin::caln:flush 2 Flushes line 2 of the default cache.
cmdwin::caln:set 2 = 0 1 1 2 3 5 8 Sets the contents of cache line two, where the first word has a
13 value of 0, the second word has a value of 1, the third word has a
value of 1, the fourth word has a value of 2, and so on.
4.5.9 config
Configures the command window.
Syntax
config
Options
<none>
-np
Command Description
echoCmd on|off When set on, commands executed from scripts are printed. If this option
is prefixed with @ the command itself will not be printed.
h/exPrefix <prefix> Sets the string to be used as the prefix for hex values.
binPrefix <prefix> 3 Sets the string to be used as the prefix for binary values.
showCommas off | on When set on, decimal data is displayed with commas inserted every
three digits. Hex and binary data is displayed with a colon inserted every
four digits.
hexPadding on | off When set on, hex values are padded with leading zeros.
decPadding on | off When set on, decimal values are padded with leading zeros.
mem/Identifier <mem-space-id> Sets the string to be used for the main memory space prefix.
memCache off | on With memCache off, the Command Window will always read target
memory. This setting is useful if your target memory may change while
the target is paused. With memCache on, the Command Window will
cache target memory reads while your target is paused. This setting will
improve the performance of the Command Window.
memReadMax <max-bytes> Limits the amount of memory to be read in a single command. This
prevents the Command Window from locking up on abnormally large
memory read requests.
memSwap off | on When set, memory values are swapped on cell boundaries by default.
memWidth <bits> | factory Specifies the default width for display of memory data. Initially, the
default width may vary depending on the active debugger; once the user
has changed the value, the new value is used for all active debuggers.
The initial behavior can be restored with the keyword "factory".
memAccess <bits> Specifies the default hardware access size for target memory. A setting
of 0 allows the hardware access size to match the display width of the
command.
memFixedIntBits <bits> For fixed point formatting, sets the range to the specified number of bits.
For example, a value of 8 will set the range to [-2^8,2^8), or [-256,256).
Command Description
variable <sub-option> [on | off] Enables or disables certain fields in the output of the "evaluate"
command. If neither on nor off are specified, then the field is enabled.
Possible values for <sub-option> are:
• echo - the variable name
• location - the address of the variable
• size - the size of the variable is bytes
• type - the variable type
variable format <format> Controls the output format of the "evaluate" command. Possible values
for <format> are:
• - | Default
• d | Signed
• u | Unsigned
• x | h | Hex
• c | Char
• s | CString
• p | PascalString
• f | Float
• e | Enum
• i | Fixed Fract
• b | Binary Boolean SignedFixed
• o | w | Unicode
The following table lists and defines Run Control options of the config command.
Command Description
autoThreadSwitch off | interactive- Allows the user to control whether the Command Window will
only | on perform automatic thread-switching. Possible settings are
always on, always off, and on when running interactively, that
is not from a script. If enabled, automatic thread switching is
done in the following cases:
• If no thread is currently selected or if the current thread exits,
then the first one detected will become the current.
• If the current thread is running and another thread stops, then
the current thread will switch to the stopped thread.
debugTimeout <seconds> The maximum amount of time to wait for a debug command to
finish. You can also hit ESC to stop waiting.
Table 38: config Command-line debugger command - Run control options (continued)
Command Description
runControlSync off | script-only | on Sets how to synchronize run control commands. If set to "on",
then all run control commands will wait until a thread stopped
event. If set to "off", then all run control commands will return
immediately. If set to "script-only", then all run control
commands will wait while running a script but will return
immediately while running interactively.
setPCNextValidLine on | off Controls the behavior of the setpc command in the case that
the specified file line number has no source code. If set to "on",
the PC is set to the next line number containing source. If set
to "off", an error is shown.
Examples
config
Command Description
config echoCmd on If "reg D1" is a command executed from a script, the output will have on top
the command itself:
cmdwin::reg D1
+ General Purpose Registers
D1=$ffffffffff
Command Description
config var format d Set the default display format of the "evaluate" command to decimal. The
format may be one of the following strings or the corresponding character
abbreviation: Default('-'), Signed('d'), Unsigned('u'), Hex('h'|'x'), Char('c'),
CString('s'), PascalString('p'), Float('f'), Enum('e'), Fixed('i'), Fract(no abbrev),
Binary('b'), Boolean(no abbrev), SignedFixed(no abbrev), Unicode('o'|'w').
config var type off Exclude the variable type name in the output of the "evaluate" command.
config var location on Include the memory address in the output of the "evaluate" command.
config var size on Include the variable size in the output of the "evaluate" command.
The following table lists and defines Run Control examples of the config command.
Command Description
config AutoThreadSwitch If commands are being entered interactively, that is not from a
interactive-only script, automatic thread switching will be performed. If no thread is
currently selected or if the current thread exits, then the first one
detected will become the current. If the current thread is running
and another thread stops, then the current thread will switch to the
stopped thread.
config DebugTimeout 10 Wait up to 10 seconds for debug command to finish.
config RunControlSync on Run control commands will wait for thread-stopped event.
config SetPCNextValidLine on If setpc is called for a file line number with no source code, the line
number is automatically increased to the next line with source
code.
4.5.10 copy
Copies contents of a memory address or address block to another memory location.
Syntax
Parameter
<addr>
Command Description
copy 00..1f 30 Copies memory addresses 00 through 1f to address 30.
copy 20#10 50 Copies 10 memory locations beginning at memory location 20 to memory
beginning at location 50.
4.5.11 debug
Launches a debug session.
Syntax
Examples
The following table lists and defines examples of the debug command.
Command Description
debug Starts debugging using the default launch configuration, which is the last
debugged configuration if one exists and index 0 otherwise.
debug -index 3 Starts debugging using the launch configuration at index 3. Type `launch'
for the current set of launch configurations.
debug -name 3 Starts debugging using the launch configuration named `3'. Type `launch'
for the current set of launch configurations.
debug 3 Starts debugging using the launch configuration named `3'. If `3' does not
exist then launch configuration with index 3 will be launched. Type `launch'
for the current set of launch configurations.
debug {My Launch Config} Starts debugging using the launch configuration named `My Launch
Config'. Type `launch' for the current set of launch configurations.
4.5.12 dir
Lists directory contents.
Syntax
dir [path|files]
Examples
The following table lists and defines examples of the dir command.
Command Description
dir Lists all files of the current directory.
Command Description
di *.txt Lists all current-directory files that have the .txt file name extension.
dir c:/tmp Lists all files in the tmp directory on the C: drive.
dir /ad Lists only the subdirectories of the current directory.
4.5.13 disassemble
Disassembles the instructions of the specified memory block.
Syntax
disassemble
disassemble reset
disassemble [<ms>:]<a1>{..<a2>|#<n>}
Parameter
[none]
With no options, the next block of instructions is listed. After a target stop event, the next block starts at the PC.
[<ms>:]<addr>
Target address in hex. On targets with multiple memory spaces, a memory space id can be specified.
pc
Reset the next block to the PC and the instruction count to one screen.
<a1>{..<a2>|#<n>}
Specifies a range of memory either by two endpoints, <a1> and <a2> , or by a startpoint and a count, <a1> and
<n> .
Examples
The following table lists and defines examples of the disassemble command.
Command Description
disassemble Lists the next block of instructions.
disassemble reset Resets the next block to the PC and the instruction
count to one screenful.
disassemble pc Lists instructions starting at the PC.
Command Description
disassemble pc 4 Lists 4 instructions starting at the PC. Sets the
instruction count to 4.
disassemble 1000 Lists instructions starting at address 0x1000.
disassemble p:1000 4 Lists 4 instructions from memory space p, address
1000. Sets the instruction count to 4.
4.5.14 display
Lists the contents of a register or memory location.
In addition, it lists all register sets of a target; adds register sets, registers, or memory locations; or removes
register sets, registers, or memory locations.
Syntax
display <addr-spec> [<range>] [-s|-ns] [%<conv>] [-np]
display -ms
display [-]regset
Options
The following table lists and defines parameters of the display command.
Command Description
<ms> On architectures supporting multiple memory spaces,
specifies the memory space in which <addr> is to be
found. See help for the option -ms of display or mem
for more information on memory spaces. If
unspecified, the setting "config MemIdentifier" is used.
<addr> Target address in hex format.
<count> Number of memory cells.
x<cell-size> Memory is displayed in units called cells, where each
cell consists of <cell-size> bytes. If unspecified, the
setting "config MemWidth" is used.
Command Description
h<access-size> Memory is accessed with a hardware access size of
<access-size> bytes. If unspecified, the setting "config
MemAccess" is used.
{8,16,32,64}bit Sets both <cell-size> and <access-size>.
-np Don't print anything to the display, only return the data.
-ms On architectures supporting multiple memory spaces,
displays the list of available memory spaces including
a mnemonic and/or an integer index which may be
used when specifying a target address.
<a1>{..<a2>|#<n>} Specifies a range of memory either by two endpoints,
<a1> and <a2>, or by a startpoint and a byte count,
<a1> and <n>. This alternate syntax is provided mainly
for backwards compatibility. The new form of <addr>
and <count> should be easier to use and thus
preferred.
{r|nr} If multiple registers are specified, then the prefix r:
causes a recursive, depth-first traversal of the register
hierarchy. The prefix nr: prevents recursion. If
unspecified, recursion is the default. Note that different
levels of the register hierarchy are represented in the
manner of a path with forward-slashes '/' used to
delimit the register groups. A name that contains a
slash itself can be represented with an escape
backward-slash '\' followed by the forward-slash.
Further note that a backslash in a doubly-quoted Tcl
string is itself an escape character -- in this case two
backslashes are required. Alternatively, you may use
curly braces '{' and '}' to denote your string in which
case just one backslash is necessary.
<reg> A register name or a register group name.
..<reg> The end point for a range of registers to access.
<n> Number of registers.
all Specifies all registers.
-d Print detailed data book information.
-nr Print only register groups, that is no registers.
-nv Print only register groups and register names, that is
no values.
-np Don't print anything to the display, only return the data.
regset Display the register group hierarchy.
Command Description
v: If this option appears with no <var> following it, then
all variables pertinent to the current scope are printed.
<var> Symbolic name of the variable to print. Can be a C
expression as well.
-s|-ns Specifies whether each value is to be swapped. For
memory, specifies whether each cell is to be swapped.
With a setting of -ns, target memory is written in order
from lowest to highest byte address. Otherwise, each
cell is endian swapped. If unspecified, the setting
"config MemSwap" is used.
%<conv> Specifies the type of the data. Possible values for
<conv> are given below. The default conversion is set
by the radix command for memory and registers and
by the config var command for variables.
%x Hexadecimal.
%d Signed decimal.
%u Unsigned decimal.
%f Floating point.
%[Q<n>]F Fixed or Fractional. The range of a fixed point value
depends on the (fixed) location of the decimal point.
The default location is set by the config command
option "MemFixedIntBits".
%s ASCII.
Examples
The examples assume the following settings:
• radix x
• config MemIdentifier 0
• config MemWidth 32
• config MemAccess 32
• config MemSwap off
The following table lists and defines examples of the display command.
Command Description
display 10000 Displays memory range 0x10000-3 as one cell.
display 1:10000 Displays memory range 0x10000-3, memory space 1,
as one cell.
Command Description
display 10000 16 Displays memory range 0x10000-3f as 16 cells.
display 10000 16x1h8 Displays 16, 1-byte cells, with a hardware access size
of 8-bytes per read.
display 10000 8bit Displays one byte, with a hardware access size of one
byte.
display 10000 -np Returns one cell, but don't print it to the Command
Window.
display 10000 -s Displays one cell with the data endian-swapped.
display 10000 %d Displays one cell in decimal format.
display -ms Displays the available memory spaces, if any.
display -regset Lists all the available register sets on the target chip.
display R1 Displays the value of register R1.
display "General Purpose Registers/R1" Displays the value of register R1 in the General
Purpose Register group.
display R1 -d Displays detailed "data book" contents of R1, including
bitfields and definitions.
display "nr:General Purpose Registers/R1" Beginning with register R1, display the next 25
25 registers. Register groups are not recursively
searched.
display myVar -s %d Displays the endian-swapped contents of variable
myVar in decimal.
4.5.15 evaluate
Displays variable or expression.
Syntax
Parameter
<format>
#p, #PascalString
#f, #Float
#e, #Enum
#i, #Fixed
#o, #w, #Unicode
#b, #Binary
<none>, #Fract
<none>, #Boolean
<none>, #SignedFixed
Examples
The following table lists and defines examples of the evaluate command.
Command Description
evaluate Lists the types for all the variables in current and global
stack.
evaluate i Returns the value of variable 'i'
evaluate #b i Returns the value of variable 'i' formatted in binary
evaluate -l 10 Returns the address for line 10 in the current file
evaluate -l myfile.c,10 Returns the address for line 10 in file myfile.c
evaluate -l +10 Returns the address to an offset of 10 lines starting
from the current line
evaluate -l myfile.c:mysymbol Returns the address of the symbol 'mysymbol' defined
in file 'myfile.c'.
evaluate -l mysymbol Returns the address of the global symbol 'mysymbol'.
evaluate -l mysymbol +10 Returns the address of the 10'th line belonging to the
global symbol 'mysymbol'.
evaluate -l myfile.c:mysymbol Returns the address of the local symbol 'mysymbol'
defined in the file 'myfile.c'.
evaluate -l myfile.c:mysymbol 10 Returns the address of the 10'th line belonging to the
local symbol.
4.5.16 finish
Executes until the current function returns.
Syntax
finish
4.5.17 fl::blankcheck
Tests that the flash device is in the blank state.
Syntax
Parameters
all
list
Check that specific sectors are in the blank state. The sector list is set with the "device" command.
Examples
The following table lists and defines examples of the fl::blankcheck command.
Command Description
blankcheck all Tests if the flash device is in the blank state. All sectors
will be tested regardless of the enabled list maintained
by the "device" command.
blankcheck list Tests whether the sectors in the enabled list are in the
blank state.
4.5.18 fl::checksum
Calculates a checksum.
Syntax
Options
The following table lists and defines options of the fl::checksum command.
Command Description
<none> When no options are specified, calculate the
checksum for the target memory contents
corresponding to the settings of the fl::image
command. The target is defined by the fl::target
command.
-host Calculates the checksum for the host image file
contents corresponding to the settings of the fl::image
command.
Command Description
-range <addr> <size> Calculate the checksum for the target
memory contents specified by a beginning address
<addr> and number of bytes <size>, both given in hex.
The target is defined by the fl::target command.
-dev Calculates the checksum for the entire flash contents.
The flash is defined by the fl::device command. The
target is defined by the fl::target command.
Examples
checksum
Calculates a checksum.
4.5.19 fl::device
Defines the flash device.
Syntax
device
device ls
Options
The following table lists and defines options of the fl::device command.
Command Description
<none> With no options, lists the current settings.
<setting> Used to set a configuration setting. Possible values
are: -d <dev>, -o <org>, -a <addr> [<end>] ,
-se all | <index> ... , -sd all |
<index> ...
Command Description
-a <addr> [<end>] Sets the start <addr> and optional end <end> address
for the device, both given in hex.
-se all | <index> ... Enable sectors for "erase" and "blankcheck". Sectors
are specified with a zero-based index.
-sd all | <index> ... Disables sectors for "erase" and "blankcheck". Sectors
are specified with a zero-based index.
ls Lists all the supported devices.
ls org [<dev>] Lists the organizations for a particular device. The
device may be specified with <dev>, otherwise the
current device is used.
ls sect [[<dev>] <org>] Lists the sectors for a particular device and
organization. The organization may be specified with
<org>, otherwise the current device and organization
is used. If <org> is specified, the device may be
specified with <dev>, otherwise the current device is
used. If <dev> is specified, then 0 is used for the
starting address; otherwise, the current device start
address is used.
Examples
device
4.5.20 fl::diagnose
Dumps flash information.
Syntax
diagnose [full]
Options
full
Also dump sector status (programmed/erased). This could take a few minutes for large flashes.
Examples
The following table lists and defines examples of the fl::diagnose command.
Command Description
diagnose Dumps flash information like ID, sector map, sector
factory protect status. fl::device command needs
to be called prior to this command in order to set the
device.
4.5.21 fl::disconnect
Closes the connection to the target.
Syntax
disconnect
Examples
disconnect
Closes the connection to the target. The first flash command that needs to access the target opens a connection
to the target that remains open for further flash operations.
4.5.22 fl::dump
Dumps the content of entire flash to the specified file.
Syntax
Parameter
-all
-t <type>
-o <file>
Dumps all flash or flash region from <start_addr> to <end_addr> to the file specified with -o argument.
4.5.23 fl::erase
Erases the flash device.
Syntax
Parameters
all
list
image
Command Description
erase all Erases the device using the all-chip erase operation.
This is not supported by all flash devices. All sectors
will be erased regardless of the enabled list maintained
by the "device" command. Erase the device one sector
at a time. All sectors will be erased regardless of the
enabled list maintained by the "device" command.
erase list Erases the sectors in enabled list.
erase image Erases the sectors occupied by the file defined with
fl::image.
4.5.24 fl::image
Defines the flash image settings.
Syntax
image
image ls
Options
The following table lists and defines options of the fl::image command.
Command Description
<none> With no options, lists the current settings.
<setting> Used to set a configuration setting. Possible values
are: -f <file>, -t <type>, -re on|off, -r
<addr> [<end>], -oe on|off, -o <offset>
Examples
image
4.5.25 fl::protect
Protects the sectors.
Syntax
Parameter
[on | off]
4.5.26 fl::secure
Secures/unsecures the device.
Syntax
Parameter
[on | off]
password <pass>
4.5.27 fl::target
Defines the target configuration settings.
Syntax
target
target ls [p|c]
Options
The following table lists and defines options of the fl::target command.
Command Description
<none> With no options, lists the current settings.
<setting> Used to set a configuration setting. Possible values are:
-c <conn>, -p <proc>, -ie on|off , -i <initfile>, -b
<addr> [<size>] , -v on|off , -l on|off
-lc <launch configuration name> Sets the launch configuration that will be used.
-c <conn> Sets the connection to <conn> .
-p <proc> Sets the processor to <proc> .
-ie on|off Enables or disables the initfile set by -i.
-i <initfile> Sets the target initialization file to <initfile> . Only used if -ie is on.
-b <addr> [<size>] Sets the target RAM buffer for downloading image data to begin at
<addr> with <size> bytes, both given in hex.
Examples
target
4.5.28 fl::verify
Verifies the flash device.
Syntax
verify
4.5.29 fl::write
Writes the flash device.
Syntax
write
4.5.30 funcs
Displays information about functions.
Syntax
Parameter
[-all]
<file>
<line>
4.5.31 getpid
Lists the ID of the process being debugged.
Syntax
getpid
4.5.32 go
Starts to debug your program from the current instruction.
Syntax
go [nowait | <timeout_s>]
Parameter
<none>
Runs the default thread. The command may wait for a thread break event before returning, depending on the
settings config runControlSync and config autoThreadSwitch.
nowait
<timeout_s>
Maximum number of seconds to wait for a thread break event. Can be set to nowait .
Examples
The following table lists and defines examples of the go command.
Command Description
go Runs the default thread.
go nowait Runs the default thread without waiting for a thread
break event.
go 5 Runs the default thread. If config runControlSync is
enabled, then the command will wait for a thread break
event for a maximum of 5 seconds.
4.5.33 help
Lists debug command help in the command-line debugger window.
Syntax
Parameter
command
Command Description
help Lists all debug commands.
help b Lists help information for the break command.
4.5.34 history
Lists the history of the commands entered during the current debug session.
Syntax
history
4.5.35 jtagclock
Reads or updates the current JTAG clock speed.
Syntax
jtagclock
Examples
The following table lists and defines examples of the jtagclock command.
Command Description
jtagclock 3 Reads the current jtag clock speed for chain position
3.
jtagclock 3 1000 Updates the jtag clock speed to 1000kHz for chain
position 3.
4.5.36 kill
Closes the specified debug session.
Syntax
Examples
The following table lists and defines examples of the kill command.
Command Description
kill Kills the debug session for the current process.
kill all Kills all active debug sessions.
kill 0 1 Kills debug sessions 0 and 1.
4.5.37 launch
Lists the launch configurations.
Syntax
launch
Examples
launch
List the launch configurations. The last debugged configuration is denoted with an asterisk '*', last run with a
greater than '>'.
4.5.38 linux::displaylinuxlist
Lists the expression for each element of a Linux list.
Syntax
Options
The following table lists and defines options of the linux::displaylinuxlist command.
Command Description
-l[ist] <listName> The name of the list (must be global).
-f[unction] Some function where the list is visible, optional.
<functionWhereListIsVisible>
-a[ddress] <listAddress> The address of the list, in hexa, only in case when
(listName,functionWhereListIsVisible) are not specified, to be
used with local lists.
-t[ype] <elementTypeName> The type of the list elements.
-n[ext] <nextPath> Specifies in order all the structure member names needed to
reach the next element.
Examples
The following table lists and defines examples of the linux::displaylinuxlist command.
Command Description
linux::displaylinuxlist -list workqueues - Lists the current workqueues.
function __create_workqueue -type
workqueue_struct -next list next
Command Description
linux::displaylinuxlist -address 0xC00703fc Lists the current workqueues, 0xC00703fc should be
-type workqueue_struct -next list next the address of workqueues. Available only if the kernel
is stopped.
4.5.39 linux::loadsymbolics
Loads the symbolics for the selected module.
Syntax
loadsymbolics <absolute_file_path>
4.5.40 linux::refreshmodules
Lists loaded modules.
Syntax
refreshmodules
4.5.41 linux::selectmodule
Sets the current module.
Syntax
selectmodules <index>
4.5.42 linux::unloadsymbolics
Unloads the symbolics for the specified module.
Syntax
unloadsymbolics
4.5.43 loadsym
Loads a symbolic file.
Syntax
Examples
The following table lists and defines examples of the loadsym command.
Command Description
loadsym myapp.elf Loads the debug information in myapp.elf into the debugger.
loadsym mypicapp.elf 0x40000 Loads the debug information in mypicapp.elf into the debugger;
symbolics addresses are adjusted based on the alternate load
address of 0x40000.
4.5.44 log
Logs the commands or lists entries of a debug session.
If issued with no parameters, the command lists all open log files.
Syntax
log c|s <filename>
log
Parameter
Command specifier.
<filename>
Command Description
log Lists currently opened log files.
log s session.log Logs all display entries to file session.log.
log off c Closes current command log file.
log off Closes current command and log file.
log off all Closes all log files.
4.5.45 mc::config
Displays or edits multicore groups options.
Syntax
Examples
The following table lists and defines examples of the mc::config command.
Command Description
mc::config Shows the current configuration settings.
mc::config useAllCores disable Disables Use All Cores mode.
mc::config haltGroups enable Enables halt groups (where supported)
mc::config smartSelect disable Disables smart select mode so that the mc::group enable|disable
commands behave analagously to pressing Ctrl+Click on a Multicore
Groups Dialog group node. Note : This setting does not affect the
Multicore Groups dialog operation.
4.5.46 mc::go
Resumes multiple cores.
Syntax
mc::go
Remarks
mc::go resumes the selected cores associated with the current thread context (see switchtarget on page
293).
4.5.47 mc::group
Displays or edits multicore groups.
Syntax
group
group removeall
Examples
The following table lists and defines examples of the mc::group command.
Command Description
mc::group Shows the defined groups, including indices for use in
the mc::group rename|enable|remove set of
commands.
mc::group new 8572 Creates a new group for target type 8572. The group
name will be based on the target name and will be
unique. The enablement of the group elements will be
all non-cores enabled, all cores disabled.
mc::group rename 0 "My Group Name" Renames the group at index 0 to "My Group Name".
mc::group enable 0 1.0 Enables the group at index 0 and the element at index
1.0 of the mc::group command.
mc::group enable -context swbps hwbps 0 Enables the group contexts for software and hardware
breakpoints at index 0 of the mc::group command.
Note, the index must correspond to a group, not a
specific core.
mc::group remove "My Group Name" Removes the group named "My Group Name".
mc::group removeall Removes all groups.
4.5.48 mc::kill
Terminates multiple cores.
Syntax
mc::kill
Remarks
mc::kill terminates the debug session for the selected cores associated with the current thread context (see
switchtarget on page 293).
4.5.49 mc::reset
Resets multiple cores.
Syntax
mc::reset
Remarks
mc::reset resets the debug session associated with the current thread context (see switchtarget on page
293).
4.5.50 mc::restart
Restarts multiple cores.
Syntax
mc::restart
Remarks
mc::restart restarts the debug session for the selected cores associated with the current thread context (see
switchtarget on page 293).
4.5.51 mc::stop
Suspends multiple cores.
Syntax
mc::stop
Remarks
mc::stop stops the selected cores associated with the current thread context (see switchtarget on page 293).
4.5.52 mc::type
Displays or edits target types.
SYNTAX
type
ype removeall
Examples
The following table lists and defines examples of the mc::type command.
Command Description
mc::type Shows the target types available for multicore
debugging as well as type indices for use by the
mc::type remove and mc::group new commands.
mc::type import 8572_jtag.txt Creates a new type from the JTAG configuration file.
mc::type remove 8572_jtag.txt Removes the type imported from the specified file.
mc::group removeall Removes all imported types.
4.5.53 mem
Reads and writes memory.
Syntax
mem
mem -ms
Overview
The mem command reads or writes one or more adjacent "cells" of memory, where a cell is defined as a
contiguous block of bytes. The cell size is determined by the <cell-size> parameter or by the config command
option "MemWidth".
Options
The following table lists and defines options of the mem command.
Command Description
[none] With no option, next block of memory is read.
<ms> On architectures supporting multiple memory spaces, specifies the memory
space in which <addr> is to be found. See the help for the option -ms of display
or mem for more information on memory spaces. If unspecified, the setting
"config MemIdentifier" is used.
Command Description
%<conv> Specifies the type of the data. Possible values for <conv> are given below. The
default conversion is set by the radix command for memory and registers and
by the config var command for variables.
%x Hexadecimal.
%d Signed decimal.
%u Unsigned decimal.
%f Floating point.
%[Q<n>]F Fixed or Fractional. The range of a fixed point value depends on the (fixed)
location of the decimal point. The default location is set by the config command
option "MemFixedIntBits" .
%s ASCII.
Examples
The examples assume the following settings:
• radix x
• config MemIdentifier 0
• config MemWidth 32
• config MemAccess 32
• config MemSwap off
The following table lists and defines examples of the mem command.
Command Description
mem Displays the next block of memory.
mem 10000 Changes memory range 0x10000-3 as one cell.
mem 1:10000 Changes memory range 0x10000-3, memory space 1, as one cell.
mem 10000 16 Displays memory range 0x10000-3f as 16 cells.
mem 10000 16x1h8 Displays 16, 1-byte cells, with a hardware access size of 8-bytes per
read.
mem 10000 8bit Displays one byte, with a hardware access size of one byte.
mem 10000 -np Returns one cell, but don't print it to the Command Window.
mem 10000 -s Displays one byte with the data endian-swapped.
mem 10000 %d Displays one cell in decimal format.
mem -ms Displays the available memory spaces, if any.
mem 10000 =10 Changes memory range 0x10000-3 to 0x10 (because radix is hex).
Command Description
mem 1:10000 =20 Changes memory range 0x10000-3 , memory space 1, to 0x20 .
mem 10000 16x1h8 =31 Changes each of 16, 1-byte cells to 0x31 , using a hardware access
size of 8-bytes per write.
mem 10000 -s %d =200 Changes memory range 0x10000-3 to c8000000.
4.5.54 next
Runs to next source line or assembly instruction in current frame.
Syntax
next
Remarks
If you execute the next command interactively, the command returns immediately, and target-program execution
starts. Then you can wait for execution to stop (for example, due to a breakpoint) or type the stop command.
If you execute the next command in a script, the command-line debugger polls until the debugger stops (for
example, due to a breakpoint). Then the command line debugger executes the next command in the script. If
this polling continues indefinitely because debugging does not stop, press the ESC key to stop the script.
4.5.55 nexti
Executes over function calls, if any, to the next assembly instruction.
Syntax
nexti
Remarks
If you execute nexti command, it will execute the thread to the next assembly instruction unless current instruction
is a function call. In such a case, the thread is executed until the function returns.
4.5.56 oneframe
Queries or sets the one-frame stack crawl mode for the current thread.
Syntax
Examples
The following table lists and defines examples of the oneframe command.
Command Description
oneframe on Tells the debugger to only query and show one frame
in stack crawls.
oneframe off Turns off one-frame mode.
oneframe Reveals if one-frame mode is on or off.
4.5.57 pwd
Lists current working directory.
Syntax
pwd
4.5.58 quitIDE
Quits the IDE.
Syntax
quitIDE
4.5.59 radix
Lists or changes the default input radix (number base) for command entries, registers and memory locations.
Entering this command without any parameter values lists the current default radix.
Syntax
radix [x|d|u|b|f|h]
Parameter
Hexadecimal
Decimal
Unsigned decimal
Binary
Fractional
Hexadecimal
Examples
The following table lists and defines examples of the radix command.
Command Description
radix Lists the current setting.
radix d Changes the setting to decimal.
radix x Changes the setting to hexadecimal.
4.5.60 redirect
Redirects I/O streams of the current target process.
Syntax
Options
The following table lists and defines options of the red command.
Command Description
<stream> stdout | stderr | both
<destination> stop | server <port> | socket [<host>] <port>
<port> TCP/IP port number of destination socket.
<host> IP4 address or IP6 address or hostname of target system. Assumed to be
"localhost" if omitted.
stop Ends redirection for the specified stream(s).
server Attempts to establish a server socket on the specified port. Client sockets
may connect to this server socket and read the redirected data. Data written
by the target while no client is connected is discarded.
socket Attempts to connect to the specified server socket. All target output data is
written to this connection.
Examples
The following table lists and defines examples of the red command.
Command Description
redirect stdout server 27018 Redirects output of stdout for the current process to a server
socket on local port 27018.
redirect stderr socket logmachine.com Attempts to connect to the server socket at port 22018 on host
22018 "logmachine.com" and redirects output of stderr for the current
process to that connection.
redirect both stop Ends redirection (if any) currently in place for both stdout and
stderr for the current process.
4.5.61 refresh
Discards all cached target data and refresh views.
Syntax
Options
The following table lists and defines options of the refresh command.
Command Description
[none] No option will refresh current process only.
all Refreshes all currently debugged processes.
-p <+pid> Specifies list of process ID for the processes to be
refreshed.
Examples
refresh -p 0 1
Refreshes debugger data for debugged processes with PID `0' and `1'.
4.5.62 reg
Reads and writes registers.
Syntax
reg export <reg-spec> [<n>] <file>
reg -regset
reg
Options
The following table lists and defines options of the reg command.
Command Description
export Exports all or a set (specified through <reg-spec>
[<n>]) of registers into a specified file. The traversal of
the register hierarchy is recursive. Existing files are
overwritten.
import Imports registers from a specified file.
[none] No option is equivalent to reg -regset .
<reg-spec> [{r|nr}:]<reg> {r|nr} If multiple registers are specified, then the prefix r:
causes a recursive, depth-first traversal of the register
hierarchy. The prefix nr: prevents recursion. If
unspecified, recursion is the default. Note that different
levels of the register hierarchy are represented in the
manner of a path with forward-slashes '/' used to
delimit the register groups. A name that contains a
slash itself can be represented with an escape
backward-slash '\' followed by the forward-slash.
Further note that a backslash in a doubly-quoted Tcl
string is itself an escape character -- in this case two
backslashes are required. Alternatively, you may use
curly braces '{' and '}' to denote your string in which
case just one backslash is necessary.
<reg> A register name or a register group name.
..<reg> The end point for a range of registers to access.
<n> Number of registers.
all Specifies all registers.
-d Print detailed data book information.
-nr Print only register group, that is no registers.
-nv Print only register groups and register names, that is
no values.
-np Do not print anything to the display, only return the
data.
regset Display the register group hierarchy.
Command Description
-s| -ns Specifies whether each value is to be swapped. For
memory, specifies whether each cell is to be swapped.
With a setting of -ns, target memory is written in order
from lowest to highest byte address. Otherwise, each
cell is endian swapped. If unspecified, the setting
"config MemSwap" is used.
%<conv> Specifies the type of the data. Possible values for
<conv> are given below. The default conversion is set
by the radix command for memory and registers and
by the config var command for variables.
%x Hexadecimal
%d Signed decimal.
%u Unsigned decimal.
%f Floating point.
%[Q<n>]F Fixed or fractional. The range of a fixed point value
depends on the (fixed) location of the decimal point.
The default location is set by the config command
option MemFixedIntBits .
%s ASCII
Examples
The following table lists and defines examples of the reg command.
Command Description
reg -regset Lists all the available register sets on the target chip.
reg R1 Displays the value of register R1.
reg "General Purpose Registers/R1" Displays value of register R1 in the General Purpose
Register group.
reg R1 -d Displays detailed "data book" contents of R1, including
bitfields and definitions.
reg "nr:General Purpose Registers/R1" 25 Beginning with register R1, display the next 25
registers. Register groups are not recursively
searched.
reg R1 =123 Changes register R1 to 0x123 .
reg R1..R5 =5432 Changes registers R1 through R5 to 0x5432 .
reg "General Purpose Registers/R1" =100 Changes register R1 in the General Purpose Register
group to 0x100 .
Command Description
reg export filename Exports all registers from the target to the specified file.
reg export R1 filename Exports the value of register R1 to the specified file.
reg export "General Purpose Registers/R1" 25 Beginning with register R1, export the next 25 registers
filename to the specified file.
reg import filename Imports registers from the specified file.
4.5.63 reset
Resets the target hardware.
Syntax
Options
h/ard|s/oft
The type of reset, either hard or soft. If unspecified, the default depends on the hardware support. If soft is
supported, then that is the default. Otherwise, if hard is supported, then that is the default.
run
Let's the target run after the reset, also called "reset to user". Otherwise, the target is halted at the reset vector.
Examples
The following table lists and defines examples of the reset command.
Command Description
reset Issues a soft reset if supported, otherwise a hard reset.
reset s Issues a soft reset.
reset hard Issues a hard reset.
reset run Issues a soft reset if supported, otherwise a hard reset. The target is
allowed to run after the reset.
4.5.64 restart
Restarts the current debug session.
Syntax
restart
Examples
restart
4.5.65 restore
Writes file contents to memory.
Syntax
Options
The following table lists and defines options of the restore command.
Command Description
-h|-b Specifies the input file format as hex or binary.
[<ms>:]<addr> Address to load to. For hex format, this selection
overrides the address specified in the file. For
architectures with multiple memory spaces, a memory
space id may be specified. See config MemIdentifier
and mem -ms for more details.
<offset> Loads the contents of the hex file at an offset of the
original location.
8bit|16bit|32bit|64bit Controls the memory access size.
Examples
The following table lists and defines examples of the restore command.
Command Description
restore -h dat.txt Loads the contents of the hex file dat.txt into memory.
restore -b dat.bin 0x20 Loads the contents of binary file dat.bin into memory
beginning at 0x20.
restore -h dat.bin +0x20 Loads the contents of the binary file dat.lod into
memory with an offset of 0x20 relative to the address
saved in dat.bin.
4.5.66 run
Launches a process.
Syntax
Examples
The following table lists and defines examples of the run command.
Command Description
run Starts a process using the default launch
configuration, which is the last run configuration if one
exists and index 0 otherwise.
run -index 3 Starts a process using the launch configuration at
index 3. Type 'launch' for the current set of launch
configurations.
run -name 3 Starts a process using the launch configuration named
'3'. Type 'launch' for the current set of launch
configurations.
run 3 Starts a process using the launch configuration named
'3'. If '3' does not exist then configuration with index 3
will be started. Type 'launch' for the current set of
launch configurations.
run {My Launch Config} Starts debugging using the launch configuration
named 'My Launch Config' . Type 'launch' for the
current set of launch configurations.
4.5.67 save
Saves the contents of memory locations to a binary file or a text file containing hexadecimal values.
Syntax
Parameter
-h|-b
Sets the output file format to hex or binary. For hex format, the address is also saved so that the contents can
easily be restored with the restore command.
[<ms>:]<addr>
Address to read from. For architectures with multiple memory spaces, a memory space id may be specified.
-a
Append specifier. Instructs the command-line debugger to append the saved memory contents to the current
contents of the specified file.
-o
Overwrite specifier. Tells the debugger to overwrite any existing contents of the specified file.
8bit|16bit|32bit|64bit
Command Description
set addressBlock1 "p:10..`31" set Dumps contents of two memory blocks to the text file
addressBlock2 "p:10000#20" save -h hexfile.txt (in append mode).
$addressBlock1 $addressBlock2 hexfile.txt -
a
set addressBlock1 "p:10..`31" set Dumps contents of two memory blocks to the binary
addressBlock2 "p:10000#20" save -b file binfile.bin (in overwrite mode).
$addressBlock1 $addressBlock2 binfile.bin -
o
4.5.68 setpc
Sets the value of the program counter register.
Syntax
Examples
The following table lists and defines examples of the setpc command.
Command Description
setpc -address 0x1000 Sets the PC to address 0x1000.
setpc -line 10 Sets the PC to source line 10 in the current source file.
setpc -line 10 myfile.c Sets the PC to source line 10 in source file 'myfile.c'.
setpc -line +10 Sets the PC to an offset of 10 lines from the current source line.
setpc -gsymbol my_extern_function Sets the PC to the address of the 'my_extern_function' global
symbol.
setpc -lsymbol my_static_function Sets the PC to the address of the 'my_static_function' local
myfile.c symbol defined in source file 'myfile.c'.
setpc -line +10 my_extern_function Sets the PC to the address corresponding to an offset of 10
source lines from the location where 'my_extern_function' global
symbol was defined.
setpc -line +10 my_static_function Sets the PC to the address corresponding to an offset of 10
myfile.c source lines from the location where 'my_static_function' local
symbol was defined, in source file 'myfile.c'.
setpc -line 10 myfile.c mymodule.ko Sets the PC to source line 10 in source file 'myfile.c'. The file
'myfile.c' is used by the target 'mymodule.ko'.
4.5.69 setpicloadaddr
Indicates where a PIC executable is loaded.
Syntax
Examples
The following table lists and defines examples of the setpicloadaddr command.
Command Description
setpicloadaddr 0x40000 Tells the debugger the main executable is loaded at
0x40000.
setpicloadaddr myapp.elf 0x40000 Tells the debugger myapp.elf is loaded at 0x40000.
setpicloadaddr myapp.elf reset Tells the debugger myapp.elf is loaded at the address
set in the ELF.
4.5.70 stack
Prints the call stack.
Syntax
Examples
The following table lists and defines examples of the stack command.
Command Description
stack Prints the entire call stack unless limited with stack -
default.
stack 6 Prints the 6 innermost call stack levels.
stack -6 Prints the 6 outermost call stack levels.
stack 6 -default Limits the number of stack frames shown to the 6
innermost levels.
stack -default Removes the stack frame limit.
4.5.71 status
Lists the debug status of all existing active targets.
Syntax
status
4.5.72 step
Steps through a program, automatically executing the display command.
Syntax
step [nve|nxt|fwd|end|aft]
Parameter
asm|src
Controls whether the step is performed at the assembly instruction level or the source code level.
into|over|out
nve
nxt
fwd
end
aft
Command Description
step Steps into the current source or assembly line.
step over Steps over the current source or assembly line.
step out Steps out of a function.
step asm Steps over a single assembly instruction.
4.5.73 stepi
Executes to the next assembly instruction.
Syntax
stepi
4.5.74 stop
Stops a running program (started by a go, step, or next command).
Syntax
stop
Examples
The following table lists and defines examples of the stop command.
Command Description
stop Using it after command go/step out/next, this will stop
the target program.
4.5.75 switchtarget
Displays information about debugged threads, processes and connections or changes the debug context for
subsequent commands.
Syntax
Parameter
index
Command Description
switchtarget Lists currently available debug sessions.
switchtarget 0 Selects the thread with index 0
switchtarget -cur Lists the index of the current thread.
switchtarget -ResetIndex Resets the index counter to 0, not valid while debugging.
switchtarget -tid Lists the thread IDs of the current process of the current connection.
switchtarget -pid Lists the process IDs of the debugged processes of the current
connection.
switchtarget -pid -arch=EPPC Lists the process IDs of the debugged processes of EPPC
architecture on the current debug system.
switchtarget -pid -conn=Launch-1 Lists the process IDs of the debugged processes of the Launch-1
connection.
switchtarget -arch -conn=Launch-1 Lists the architectures debugged on Launch-1 connection.
switchtarget -conn -arch=EPPC Lists the name of the connection of EPPC architecture on the
current debug system.
Command Description
switchtarget -pid=0 -tid=0 - Switches current context to thread 0 of process 0 of EPPC
arch=EPPC architecture on the current debug system.
switchtarget -pid=0 -tid=0 - Switches current context to thread 0 of process 0 on Launch-1
conn=Launch-1 connection.
4.5.76 system
Executes system command.
Syntax
system [command]
Parameter
command
Any system command that does not use a full screen display.
Examples
The following table lists and defines examples of the system command.
Command Description
system del *.tmp Deletes from the current directory all files that have the .tmp filename
extension.
4.5.77 var
Reads and writes variables or C-expressions.
Syntax
var
Options
The following table lists and defines options of the var command.
Command Description
[none] No option is equivalent to "var v:".
v: If this option appears with no <var> following it, then all variables pertinent to the
current scope are printed.
<var> Symbolic name of the variable to print. Can be a C expression as well.
-np Don't print anything to the display, only return the data.
-s|-ns Specifies whether each value is to be swapped. For memory, specifies whether each
cell is to be swapped. With a setting of -ns, target memory is written in order from
lowest to highest byte address. Otherwise, each cell is endian swapped. If unspecified,
the setting "config MemSwap" is used.
%<conv> Specifies the type of the data. Possible values for <conv> are given below. The default
conversion is set by the radix command for memory and registers and by the config
var command for variables.
%x Hexadecimal.
%d Signed decimal.
%u Unsigned decimal.
%f Floating point.
%[Q<n>]F Fixed or Fractional. The range of a fixed point value depends on the (fixed) location
of the decimal point. The default location is set by the config command option
"MemFixedIntBits".
%s ASCII.
Examples
The following table lists and defines examples of the var command.
Command Description
var myVar -s %d Displays the endian-swapped contents of variable myVar in decimal.
var myVar =10 Changes the value of variable myVar to 16 (0x10).
4.5.78 wait
Tells the debugger to wait for a specified amount of time, or until you press the space bar.
Syntax
wait <time-ms>
Parameter
time-ms
Examples
The following table lists and defines examples of the wait command.
Command Description
wait Debugger waits until you press the space bar.
wait 2000 Wait for 2 seconds.
4.5.79 watchpoint
Sets, removes, disables, enables or list watchpoints.
You can also set condition on watchpoint.
Syntax
watchpoint
Examples
The following table lists and defines examples of the watchpoint command.
Command Description
watchpoint Displays all watchpoints.
watchpoint gData Sets read-write (the default) watchpoint on variable gData.
watchpoint -r gData Sets read-only watchpoint on variable gData.
watchpoint all off Removes all watchpoints.
watchpoint #4 disable Disables watchpoint number 4.
watchpoint 10343 4 Sets a watchpoint at memory address 10343 of length 4.
watchpoint #4 ignore 3 Sets ignore count to 3 for watchpoint number 4.
watchpoint #4 cond x == 3 Sets the condition for watchpoint number 4 to fire only if x == 3.
watchpoint #4 type -rw Sets the access type read/write for watchpoint number 4.
watchpoint #4 size 8 Sets the size to 8 units for watchpoint number 4.
Chapter 5
Debugger Script Migration
This chapter describes the migration from the Command window of the CodeWarrior Classic IDE to the debugger
shell of the CodeWarrior Eclipse IDE. The Debugger Shell of the CodeWarrior Eclipse IDE uses the same
TclScript scripting engine as the Command Window with some notable exceptions and changes, as follows:
• new command line syntax for launching the CodeWarrior Eclipse IDE
• removal of the build commands
• removal of the display commands, which are replaced by GUI preferences
• improved step command syntax
• new commands for starting a debug session
This chapter explains:
• Command-line syntax on page 297
• Launching debug session on page 297
• Stepping on page 299
• Settings of config command on page 300
NOTE
Users familiar with the -vmargs option in the CodeWarrior Eclipse IDE should note that
CodeWarrior will not work properly if -vmargs is used. Use the custom -vmargsplus
option in place of the -vmargs option.
NOTE
The debug command in the CodeWarrior Eclipse IDE also replaces the attach and
connect commands, which have been removed in the CodeWarrior Eclipse IDE.
The help launch, help debug, and help run commands display the help details of the respective commands, as
shown in Figure 170. help command on page 299.
5.3 Stepping
Use stepi and nexti commands at assembly instruction level in CodeWarrior.
In the CodeWarrior Classic IDE, the cmdwin::step command uses the Thread window source view mode to
determine if the step is performed at the assembly instruction level or at the source instruction level. The
CodeWarrior Eclipse IDE does not support the view mode concept. Use the new commands, stepi and
nexti, at the assembly instructional level. The stepi command executes to the next assembly instruction, and
the nexti command executes to the next assembly instruction unless the current instruction is a function call.
In addition, the syntax of the step commands has been redesigned to match the expected behavior. The step
command in the CodeWarrior Classic IDE is used to step over a source line. However, in the CodeWarrior
Eclipse IDE, the step or step in command means `step into', which is used to step into a source line and the next
command means `step over'. The step li command has been removed. A new command, finish has been added
for stepping out of a function.
NOTE
For backwards compatibility, you can enable the original CodeWarrior Classic IDE
syntax by setting the environment variable, FREESCALE_CMDWIN_CLASSIC_STEP.
Command Description
config c Sets the syntax coloring
config o Aborts a script
config page Controls the paging behavior
config s Sets the page size
config project Accesses the build projects
config target Accesses the build targets
The remaining config command settings work the same as in the CodeWarrior Classic IDE.
Index
A cls 249
cmdwin::ca 249
about 244
cmdwin::caln 249
About debugger 92
Code hints 241
Action Type 140
CodeWarrior debugger settings 116
Active configuration 16
CodeWarrior IDE advantages 13
Add flash device 130
CodeWarrior IDE overview 12
Add Flash Programmer Actions 131
CodeWarrior Projects view 16
Add macro 53
Column headers 18
Adding breakpoint action 107
Command line interface 21
Adding global variables 229
Command-Line debugger shell 242
Adding memory monitor 160
Command-line syntax 297
Adding memory renderings 162
Commander view 27
Adding path mapping to workspace 200
Concurrent compilation 30
Adding variable location to view 227
config 250
Address 143
config settings 300
Address lines 144
Configure flash programmer target task 130
alias 244
Console view 32, 119
Apply to Connection 71
copy 254
Apply to Project 70
Core index indicators in homogeneous multicore
Attaching breakpoint actions to breakpoints 108
environment 118
Auto-completion 241
Create a flash programmer target task 128
Automatic Linking with referenced project build artifact 58
Create a Referenced project 55
Automatic path mappings 195
Creating hardware diagnostics task 139
Automatic project remote system setting cache 72
Creating hardware or simulator connection configuration 62
Automatic removal of unreferenced remote system 71
Creating hardware or simulator target configuration 63
Creating launch group 153
B Creating MMU configuration 168
bp 245 Creating multicore group 185
Breakpoint actions 105 Creating remote system 59
Breakpoint Actions preferences page 106 Creating task for import/export/fill memory 146
Breakpoint annotations 94 Creating TRK target configuration 67
Breakpoint Persistence 97 Creating watchpoint 233
Breakpoint preferences 97 Customizing Commander view 29
Breakpoints 92 Customizing Register Details Pane 213
Breakpoints view 93 cwide-env file 88
build 22
Build while debugging 110 D
Bus noise 144
Data lines 145
Data MATT page 177
C debug 255
Cache view 111 Debug perspective 120
Cache view pop-up menu 114 Debug view 121
Cast to Type 230 Debugger 91
cd 246 Debugger Script Migration 297
change 246 Debugger Shell 239
Changing program counter value 125 Debugger Shell commands 242
Changing register values 206 Debugging in Instruction Stepping mode 125
Checksum actions 133 Development cycle 12
Circular build dependencies 59 Diagnostic Information export 33
Clearing watchpoints from Memory view 166 Diagnostics actions 134
CWCFUG
Rev. 10.x
01/2016