Debug
Debug
Copyright © 1983-2016 by Green Hills Software. All rights reserved. No part of this publication may be reproduced, stored
in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or
otherwise, without prior written permission from Green Hills Software.
Green Hills, the Green Hills logo, CodeBalance, GMART, GSTART, INTEGRITY, MULTI, and Slingshot are registered
trademarks of Green Hills Software. AdaMULTI, Built with INTEGRITY, EventAnalyzer, G-Cover, GHnet, GHnetLite,
Green Hills Probe, Integrate, ISIM, u-velOSity, PathAnalyzer, Quick Start, ResourceAnalyzer, Safety Critical Products,
SuperTrace Probe, TimeMachine, TotalDeveloper, DoubleCheck, and velOSity are trademarks of Green Hills Software.
All other company, product, or service names mentioned in this book may be trademarks or service marks of their respective
owners.
For a listing of Green Hills Software's periodically updated patent marking information, please visit
http://www.ghs.com/copyright_patent.html.
PubID: debug_no_wmaade-558975
Branch: http://toolsvc/branches/release-branch-70
Date: May 6, 2016
Contents
Preface xxiii
About This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiv
The MULTI 7 Document Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxv
Conventions Used in the MULTI Document Set . . . . . . . . . . . . . . . . . . . xxvi
iv MULTI: Debugging
Contents
vi MULTI: Debugging
Contents
x MULTI: Debugging
Contents
xx MULTI: Debugging
Contents
Index 835
Contents
About This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiv
The MULTI 7 Document Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxv
Conventions Used in the MULTI Document Set . . . . . . . . . . . . . . . . . . . . . . . xxvi
Preface
This preface discusses the purpose of this manual, the MULTI documentation set,
and typographical conventions used.
• Part I: Before You Begin Debugging documents the basic components of the
Debugger and describes how to connect to your target and prepare it for
debugging.
• Part II: Basic Debugging describes how to execute embedded programs and
navigate the Debugger window.
• Part III: Viewing Debugging Information and Program Details documents
how to examine program code and view debugging information.
• Part IV: TimeMachine Debugging describes how to use the TimeMachine
Debugger to debug backwards in your code.
• Part V: Advanced Debugging in Specific Environments documents how to
debug in run mode and freeze mode, how to use flash memory, use the MULTI
Debugger with ROM, test target memory, and establish serial connections.
• Part VI: Appendices contains reference material, including comprehensive
documentation of the Debugger's menus, keyboard shortcuts, and command
line options. This part also contains instructions about how to use the Debugger
with third-party tools and how to create custom data visualizations.
Specifications for the register definition format supported by this release are
included. Advanced breakpoint topics and core file debugging are also covered.
Note
New or updated information may have become available while this book
was in production. For additional material that was not available at press
time, or for revisions that may have become necessary since this book
was printed, please check your installation directory for release notes,
README files, and other supplementary documentation.
For a comprehensive list of the books provided with your MULTI installation, see
the Help → Manuals menu accessible from most MULTI windows.
• Print
• Online help, accessible from most MULTI windows via the Help → Manuals
menu
• PDF, available in the manuals subdirectory of your IDE or Compiler installation
• gxyz is a command.
• The option -option should either be replaced with one or more appropriate
options or be omitted.
• The word filename should be replaced with the actual filename of an
appropriate file.
The square brackets and the ellipsis should not appear in the actual command you
enter.
Introduction
Contents
The MULTI Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Building Your Code for Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Starting the MULTI Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Next Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Chapter 1. Introduction
4 MULTI: Debugging
Building Your Code for Debugging
The MULTI Debugger allows you to perform the following tasks quickly and easily:
• From the MULTI Launcher, click the Debug button ( ) and select an
executable from the drop-down list of recently accessed programs. If the
executable you want to debug does not appear on the list, click Open Debugger,
navigate to the file in the chooser that appears, and click Debug. Performing
either of these procedures repeatedly adds the specified executables to the open
Debugger window.
• From the MULTI Project Manager, select a compiled program and click the
Debug button ( ). If the Debug button appears dimmed, you have not selected
a compiled application. Performing this procedure repeatedly adds the specified
executables to the open Debugger window.
• From the command line of your host system, start MULTI:
○ On a compiled program. For example, enter the command:
multi [options...] program
6 MULTI: Debugging
Starting the Debugger in GUI Mode
-connect[=target | =connection_method_name]
Connects to the target debug server specified by target; connects using the specified
Connection Method; or, if neither a target nor a Connection Method is specified, opens
the Connection Chooser.
For more information about connecting to targets, see Chapter 3, “Connecting to Your
Target” on page 39. For information about the connect command, which corresponds to
this option, see “General Target Connection Commands” in Chapter 17, “Target Connection
Command Reference” in the MULTI: Debugging Command Reference book.
Note: The Debugger ignores the deprecated mode argument in Connection Methods that
specify it. To remove the mode argument from a MULTI 4 Connection Method, edit and
save the Connection Method in MULTI 7. For more information, see the connect command
in “General Target Connection Commands” in Chapter 17, “Target Connection Command
Reference” in the MULTI: Debugging Command Reference book.
-display disp
Linux/Solaris only
Specifies that the Debugger will open in the alternative display disp.
-h
Displays a concise description of all command line options.
-H
-help
Opens the MULTI Help Viewer on the MULTI: Debugging book.
-norc
Causes MULTI to ignore all script files normally executed on startup and upon opening
an executable in the Debugger except for those files specified with -p (below) or -rc (see
Appendix C, “Command Line Reference” on page 747).
For more information, see “Using Script Files” in Chapter 7, “Configuring and Customizing
MULTI” in the MULTI: Managing Projects and Configuring the IDE book.
-p file
Executes the command script file on startup.
For more information, see “Record and Playback Commands” in Chapter 15, “Scripting
Command Reference” in the MULTI: Debugging Command Reference book.
Each time you start MULTI from the command line, a new Debugger window
opens.
For a description of the main features of the Debugger window, see Chapter 2, “The
Main Debugger Window” on page 11.
Note
If you load an executable whose debug information files are out of date
(that is, the executable is newer than the debug information), the
Translate debug information? dialog box appears. The executable may
be newer than the debug information if, for example, you customarily
build your program and then move it to a new location, but at some point
forget to move the debug information files along with the executable. If
you know why the debug information files are out of date, try to remedy
the problem and then click Check Again. The dialog box closes if the
executable has an older timestamp than the debug information files. If
you do not know the reason for the out-of-sync files, you can click
Translate to extract debug information from the executable. If the
executable was built with DWARF or Stabs information, a reasonable
amount of debug information is extracted. However, if the executable
was built without DWARF of Stabs information, debug information inside
the executable is limited. In the latter case, MULTI will be able to open
the executable, but source-level debugging will not be available.
To run the Debugger in non-GUI mode, start MULTI from the command line and
use the -nodisplay option, as follows:
For information about compiling a program for debugging, see the documentation
about enabling debugging features in the MULTI: Building Applications book.
Tip
If you want to script Debugger actions without bringing up a GUI, you
may want to use the -run command line option. See Appendix C,
“Command Line Reference” on page 747.
8 MULTI: Debugging
Next Steps
Next Steps
The next chapter contains a detailed description of the main Debugger window and
a summary of the key features that can be accessed from it.
While you can open a Debugger window and view your program code without
connecting to your target, you will be unable to perform certain MULTI Debugger
operations until you have connected MULTI to a target. These operations include
viewing memory or registers and setting certain types of hardware breakpoints. For
instructions about connecting MULTI to a target, see Chapter 3, “Connecting to
Your Target” on page 39 and Chapter 6, “Configuring Your Target Hardware”
on page 89. After you have established a connection, see Chapter 7, “Preparing
Your Target” on page 105 for information about running a program on your target.
Contents
Debugger Window Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Setting Up Your Debugging Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
The Target List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
The Source Pane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
The Navigation Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
The Cmd, Trg, I/O, Srl, Py, and Tfc Panes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
The Status Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Chapter 2. The Main Debugger Window
This chapter describes the main Debugger window, which opens when you first
start the MULTI Debugger. For instructions about starting the Debugger, see
“Starting the MULTI Debugger” on page 5.
12 MULTI: Debugging
Debugger Window Components
• Title bar — Displays the name of the executable being debugged. In this
example, the executable name is basic_dbg.
• Menu bar — Contains drop-down menus with the Debugger's most commonly
used features. Specific menu options are documented throughout Parts I, II,
and III of this manual, in the context of the tools or actions they are associated
with. For a comprehensive description of Debugger menus and menu choices
arranged by menu, see “Debugger Window Menus” on page 684. For information
about how to customize menus, see “Configuring and Customizing Menus” in
Chapter 7, “Configuring and Customizing MULTI” in the MULTI: Managing
Projects and Configuring the IDE book.
• Toolbar — Contains buttons with the Debugger's most commonly used features.
Positioning your mouse pointer over a button displays the button's function.
For a full description of each default button and its command equivalent, see
“The Debugger Window Toolbar” on page 715. For instructions about how to
add or remove buttons from the toolbar or customize buttons, see “Configuring
the Debugger Toolbar” on page 722.
• Target list — Displays items that are currently available for debugging and
shows the relationships among these items. For more information, see “The
Target List” on page 15.
• Source pane — Displays the source code of your program. For more
information, see “The Source Pane” on page 22. From the source pane, you
can also open special windows to view variables, registers, target memory, the
call stack, and other process and debugging information. For more information,
see “Viewing Program and Target Information” on page 170.
• Navigation bar — Contains buttons and tools for changing the display mode
of the source pane, browsing through the files and functions of the program
you are debugging, and jumping to previous or subsequent source pane views.
For more information about these tools, see “The Navigation Bar” on page 26.
• Command, target, I/O, serial terminal, Python, and traffic panes — Functions
as the command pane by default. The command pane accepts Debugger
commands and displays the output of debugging activity. You can use the tabs
beneath the pane to display a target pane, I/O pane, serial terminal pane, Python
pane, or traffic pane instead of the command pane. For more information about
each pane and how to switch among them, see “The Cmd, Trg, I/O, Srl, Py,
and Tfc Panes” on page 27.
• Status bar — Displays process status and various informational messages. For
more information, see “The Status Bar” on page 37.
14 MULTI: Debugging
The Target List
• Right-click the executable and select Open in New Window from the shortcut
menu that appears.
Note
It is not possible to debug the same process in two windows.
If you open multiple Debugger windows, the background colors are different to
help you distinguish among the windows. In the target list located in the original
Debugger window, the names of executables that are open in another Debugger
window are highlighted in the same color as the corresponding Debugger window.
The target list does not appear in secondary Debugger windows.
Note
In the following sections, the term executable is used to mean any
executable; thread; or INTEGRITY application, module, or kernel that
you can select for debugging.
When you change the target list location, MULTI attempts to preserve the width of
the source pane by resizing the window. If the source pane area is too small, MULTI
does not change the window size.
Tip
As an alternative to displaying the target list and the source pane in one
Debugger window, you can maximize the target list area and then debug
every executable in a separate window. To maximize the target list area,
drag the splitter that separates the target list from the source pane. You
can move it down to the command pane (when the target list is at the top)
or right to the edge of the window (when the target list is on the left). For
information about debugging executables in separate windows, see
“Opening Multiple Debugger Windows” on page 14.
By default, the target list is auto-sized when it occupies the top pane of the Debugger
window, but you can also size it manually. To do so, drag the splitter up or down.
To revert to the default auto-sizing behavior, click the Auto-size splitter button
( ), which is located to the right of the Status column.
To hide the target list completely, drag the splitter all the way up or all the way to
the left (depending on the position of the target list).
• A debug server — The source pane is empty. The debug server may be
represented by Simulated target, Run mode target, or the name of a debug
server or probe.
• A CPU — The source pane is empty. The CPU is located under the debug
server.
• An executable — The executable's source code appears in the source pane.
• An OSA AddressSpace — The source pane is empty. OSA AddressSpaces are
located under CPU nodes, and their names begin with OSA.
16 MULTI: Debugging
Debugging Target List Items
• An OSA master process — The kernel's source code appears in the source
pane. The master process is listed under the CPU node of a freeze-mode
connection. For more information, see “Master Debugger Mode” on page 556.
• An OSA task — The task's source code appears in the source pane. OSA tasks
are located under OSA AddressSpaces (AddressSpaces whose names begin
with OSA). MULTI refreshes OSA tasks in the target list when the OSA
Explorer is refreshed or when trace data is retrieved. If you have frozen or
closed the OSA Explorer and disabled the retrieval of trace data, MULTI does
not refresh OSA tasks when the target halts. For more information, see
“Debugging in Freeze Mode” on page 555 and “Task Debugger Mode”
on page 557.
• A run-mode AddressSpace — If you are using INTEGRITY version 10 or later,
the AddressSpace's source code appears in the source pane. Otherwise, the
source pane is empty. For more information, see “Run-Mode Applications and
AddressSpaces” on page 522.
• A run-mode task — The task's source code appears in the source pane.
Run-mode tasks are located under run-mode AddressSpaces. For information
about run-mode debugging, see Chapter 21, “Run-Mode Debugging”
on page 517.
• An AddressSpace or task in TimeMachine mode — The AddressSpace's or
task's source code appears in the source pane. Target list entries for which
TimeMachine is enabled include (TimeMachine) in their Status. For
information about debugging in TimeMachine mode, see Part IV. TimeMachine
Debugging on page 405.
Any commands you give via menu selections, buttons, or the command pane are
performed on the item that is selected in the target list (if applicable). If multiple
items are selected, most actions are disabled; however, any actions that are still
allowed apply to all selected items.
For information about how the above items are arranged in the target list, see “The
Target Column” on page 19.
You can hide any column except for the Target column by right-clicking the column
header and selecting the column name. Columns that you hide remain hidden
between debugging sessions until you choose to show them again. To do so, simply
right-click the column header again and select the column name.
To toggle the exclusive display of starred entries, their ancestors, the currently
selected target list entry, and stopped entries:
• Click the Only show starred items button ( ), located to the right of the
Status column, or
• Enter star toggle in the Debugger command pane.
Star settings are typically remembered across debugging sessions. (Only the star
settings of Linux threads are not remembered.)
18 MULTI: Debugging
Target List Columns
• Compressed — The Debugger compresses all related items onto a single line
when the resulting line contains only one of each item. For example, suppose
you are connected to a PowerPC 860 CPU that is running a kernel. The debug
server, CPU, and kernel are all compressed onto one line, as shown next.
In both compressed and hierarchical view mode, you can change the display by
expanding or collapsing nodes. If you collapse a node that encompasses multiple
items of the same type (for example, a CPU that contains multiple applications),
the source pane is generally empty and the target list does not display status or CPU
information for the parent object. Displaying a single status for the parent object
would be ambiguous in this case because multiple child objects, each of which has
a valid status, are encompassed by the parent object. All run control, trace, and
target access operations are disabled for a similar reason; it's not clear which child
object the Debugger should act upon. To see status information and enable
operations, expand the collapsed node and select a lower-level item under it.
As the previous graphics illustrate, executables appear after the CPU that they are
associated with. The CPU in turn appears after the relevant debug server.
Target Terminology
The following list defines the phrases that are used in the Target column of the
target list.
• Direct hardware access — Appears under a CPU name in the target list when
you are not actively debugging an executable on that CPU. For information
about preparing to debug an executable on your target, see Chapter 7, “Preparing
Your Target” on page 105.
• Unconnected Executables — The executables that appear under this heading
are not associated with a connection. For more information, see “Associating
Your Executable with a Connection” on page 107.
Status Meaning
Created The task has been initialized but has not yet been run.
DebugBrk The task has been stopped due to a MULTI breakpoint or
single-stepping. In a synchronous debugging environment, a red
stop icon ( ) is another indication of this status. For information
about synchronous debugging, see “Synchronous Debugging on
a Multi-Core Target” on page 577.
Execing The process has just performed an exec() call—a kernel call via
a software interrupt.
Exited The task has exited (usually by calling exit()).
GrpHalt The task, which is part of a task group, has been halted by a group
breakpoint. For more information see, “Group Breakpoints”
on page 529.
Halted The run-mode task has been halted by the operating system or the
user.
20 MULTI: Debugging
Target List Columns
Status Meaning
HostIO The task is writing to or reading from a file on the host system or
the I/O pane. This status may also signify that the target process
is waiting for input from stdin. In this case, select the process in
the target list, click in the I/O pane, and type the input you want
the process to receive.
No TimeMachine Data Trace data was not saved for the loaded task.
Not loaded The executable has not been downloaded or flashed onto a target
or is not currently running on the target system. For information
about loading the executable on a target, see “Preparing Your
Target” on page 110.
<OS Running> The target operating system is running (only applicable to OSA
tasks).
Paused by halted_core The core is halted because synchronous debugging has been
enabled and another core in the multi-core system has halted. A
green pause icon ( ) is another indication of this status. For more
information, see “Synchronous Debugging on a Multi-Core Target”
on page 577.
Paused by the debugger The core cannot run because synchronous debugging has been
enabled and you have requested a system pause. A green pause
icon ( ) is another indication of this status. For information about
synchronous debugging, see “Synchronous Debugging on a
Multi-Core Target” on page 577.
Pended The exact meaning is OS-specific. In general, this status signifies
that the run-mode task is waiting for something to happen, such
as the release of a semaphore or message on a socket.
Running The task is running.
status(TimeMachine) TimeMachine mode is enabled. For more information, see
Part IV. TimeMachine Debugging on page 405.
Stopped The core is stopped. In a synchronous debugging environment, a
red stop icon ( ) is another indication of this status. For more
information, see “Synchronous Debugging on a Multi-Core Target”
on page 577.
SysHalt All tasks on the target system are halted, and the target is frozen.
Zombied The task has exited (usually by calling exit()), but data structures
describing the task still exist on the target.
Target-Specific Columns
Additional columns may be available for display in the target list, depending on the
operating system and connection you are using. These columns, which are hidden
by default, may indicate things like stack usage, CPU usage, and other properties
of the system. To display a hidden column, right-click any column header in the
target list, and select the name of the column you want to view.
22 MULTI: Debugging
The Source Pane
• Source pane display modes — The source pane can display your program code
in high-level language, mixed high-level and assembly language, or assembly
language. You can use the Display Mode Selector in the navigation bar or the
View → Display Mode menu option to switch among these display modes.
For more information, see “Source Pane Display Modes” on page 24.
• Line numbers — By default, file-relative line numbers appear in the left-most
column of the source pane, and function-relative line numbers appear to the
right of the file-relative numbers. You can configure the Debugger to display
either, both, or neither of the columns or to display the columns in opposite
orientation. See “Source Pane Line Numbers” on page 25.
• Breakdots — A breakdot is a small dot located to the left of any line of code
that corresponds to an executable instruction. You can set a software breakpoint
simply by clicking a green ( ) or blue ( ) breakdot. You can also use breakdots
to set hardware breakpoints and tracepoints, if your target supports them. For
more information, see “Breakdots, Breakpoint Markers, and Tracepoint
Markers” on page 126.
• Breakpoint markers — A breakpoint marker is an icon that appears in place
of a breakdot when you set a breakpoint. By default, hardware breakpoints are
indicated by a small purple icon ( ). Software breakpoints are indicated by a
small red stop sign ( ). The stop sign may contain a symbol indicating that
certain conditions are associated with the breakpoint. If a breakpoint is disabled,
the breakpoint marker is gray. For more details, see “Breakdots, Breakpoint
Markers, and Tracepoint Markers” on page 126.
• Debugger Notes — Debugger Notes are free form notes that can be associated
with any line of code. The line number column(s) of lines associated with
Debugger Notes are shaded gray. For more information, see Chapter 10, “Using
Debugger Notes” on page 175.
• Current line pointer — The blue current line pointer ( ) jumps to any line
you type in the command pane, select with a mouse click, or navigate to with
commands. If you run or step a process, the pointer jumps to the location where
the process halts. Many Debugger commands operate at the line pointer location
if no other location is specified.
When you open a program, the line pointer is located at the entry point. If you
stop a running process, the line pointer jumps to the code where the process
has stopped. You can also navigate to other locations easily. For more
Note
You can open other windows to view details about certain program
elements, such as variables, by double-clicking them in the source pane.
For more information, see “Viewing Program and Target Information”
on page 170.
• Source only — Displays only high-level source code. This is the default display
mode.
• Interlaced assembly — Displays high-level source code interlaced with the
corresponding machine instructions.
• Assembly only — Displays only assembly code.
You can change the source pane display mode in any of the following ways:
• From the Display Mode Selector's drop-down menu, select Source, Mixed, or
Assem. The Display Mode Selector ( ) appears on the navigation bar.
24 MULTI: Debugging
Source Pane Line Numbers
• From the View → Display Mode menu, select Source Only, Interlaced
Assembly, or Assembly Only.
• Use the assem Debugger command. For information about this command, see
Chapter 8, “Display and Print Command Reference” in the MULTI: Debugging
Command Reference book.
If no high-level source code is available to the Debugger, or if the module was not
compiled with sufficient debugging information, the Debugger only displays
assembly code, regardless of the display mode setting. See the MULTI: Building
Applications book for information about how to generate debugging information.
When both file-relative and function-relative line numbers are displayed, they appear
as two separate columns on the left side of the source pane. By default, file-relative
line numbers appear in the left-most column, and function-relative line numbers
appear to the right of the file-relative numbers and to the left of the breakdots. You
can change the orientation of the column display with one of the following methods:
• Select Config → Options → Debugger tab. If you check the Use function
relative line numbers (vs. file relative) box, file-relative numbers appear in
the left column and function-relative numbers in the right column. This is the
default setting. If you clear this check box, file-relative numbers appear in the
right column and function-relative numbers in the left column. This option also
affects how line numbers in Debugger commands are interpreted. See
For example:
> configure ProcRelativeLines on
Setting this option to on causes file-relative numbers to appear in the left column
and function-relative numbers to appear in the right column. This is the default
setting. Setting this option to off causes file-relative numbers to appear in the
right column and function-relative numbers to appear in the left column. This
option also affects how line numbers in Debugger commands are interpreted.
See “Specifying Line Numbers” in Chapter 1, “Using Debugger Commands”
in the MULTI: Debugging Command Reference book.
26 MULTI: Debugging
The Cmd, Trg, I/O, Srl, Py, and Tfc Panes
You can change the relative sizes of the source pane and the command pane by
dragging the navigation bar up or down.
Note
The pane-switching buttons that appeared on the navigation bar in
previous releases and that allowed you to switch between the command,
target, and I/O panes have been replaced by tabs under the command
pane. For more detailed information, see the next section.
To change which pane is displayed in this area, click the appropriate tab located in
the lower-left corner of the pane. The following table describes each tab and pane.
Tab Pane Description
Cmd Command Allows you to enter Debugger commands and view the output
of debugging activity. This is the default pane.
For more information about using the command pane, see “The
Command Pane” on page 29.
If a pane is not available in your current context, the tab for that pane does not
appear. If a tab is not selected but new output is available in the corresponding pane,
the tab is marked with an asterisk (*). The asterisk indicates that output is available
for viewing.
Tip
For information about limiting the number of scroll back lines available
in these panes, see the CTextSize option in “Other Debugger
Configuration Options” in Chapter 8, “Configuration Options” in the
MULTI: Managing Projects and Configuring the IDE book.
28 MULTI: Debugging
The Command Pane
If the Cmd tab is not selected, but new output is available in the command pane,
the tab is marked with an asterisk (*).
In the Debugger window, most keystrokes you make go into the command pane,
unless you have clicked in the File Locator or the Function Locator text box. The
command pane automatically evaluates expressions using the syntax of the source
code language currently being debugged. For general information about using
Debugger commands and for a detailed description of the Debugger commands that
can be entered in the command pane, see the MULTI: Debugging Command
Reference book.
Note
The default prompt in the command pane is MULTI>. You can specify a
different prompt by entering the command configure prompt
new_prompt in the command pane, or by setting the Command pane
prompt configuration option. For information about the configure
command, see “General Configuration Commands” in Chapter 6,
“Configuration Command Reference” in the MULTI: Debugging
Command Reference book. For information about the Command pane
prompt option, see “The Debugger Options Tab” in Chapter 8,
“Configuration Options” in the MULTI: Managing Projects and
Configuring the IDE book. For information about saving your prompt,
see “Saving Configuration Settings” in Chapter 7, “Configuring and
Customizing MULTI” in the MULTI: Managing Projects and Configuring
the IDE book.
The Debugger keeps a history of all the Debugger commands entered in the
command pane. You can use history commands, such as the ! and !! commands, to
search the command history and execute previously entered commands. For more
information, see “History Commands” in Chapter 15, “Scripting Command
Reference” in the MULTI: Debugging Command Reference book. You can also
record and play back sequences of Debugger commands. For more information,
see “Record and Playback Commands” in Chapter 15, “Scripting Command
Reference” in the MULTI: Debugging Command Reference book.
Shortcut Effect
UpArrow Retrieve the previous command from the command history, moving
back in the list. Press repeatedly to retrieve older commands.
DownArrow Retrieve the next command from the command history, moving
forward in the list. Press repeatedly to retrieve more recent commands.
Ctrl+UpArrow Scroll up four lines.
Ctrl+DownArrow Scroll down four lines.
Ctrl+U Cuts to the beginning of the current line or the selection.
Tab Accept auto-completion of the current word.
Ctrl+P Attempt to auto-complete the current string, working backwards
through the command history for commands beginning with the typed
characters.
Ctrl+D Display a list of possible completions for the current word.
F6 Cycle between the available panes in the command pane area. For
more information, see “The Cmd, Trg, I/O, Srl, Py, and Tfc Panes”
on page 27.
Click with the right Open a shortcut menu. For a full description of the shortcut menu,
mouse button see the “The Command Pane Shortcut Menu” on page 736.
30 MULTI: Debugging
The Target Pane
Note
The procedures for copying, cutting, and pasting text in the command
pane differ slightly from the procedures used in other windows. For more
information, see “Selecting, Copying, and Pasting Text in the Main
Debugger Window” on page 163.
For a full list of default shortcuts, see Appendix B, “Keyboard Shortcut Reference”
on page 741. For information about reconfiguring the MULTI IDE's default shortcut
keys and mouse clicks, see “Customizing Keys and Mouse Behavior” in Chapter
7, “Configuring and Customizing MULTI” in the MULTI: Managing Projects and
Configuring the IDE book.
If the Trg tab is not selected, but new output is available in the target pane, the tab
is marked with an asterisk (*).
This tab and pane are only available if your debug server supports this feature and
you are connected to a target. For more information about debug servers, see the
MULTI: Configuring Connections book for your target processor family. For
instructions about connecting to your target, see Chapter 3, “Connecting to Your
Target” on page 39.
If the I/O tab is not selected, but new output is available in the I/O pane, the tab is
marked with an asterisk (*). If input is not possible for the currently selected target,
the pane is labeled Out.
This tab and pane are only available if your debug server supports this feature and
you are connected to a target. For more information about debug servers, see the
MULTI: Configuring Connections book for your target processor family. For
instructions about connecting to your target, see Chapter 3, “Connecting to Your
Target” on page 39.
If the Srl tab is not selected, but new output is available in the serial terminal pane,
the tab is marked with an asterisk (*).
32 MULTI: Debugging
The Serial Terminal Pane
This tab and pane are only available if you are connected to an active serial port.
There are two ways to connect to a serial port:
• Select Tools → Serial Terminal. From the submenu that appears, you can
open recent connections or create a new serial connection using the Serial
Connection Chooser. For more information, see “Using the Serial Connection
Chooser” on page 670.
• In the Debugger command pane, issue the serialconnect command with
appropriate arguments. For information about this command, see “Serial
Connection Commands” in Chapter 17, “Target Connection Command
Reference” in the MULTI: Debugging Command Reference book.
Once you have established a serial connection, the serial terminal pane is available.
Input to this pane is sent to the serial port; output from the serial port is sent to this
pane.
Note
Only one serial connection exists per debugging session. If you open a
second Debugger window and a serial connection is already active, the
new window displays a Srl pane, but you cannot make a second,
simultaneous serial connection. All Debugger windows in a debugging
session show views of the same serial connection in their Srl panes. If
you require multiple serial connections at the same time, see Chapter 27,
“Establishing Serial Connections” on page 667, for alternate ways to use
serial connections.
If the Py tab is not selected, but new output is available in the Python pane, the tab
is marked with an asterisk (*).
This tab and pane are always available, but the Python pane only remembers Python
history for the current Debugger's debugging session. For more information about
this pane, see “MULTI-Python Interfaces” in Chapter 2, “Introduction to the
MULTI-Python Integration” in the MULTI: Scripting book.
To open the Python pane as a separate window, right-click in the Python pane area
and select Show Separate Py Window from the shortcut menu.
34 MULTI: Debugging
The Traffic Pane
If the Tfc tab is not selected, but new output is available in the traffic pane, the tab
is marked with an asterisk (*).
This tab and pane are always available. However, you will only see meaningful
messages if you have connected to a target during the current MULTI session.
Viewing traffic information may be useful if you see unexpected results while
working in MULTI or if your target crashes. You can examine traffic pane messages
to see what commands MULTI has issued to the target and to see how the target
has responded.
Each line of information in the traffic pane is referred to as a traffic report. When
you are debugging native processes, each traffic report begins with pid—for
“process ID”—followed by the process ID number. When you are debugging
INTEGRITY tasks, each traffic report begins with task followed by a hexadecimal
number. These numbers and either pid or task are always enclosed in parentheses.
The target gives every process a new process ID number and every task a new task
number, making it easy to tell processes and tasks apart. If the target does not know
the process ID or task number, or if none exists, the traffic report does not list any
number.
The traffic pane displays MULTI commands that result in target traffic, requests
that MULTI makes to the target, and resulting target responses or actions. The
following example typifies what you might see in the traffic pane.
If you view the traffic pane contents, you see the following.
As a result of you typing the print command, MULTI asked the target (in this case,
simarm) to read register R0.
Most MULTI buttons and menu items correspond to MULTI commands. Therefore,
if you click a button or select a menu item, the traffic pane displays the command
associated with your action. For example, suppose you click the button or press
F10 to single-step a Linux x86 native process. If you view the traffic pane contents,
you might see something like the following.
MULTI command: __ntwcommand next
\_ MULTI command: n
| (pid 22434) Set software breakpoint at 0x8049448 (foo.cc:main#12)
| (pid 22434) Resume process at 0x8049437 (foo.cc:main#11), in source step
| (pid 22434) Read memory block (64 bytes @ 0xbfece180)
| (pid 22434) Remove breakpoint from 0x8049448 (foo.cc:main#12)
The button and the F10 key are linked to MULTI's n command. As a result,
MULTI executes the n command when you click or press F10. The n command
causes MULTI to set a temporary breakpoint at the next source line (in this case,
line 12 of main()), and then resume the process from the current source line (in
this case, line 11 of main()). When it reaches line 12, it removes the temporary
breakpoint.
In addition to displaying interactions between your target and MULTI, the traffic
pane also displays the chain of commands (if any) that causes target traffic. You
might not explicitly specify multiple commands; however, some MULTI commands
execute others as a part of their operation. For example, suppose that while a process
is running, you enter the tog command to inactivate a breakpoint. You might see
something like the following.
MULTI command: tog off main#2
| (pid 22807) Halt remote process (stop thread)
| (pid 22807) Status is StatHalted
| (pid 22807) Remove breakpoint from 0x80491bf (foo.cc:main#2)
\_ MULTI command: c
| (pid 22807) Resume process at 0xb7f85402
| (pid 22807) Status is StatRunning
In this case, MULTI halts the process and later executes the c command to continue
it. When one command executes another as shown, the commands appear nested
36 MULTI: Debugging
The Status Bar
The traffic pane only displays messages for the current MULTI session. Within one
session, you can view all the messages that MULTI has printed—even if you have
disconnected from your target. Scroll up to see the beginning of the message log.
To clear the messages, right-click in the traffic pane and select Clear Pane from
the shortcut menu.
For more information about the commands included in the preceding examples, see
the MULTI: Debugging Command Reference book.
The bar is divided into two areas. The box on the left displays informational
messages. The following table lists the most common messages and their meanings.
Message Meaning
In section: section Displays the name of the program section where the PC
pointer is currently located.
item_description Explains the function of the button or field under your mouse
pointer.
For example, if you place your mouse pointer over the
button on the toolbar, the message Go on selected items
appears in the status bar.
SSrch: string Indicates that the incremental search utility is searching the
source pane for the pattern string. See “Incremental
Searching” on page 158.
The box on the right displays process state information, such as that listed in the
following table.
38 MULTI: Debugging
Chapter 3
Contents
Working with Connection Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Standard Connection Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Custom Connection Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Temporary Connection Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Using the Connection Organizer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Disconnecting from Your Target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Chapter 3. Connecting to Your Target
This chapter describes how to use the tools listed below to create, save, view,
manage, and use Connection Methods. It also describes how to view information
about your targets and manage them.
40 MULTI: Debugging
Hardware Connections
Hardware Connections
In addition to configuring at least one Connection Method, you may also need to
configure your target board and/or hardware debugging device (if applicable) before
you can download and debug code. For information about configuring your target
hardware, see Chapter 6, “Configuring Your Target Hardware” on page 89. For
information about the specific options available for:
Simulator Connections
Even if your hardware is unavailable during development, you can still debug your
program with the MULTI Debugger by connecting to a simulator for your target
architecture type. A simulator is installed automatically when you install a Green
Hills Compiler, and the procedure for connecting to it from the MULTI Debugger
is similar to the procedure for connecting to an external target. In this chapter, the
word target indicates either a hardware target or a simulated target. For more
information about the simulator(s) available for your target, see the MULTI:
Configuring Connections book for your specific processor.
Tools Overview
The simplest way to create and edit Connection Methods is to use the Connection
Editor, which allows you to make selections and enter settings through a graphical
interface. The Connection Editor translates your selections and input into the
appropriate command line options to the debug server that MULTI uses to connect
to your specific target. Connection Methods created using the Connection Editor
are referred to as Standard Connection Methods. Standard Connection Methods
can be saved, invoked quickly using the Connection Chooser, and managed using
the Connection Organizer. For more information about creating, configuring, and
using Standard Connection Methods, see “Standard Connection Methods”
on page 42.
Tip
Users who prefer to enter command line options rather than use the GUI
interface can create Custom Connection Methods. Like Standard
Connection Methods, Custom Connection Methods can be saved, invoked
quickly using the Connection Chooser, and managed using the
Connection Organizer. For more information about using Custom
Connection Methods, see “Custom Connection Methods” on page 47.
After you have created one or more Connection Methods, you can connect to your
target from the Connection Chooser or Connection Organizer. You can use the
Connection Organizer to save Connection Methods and organize them into
Connection Files in your projects.
42 MULTI: Debugging
Creating a Standard Connection Using the Connection Chooser
before you can use them to connect to your target. For instructions about how to
edit new or existing Standard Connection Methods, see “Configuring a Standard
Connection with the Connection Editor” on page 44.
You can open the Connection Chooser from the MULTI Project Manager,
Debugger, or Launcher. Perform one of the following steps to open the
Connection Chooser:
Note
In a native environment, attempting to open the Connection
Chooser from the Debugger automatically connects to a native
debug server. To create a Connection Method, use the
Connection Editor, which you can access by selecting Method
→ New in the Connection Organizer.
3. Enter a name for your Connection Method (for example, Green Hills Probe
to my board). If you do not enter a name, the Method you create is a
Temporary Connection Method (see “Temporary Connection Methods”
on page 49).
4. Select an appropriate connection type from the drop-down list. The types listed
depend on your particular Compiler installation. Select the type that best
describes your debug connectivity method.
5. Click Create. The Connection Method is stored in the [User Methods] file.
For more information, see “The Default Connection File [User Methods]”
on page 53.
When you click Create, a Connection Editor window opens for your new Standard
Connection Method. You may need to edit the new Method before you use it for
the first time. The next section describes how to do this.
44 MULTI: Debugging
Connecting with a Standard Connection
If you used the Project Wizard to create a project and you need to edit a default
Connection Method created by the wizard, or if you want to edit a Standard
Connection Method you have previously created and saved, perform the following
steps to open the Connection Editor.
2. From the drop-down list, select the Connection Method you want to edit.
3. Click to open the Connection Editor for the selected Connection Method.
For information about the basic features of the Connection Editor, see the
documentation about the Connection Editor in the MULTI: Configuring Connections
book.
46 MULTI: Debugging
Custom Connection Methods
• Use the connect Debugger command. For information about this command,
see “General Target Connection Commands” in Chapter 17, “Target Connection
Command Reference” in the MULTI: Debugging Command Reference book.
• Choose Custom as the connection type in the Create New Connection Method
dialog box. For remaining steps about how to create a Custom Connection
Method from the Create New Connection Method dialog box, see the
instructions that follow the appearance of this dialog box in “Creating a Standard
Connection Using the Connection Chooser” on page 43.
• Manually enter commands and options into the Connection Chooser. For more
information, see below.
2. Click Custom.
3. In the Start a Custom Connection text field, enter the connection command
for your particular target connection.
The general format of the command that starts a debug server and connects to
a target is:
where:
• setup_script is the filename of the target setup script written in the
MULTI scripting language. setup=setup_script may not be required
for your target.
• xserv is the name of the Green Hills debug server that supports your
debugging interface, monitor, or simulator. For example, the mpserv
debug server supports the Green Hills Probe. For the name of the correct
debug server, see the MULTI: Configuring Connections book for your
target processor.
• required_arguments and available options for:
○ INTEGRITY run-mode target connections are documented in
Chapter 4, “INDRT2 (rtserv2) Connections” on page 59 and
Chapter 5, “INDRT (rtserv) Connections” on page 77.
○ Green Hills Probe or SuperTrace Probe target connections are
documented in the Green Hills Debug Probes User's Guide.
○ Other target connections are documented in the MULTI: Configuring
Connections book for your target processor.
4. Click Connect.
MULTI connects to your target and saves your Custom Connection Method.
In the future, the Method you entered in the text field will appear in the list of
Connection Methods available in the Connection Chooser and Connection
Organizer.
For more information about using and managing existing Connection Methods,
see “Using the Connection Organizer” on page 50. To troubleshoot a
connection problem, see the MULTI: Configuring Connections book for your
target processor or, for Green Hills Probe or SuperTrace Probe users, the Green
Hills Debug Probes User's Guide.
48 MULTI: Debugging
Temporary Connection Methods
4. Click Create.
5. The new Connection Method is named Temporary Connection (#). Use
the Connection Editor to configure the connection. For information about
the Connection Editor, see “Configuring a Standard Connection with the
Connection Editor” on page 44.
• From the Launcher, click and select Open Connection Organizer, or select
Components → Open Connection Organizer.
• From the Project Manager, select Connect → Connection Organizer.
• From the Debugger, select Target → Show Connection Organizer.
• From the Debugger command pane, enter the connectionview command. For
information about the connectionview command, see “General Target
Connection Commands” in Chapter 17, “Target Connection Command
Reference” in the MULTI: Debugging Command Reference book.
• From the Connection Chooser dialog box, click . If the Connection Chooser
dialog box automatically appeared as the result of an action you took (such as
trying to run your program without first connecting), clicking the button
aborts the action and opens the Connection Organizer.
50 MULTI: Debugging
Opening the Connection Organizer
• Opened Connection Files — Lists all the Connection Files currently open.
Each Connection File contains one or more Connection Methods. You can use
Connection Files to save, restore, and transport your connection configurations.
The Connection Organizer always has at least one Connection File open: the
[User Methods] file. The Opened Connection Files list may also contain
default.con files created by the Project Wizard, or it may contain other .con
files you have created. For more detailed information about Connection Files,
see “Creating and Managing Connection Files” on page 52.
• Methods in selected file — Lists all the Connection Methods present in the
Connection File that is selected in the Opened Connection Files list. You can
use the Connection Organizer's menu choices and shortcuts to start, copy,
edit, move, or delete Connection Methods from this list.
• Connected Targets — Lists all the currently established target hardware or
simulator connections. For more detailed information about connected targets,
see “Managing Your Connected Targets” on page 54.
1. From the Opened Connection Files list, select the Connection File that
contains your desired Connection Method.
2. From the Methods in selected file list, select a Connection Method.
3. From the Connection Organizer's menu, select Method → Edit or right-click
the selected method and select Edit from the shortcut menu.
4. Using the Connection Editor that appears, modify your Connection Method
settings. For general information about using the Connection Editor, see the
documentation about the Connection Editor in the MULTI: Configuring
Connections book. For detailed information about the settings available for:
• INTEGRITY run-mode target connections, see Chapter 4, “INDRT2
(rtserv2) Connections” on page 59 or Chapter 5, “INDRT (rtserv)
Connections” on page 77.
• Green Hills Probe or SuperTrace Probe target connections, see the Green
Hills Debug Probes User's Guide.
• Other target connections, see the MULTI: Configuring Connections book
for your target processor.
5. Click OK to save your changes.
52 MULTI: Debugging
Creating and Managing Connection Files
open and use Connection Files created by other installations. You can even email
Connection Files to other users and computers.
You can open any number of Connection Files in the Connection Organizer. Some
are opened for you automatically. The default Connection File, [User Methods] is
always open. If the Connection Chooser appears, the Connection Organizer also
opens the Connection File that contains the Connection Method selected by default
in the Connection Chooser.
To view the Connection Methods stored in an open Connection File, select the
Connection File in the Opened Connection Files list.
By default, changes to open Connection Files are saved immediately. If you change
the default setting, you must manually save your Connection Files via the
Connection Organizer. For information about changing the default settings, see
the autoSaveConnectionsinFiles and autoSaveUserConnections options in the
“Session Configuration Options” in Chapter 8, “Configuration Options” in the
MULTI: Managing Projects and Configuring the IDE book.
1. Open the Project Manager, select File → Open Project. Select the filename
of the project you want to work with.
2. Select Edit → Add File into project.gpj. Select the filename of the Connection
File you want associated with this project. You can specify a Connection File
that does not exist; the Connection Organizer simply creates it for you.
1. From the Opened Connection Files list, select the Connection File that
contains your desired Connection Method.
2. From the Methods in selected file list, select a Connection Method.
3. From the Connection Organizer menu bar, select Method → Connect to
Target, or right-click the method and select Connect to Target from the
shortcut menu.
4. If the connection is successful, a new connection appears in the Connected
Targets list. For information about connected targets, see “Managing Your
Connected Targets” on page 54.
54 MULTI: Debugging
Connection Organizer Menu and Action Reference
You can select Connection Files from this list and perform the following actions
by using the File menu. Most of the File menu options are also available via the
right-click menu.
The primary interface for working with Connection Methods is the list of Connection
Methods located under Methods in selected file in the Connection Organizer.
You can select Connection Methods from this list and perform the following actions
by using the Method menu or the right-click menu.
56 MULTI: Debugging
Connection Organizer Menu and Action Reference
The primary interface for working with connected targets is the list of Connected
Targets located in the Connection Organizer.
You can select connected targets from this list and perform the following actions
by using the Target menu. Most of the following Target menu options are also
available via the right-click menu.
58 MULTI: Debugging
Chapter 4
INDRT2 (rtserv2)
Connections
Contents
Introduction to rtserv2 and INDRT2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Building in Run-Mode Debugging Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Connecting Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
INDRT2 Connection Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Automatically Establishing Run-Mode Connections . . . . . . . . . . . . . . . . . . . . . 69
Connecting to Multiple ISIM Targets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Chapter 4. INDRT2 (rtserv2) Connections
When you are connected to rtserv2, the target list displays all the tasks in the system.
Any user task in the target list can be selected and individually debugged.
Communication Media
An INDRT2 (rtserv2) connection can be established over an IP network (typically
Ethernet) or a serial link. A BSP typically provides drivers to support an Ethernet
or serial device. For information about configuring INTEGRITY's network settings,
see the INTEGRITY Networking Guide.
60 MULTI: Debugging
Building in Run-Mode Debugging Support
• Use a fast and reliable IP network (such as Ethernet) whenever possible for
better performance.
• For BSPs that support only one serial port, the port cannot be used for debugging
when it is being used for diagnostics. If the serial port is already in use, close
the terminal program used to view the serial port output before establishing
your run-mode connection.
• The baud rate at which a particular BSP communicates over a serial port varies.
For details, see the documentation that came with your BSP.
Connecting Overview
You can establish a debug server connection in any of the following ways. Each is
discussed in more detail later in this chapter.
For general instructions that explain how to create and use Connection Methods,
see Chapter 3, “Connecting to Your Target” on page 39. The information in the
following sections supplements the instructions provided there with information
that is specific to INDRT2 connections.
When the Connection Editor is first displayed after you create a new Connection
Method, the settings and options are set to default values. Settings and options that
are not available on your host operating system may appear dimmed. Some of the
fields may require user input before the Connection Method can be used.
62 MULTI: Debugging
Using the INDRT2 (rtserv2) Connection Editor
Ethernet/IP Connection
Sets your desired connection type as Ethernet/IP. This radio button is mutually exclusive with
the Serial Connection button. If you select an Ethernet/IP connection (this is the default), the
following field will also be available:
• Target Name or Address — Specifies the host name or IP address of your target. You
must specify a host name or IP address to create a valid Ethernet/IP connection.
Note: If you need to connect to your target using a non-standard UDP port number (that is, not
2220), you must use a Custom Connection Method. See “Custom INDRT2 (rtserv2) Connections
Over an IP Network” on page 67 for instructions.
Serial Connection
Specifies that a serial connection to the target should be used. This radio button is mutually
exclusive with the Ethernet/IP Connection button and is not supported on Solaris. If you select
a serial connection, the following option fields will also be available:
• Serial Port — Specifies which host serial port to use for your serial INDRT2 connection.
In the event that you do not specify a port, the default serial port for each supported host
operating system is listed below:
○ Windows — COM1
○ Linux — ttyS0
• Baud Rate — Specifies the serial port communication speed. The default baud rate is
9600.
Warning
Do not change the settings on the Debug tab unless you are instructed to
do so by Green Hills Technical Support.
64 MULTI: Debugging
Using the INDRT2 (rtserv2) Connection Editor
1. In the MULTI Project Manager, open the Top Project that came with your
BSP, or, if you already have an existing project for your BSP, open its Top
Project.
Each BSP contains example connections that you can customize for your own
use. These same connections are used by the Project Wizard for every project
created for that BSP.
2. In the MULTI Project Manager, select Connect → Connection Organizer.
3. In the Opened Connection Files list, select default.con.
66 MULTI: Debugging
Using Custom INDRT2 (rtserv2) Connection Methods
The appropriate commands for Custom INDRT2 Connection Methods are described
in the following sections.
4. Click Connect.
The syntax of the command that should be entered into the Start a Custom
Connection field is:
where:
Note
You can also issue the above connection command from the Debugger's
command pane, where it must be preceded by the connect command.
rtserv2 integrity1
To enable logging of communications between rtserv2 and your target, use the -log
option in your custom connection command. For example, to enable logging of the
example connection above, you would enter the following text in the Start a Custom
Connection field:
Note
Serial connections using rtserv2 are not supported on Solaris.
where:
68 MULTI: Debugging
Automatically Establishing Run-Mode Connections
• baud_rate sets the serial port communication speed. The default baud rate is
9600.
Note
You can also issue the above connection command from the Debugger's
command pane, where it must be preceded by the connect command.
To establish a serial connection on Windows, you might enter the following text in
the Start a Custom Connection field:
Note
Run-mode partnering is only supported if you are debugging an
INTEGRITY target and if you are connected to a GHS simulator or to
one of the GHS hardware debug solutions (Green Hills Probe or
SuperTrace Probe) via a freeze-mode connection. The run-mode partner
requires an Ethernet connection to the target, and is not triggered by
INTEGRITY until after the target has an IP address. (If your target is
using DHCP, the connection is not triggered if the target cannot
communicate with the DHCP server.)
70 MULTI: Debugging
The Set Run-Mode Partner Dialog Box
To modify the run-mode partner setting for your freeze-mode Connection Method,
perform one of the following actions:
• Select a freeze-mode connection in the target list, and choose Target → Set
Run-Mode Partner, or enter set_runmode_partner in the command pane.
(For information about the set_runmode_partner command, see “General
Target Connection Commands” in Chapter 17, “Target Connection Command
Reference” in the MULTI: Debugging Command Reference book.) Select or
create a run-mode Connection Method.
• Use the Connection Editor to edit the freeze-mode Connection Method. Select
the INTEGRITY or Connection tab, and enter the name of an existing
INDRT2/INDRT Connection Method in the text field labeled Run-Mode
Partner Connection. For information about the Connection Editor, see
“Configuring a Standard Connection with the Connection Editor” on page 44.
Tip
If you lose your INDRT2/INDRT connection, you can enter the command
connect -restart_runmode in the Debugger command pane to try to
reconnect. For more information, see the connect command in “General
Target Connection Commands” in Chapter 17, “Target Connection
Command Reference” in the MULTI: Debugging Command Reference
book.
The Set Run-Mode Partner dialog box contains the following options:
72 MULTI: Debugging
Disabling Automatically Established Run-Mode Connections
Alternatively, you can select the freeze-mode connection in the target list and enter
set_runmode_partner -none in the Debugger command pane. For information
about the set_runmode_partner command, see “General Target Connection
Commands” in Chapter 17, “Target Connection Command Reference” in the MULTI:
Debugging Command Reference book.
Troubleshooting
You may encounter the following problems while debugging via a simultaneous
freeze-mode connection and an INDRT2/INDRT (run-mode) connection to the
same target, regardless of whether or not the INDRT2/INDRT connection was
created automatically via the run-mode partner functionality, or whether or not the
freeze-mode and INDRT2/INDRT connections were created within the same
Debugger process.
For example, to create an ISIM connection that listens on port 3330 instead of port
2220, first configure a connection to the simulator:
74 MULTI: Debugging
Connecting to Multiple ISIM Targets
2. For the connection type, select the INTEGRITY simulator for your target. For
example, if you are using INTEGRITY for Power Architecture, choose
INTEGRITY Simulator for Power Architecture (isimppc).
3. Click Create. The Connection Editor will open.
4. Select the Debug tab. In the Other Options field enter:
-host_indrt_port 3330
For example, if you are using port 3330, enter rtserv2 in the Server field of the
Custom Connection Editor, and enter localhost:3330 in the Arguments field.
When using socket emulation for TCP/IP communications on an ISIM target, those
emulated socket ports may also conflict with other ISIM instances or with the host’s
reserved ports or running services. These ports can also be remapped. For more
information, see the documentation about ISIM socket port remapping in the
INTEGRITY Development Guide.
Contents
Introduction to rtserv and INDRT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Building in Run-Mode Debugging Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Connecting Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
INDRT Connection Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Chapter 5. INDRT (rtserv) Connections
When you are connected to rtserv, the target list displays all the tasks in the system.
Any user task in the target list can be selected and individually debugged.
Communication Media
An INDRT (rtserv) connection can be established over an IP network (typically
Ethernet) or a serial link. A BSP typically provides drivers to support an Ethernet
or serial device.
• Use a fast and reliable IP network (such as Ethernet) whenever possible for
better performance.
78 MULTI: Debugging
Building in Run-Mode Debugging Support
• For BSPs that support only one serial port, the port cannot be used for debugging
when it is being used for diagnostics. If the serial port is already in use, close
the terminal program used to view the serial port output before establishing
your run-mode connection.
• The baud rate at which a particular BSP communicates over a serial port varies.
For details, see the documentation that came with your BSP.
1. In the Project Manager, locate the .gpj file for the kernel within the project
(by default, myproject_kernel.gpj).
2. Right-click the file, and select Configure.
3. In the Settings for Kernel window that appears, select the Debugging check
box.
Connecting Overview
You can establish a debug server connection in any of the following ways. Each is
discussed in more detail in the section referenced.
For general instructions that explain how to create and use Connection Methods,
see Chapter 3, “Connecting to Your Target” on page 39. The information in the
following sections supplements the instructions provided there with information
that is specific to INDRT connections.
When the Connection Editor is first displayed after you create a new Connection
Method, the settings and options are set to default values. Settings and options that
are not available on your host operating system may appear dimmed. Some of the
fields may require user input before the Connection Method can be used.
80 MULTI: Debugging
Using the INDRT (rtserv) Connection Editor
Ethernet/IP Connection
Sets your desired connection type as Ethernet/IP. This radio button is mutually exclusive with
the Serial Connection button. If you select an Ethernet/IP connection (this is the default), the
following fields will also be available:
• Target Name or Address — Specifies the host name or IP address of your target. You
must specify a host name or IP address to create a valid Ethernet/IP connection.
• TFTP Load Directory — Specifies a load directory for dynamic downloading via TFTP.
This is the directory to which rtserv will copy a file before requesting a download. Enter
the name of your desired TFTP load directory or click Choose to browse to it. The specified
directory must be accessible by the TFTP server.
Note: If you need to connect to your target using a non-standard UDP port number (that is, not
2220), you must use a Custom Connection Method. See “Using Custom INDRT (rtserv)
Connection Methods” on page 86 for instructions.
Serial Connection
Specifies that a serial connection to the target should be used. This radio button is mutually
exclusive with the Ethernet/IP Connection button. If you select a serial connection, the
following option fields will also be available:
• Serial Port — Specifies which host serial port to use for your serial INDRT connection.
In the event that you do not specify a port, the default serial port for each supported host
operating system is listed below:
○ Windows — COM1
○ Linux — /dev/ttyS0
○ Solaris — /dev/ttya
• Baud Rate — Specifies the serial port communication speed. The default baud rate is
9600.
Warning
Use this tab carefully, since changing the advanced options from their
default settings can cause problems with your connection.
82 MULTI: Debugging
Using the INDRT (rtserv) Connection Editor
Warning
Do not change the settings on the Debug tab unless you are instructed to
do so by Green Hills Technical Support.
1. In the MULTI Project Manager, open the Top Project that came with your
BSP, or, if you already have an existing project for your BSP, open its Top
Project.
Each BSP contains example connections that you can customize for your own
use. These same connections are used by the Project Wizard for every project
created for that BSP.
2. In the MULTI Project Manager, select Connect → Connection Organizer.
3. In the Opened Connection Files list, select default.con.
84 MULTI: Debugging
Using the INDRT (rtserv) Connection Editor
Using TFTP
In releases of INTEGRITY prior to version 5, TFTP was used for fast dynamic
downloads. In INTEGRITY 5, fast downloads are accomplished via the built-in
INDRT protocol, and TFTP is no longer necessary. However, there may be situations
where you want to force the use of TFTP. To do so:
1. On the Connection tab of the Connection Editor, set the TFTP Load
Directory.
2. On the Advanced tab, select Always Use TFTP for Load.
3. Click OK or Apply.
86 MULTI: Debugging
Using Custom INDRT (rtserv) Connection Methods
This mode is useful when you want to establish an rtserv session without necessarily
knowing or caring whether the target is up yet (or if you tend to forget to boot a
target first).
Note
This is simply a method for delaying connection. Targets that go down
do not revert to the NOT CONNECTED status.
Contents
Installing Your Target Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Configuring Your Target Hardware for Debugging . . . . . . . . . . . . . . . . . . . . . . . 90
Specifying Setup Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Chapter 6. Configuring Your Target Hardware
This chapter describes how to set up your target hardware for use with MULTI.
This chapter is not relevant if you are connecting to a simulated target.
Certain target connections may have exceptions to these rules. For details, check
the MULTI: Configuring Connections book for your target.
A board setup script, along with required linker directives files that provide MULTI
with information about your target's memory map, are typically generated for you
when you create a new Top Project using the Project Wizard and Project Manager.
To create an example “Hello World” project for your target, follow the steps provided
in Chapter 1, “Creating a Project” in the MULTI: Managing Projects and
Configuring the IDE book. If you can build and download the example (see “Quick
Start: Building and Running Hello World” in Chapter 1, “Creating a Project” in the
90 MULTI: Debugging
Customizing MULTI Board Setup Scripts
MULTI: Managing Projects and Configuring the IDE book), the default board setup
script and linker directives file configured your target board properly and no
additional configuration is required. However, if you are using custom hardware,
or if you experience problems when downloading the program, you may need to
create or customize the setup script and/or customize the linker directives file in
use. The following sections provide customization guidelines and diagnostics that
you can use to make sure that these target resources are configured correctly.
Note
The following sections assume that you are using a MULTI board setup
script (.mbs). If you want to use a legacy setup script (.dbs) generated
by MULTI 4 or older, see “Specifying Setup Scripts” on page 99 and
the documentation about Green Hills debug server scripts and commands
in the MULTI: Configuring Connections book.
• The memory to be used for the download can be written to, and
• The processor (core) used for download is halted, under the control of the debug
server, and has interrupts disabled.
To edit a MULTI board setup script to make it suitable for your system:
1. Obtain your board and processor's documentation. You will need it to gather
information about memory resources, registers, interrupts, etc.
2. Double-click the default setup script in your target resources project to open
it in an editor. If there are multiple setup scripts, choose the one containing
the name of the debug server that supports your specific debugging interface.
For example, if you are using the mpserv debug server, which supports Green
Hills Debug Probe connections, the default setup script file is
mpserv_standard.mbs.
3. Determine whether your board can initialize itself, and then proceed as follows:
• If your target does not have a valid ROM image that initializes the target
upon reset, skip to the next step.
• If your target has a valid ROM image that initializes the target upon reset,
comment out the contents of the MULTI board setup script you are editing
by adding two forward slashes (//) to the beginning of each line. Replace
the script with the command sequence shown in the following (or with
an equivalent command sequence).
// Reset and halt the board
reset
// Let the ROM image run the target
c
// Give the ROM image 3 seconds to set up the board
wait -time 3000
// Halt the board to get ready for debugging
halt
Note
You may need to alter the wait command, depending on how
long your board takes to set itself up (for information about this
command, see Chapter 2, “General Debugger Command
92 MULTI: Debugging
Customizing MULTI Board Setup Scripts
If you need to initialize your board further, continue to the next step.
Otherwise, save the setup script and skip to “Customizing Linker
Directives Files” on page 98.
4. Verify that your setup script begins with a command that resets the target, such
as the MULTI Debugger reset command or the debug server target tr
command. (For information about these commands, see “General Target
Connection Commands” in Chapter 17, “Target Connection Command
Reference” in the MULTI: Debugging Command Reference book and the
documentation about probe commands in the Green Hills Debug Probes User's
Guide.)
Ensure that your target is halted before continuing initialization, or the state
of the target might be unpredictable.
5. Disable any interrupt sources that can disrupt the setup or destabilize the board's
memory. (For example, if you are using a PowerPC 860 processor, disable the
watchdog timer to prevent it from interrupting your target board setup.) The
following steps provide a general procedure for disabling interrupt sources:
a. Determine whether your processor has any interrupt sources that might
disturb your debugging session.
b. Using your processor's documentation, determine which registers affect
interrupt sources. Then determine the values those registers must have
to disable the interrupt sources.
c. Enter the commands necessary to configure your memory resources into
your setup script. See “Useful Commands for MULTI Board Setup
Scripts” on page 95.
6. Configure your target's memory controller based on your board's memory
resources. If your memory controller and memory resources are already
properly configured, skip to the next step. The following are general steps for
configuring memory using a setup script:
a. Determine what memory resources your board has by answering the
following:
• How fast and how big is the board's memory, and where do you want
to map it?
• Does the board have SRAM? If so, where is it?
• Does the board have DRAM? If so, where is it, and where is the
DRAM controller for it?
• Does the DRAM controller need refresh timing information or
knowledge of any special modes the DRAM chips may have, such
as Synchronous DRAM?
• Does the board require a peripheral memory base register to access
memory controllers or other on-chip peripherals?
Some commands cannot be tested individually because they must be executed within
a certain time period in relation to other commands. In this case, put the relevant
commands into a small script and run the script from the Debugger's command pane
using the < command, or type them in the same command line, separated by
semicolons (;). (For information about the < command, see “Record and Playback
Commands” in Chapter 15, “Scripting Command Reference” in the MULTI:
Debugging Command Reference book.)
94 MULTI: Debugging
Customizing MULTI Board Setup Scripts
To pass the output of a MULTI command to a debug server command, use the following syntax:
target command %EVAL{multi_command}
wait
Blocks command processing.
$register = value
Sets a register named register on your target board to value. For example:
> $ivor0 = 0x10
$register.field = value
Sets a field in register to value. For example:
> $CPSR.F = 1
If the name you specify for register is not a named register, MULTI creates a new variable using
the name provided. For example, the following command creates a new variable called $FOO
and sets its value to 6:
> $FOO = 6
You can also use C-style expressions for complex memory manipulation. For example:
> *((unsigned int *) 0x8000) |= 0x10
// Setup memory
memwrite 4 0xFF00017C 0xCFAFC004
memwrite 4 0xFF000168 0x00000000
...
96 MULTI: Debugging
Testing Target Access
After running this command, test that your target is correctly initialized by
performing the diagnostics documented in the following sections.
> $r1
3. Write a different value to the same register. For example:
> $r1=0xdeadbeef
4. Read the register again and see if it has changed to the new value.
For information about testing the ability of a Green Hills Probe or SuperTrace Probe
to access your target's registers, see the documentation about configuring target
resources in the Green Hills Debug Probes User's Guide.
1. If you have not run your setup script, enter setup in the Debugger's command
pane.
2. Select a location in memory where you plan to download a program (for
example, 0x8000).
5. Read the memory location again and see if it has changed to the new value. If
it has, the debugging interface is successfully accessing your target's memory.
Note
You can also use the graphical Memory Tester to test your target
memory. For more information, see Chapter 26, “Testing Target Memory”
on page 639.
For information about additional tests you can perform if you using a Green Hills
Probe or SuperTrace Probe, see the documentation about configuring target resources
in the Green Hills Debug Probes User's Guide.
By default, the Project Wizard sets the Program Layout setting for new
stand-alone program projects to Link to and Execute out of RAM.
Note
You can change the Program Layout for your project by right-clicking
the program in the Project Manager and selecting Configure.
98 MULTI: Debugging
Specifying Setup Scripts
1. In the Project Manager, double-click the linker directives file in your program's
project to open it in an editor.
2. Modify and save the edited linker directives file.
3. Select the project (.gpj) file in the Project Manager and click to rebuild it.
For more information, see the documentation about linker directives files in the
MULTI: Building Applications book.
• To run an .mbs setup script every time you connect using a particular Standard
Connection Method, specify the filename of the script in the Target Setup
script field of the Connection Editor for the Connection Method and select
the MULTI radio button immediately below the field.
If you are using a default Connection Method created by the Project Wizard,
the necessary setup script file for your processor-board combination (if
applicable) is specified automatically and the MULTI button will be selected.
• To run an .mbs setup script and connect to your target using a Custom
Connection Method:
○ If you are editing the Custom Connection Method using the Connection
Editor, specify the filename of the target setup script in the Target Setup
script field.
○ If you are entering the connection command using the Start a Custom
Connection field of the Connection Chooser, precede the debug server
command with the option setup=filename (where filename is the .mbs
setup script filename). Click Connect to continue.
• To run an .mbs setup script when connecting from the Debugger command
pane, use the following syntax:
where filename.mbs is the setup script filename, dbserv is the name of the
debug server to be used, and args and opts are appropriate arguments for your
debug server and target.
For more information about the connect command, see “General Target
Connection Commands” in Chapter 17, “Target Connection Command
Reference” in the MULTI: Debugging Command Reference book and Chapter 3,
“Connecting to Your Target” on page 39.
Note
Support for legacy (.dbs) setup scripts is deprecated and may be removed
in a future release.
The method for specifying a legacy (.dbs) setup script at the time of connection
varies depending upon the procedure you use to connect MULTI to your target.
The various methods are:
• To run a legacy setup script every time you connect using a particular Standard
Connection Method, specify the filename of the target setup script in the Target
Setup script field of the Connection Editor for the Connection Method. Select
the Legacy radio button immediately below the field.
• To run a .dbs setup script and connect to your target using a Custom Connection
Method:
○ If you are editing the Custom Connection Method using the Connection
Editor, include the -setup filename.dbs debug server option in the
Arguments field.
○ If you are entering the connection command using the Start a Custom
Connection field of the Connection Chooser, include the -setup
filename.dbs debug server option in the command you enter and click
Connect. For more information about connecting to your specific target
this way, see the appropriate debug server chapter in the MULTI:
Configuring Connections book.
• To run a .dbs setup script from the Debugger command pane, use the following
syntax:
where filename.dbs is the setup script filename, dbserv is the name of the
debug server to be used, and args and opts are appropriate arguments for your
debug server and target.
• (MULTI .mbs scripts) Run your setup script file manually from the Debugger
command pane using the < command. (For information about the < command,
see “Record and Playback Commands” in Chapter 15, “Scripting Command
Reference” in the MULTI: Debugging Command Reference book.)
• (MULTI .mbs scripts) Use the MULTI setup filename.mbs command. If this
command is used with a connection command, the setup script runs prior to
downloading and debugging. The setup command can also be used without a
specific script name if you are connected and specified a setup script when you
connected. The script you specified for the connection is run if you issue the
setup command with no specified file. For more information about the setup
command, see “General Target Connection Commands” in Chapter 17, “Target
Connection Command Reference” in the MULTI: Debugging Command
Reference book.
• (Legacy .dbs scripts) Use the target script filename.dbs command from the
Debugger command pane. (For more information, see the documentation about
Green Hills debug server commands in the MULTI: Configuring Connections
book.)
If you write a setup script with a comment on the first line containing the marker
MBS_OPT="early", the entire board setup script will be run once immediately
after you connect to your target instead of every time just before you download a
program. The comment should look similar to the following:
// MBS_OPT="early"
You can also add a hook to reset the board upon connecting, which causes your
reset hooks to run whenever you connect to the target with MULTI.
addhook -after connect { reset }
Lastly, you might decide to reinitialize a selected subset of the board circuitry every
time you download a program to one of the CPUs, while leaving the other CPUs
alone.
addhook -before download -core 0 { /* Core 0's initialization commands */ }
addhook -before download -core 1 { /* Core 1's initialization commands */ }
Contents
Chapter Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Associating Your Executable with a Connection . . . . . . . . . . . . . . . . . . . . . . . . 107
Preparing Your Target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Related Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Chapter 7. Preparing Your Target
Before you can run or debug a program on your target, you must download it to the
target's RAM, program it into the target's flash memory, or verify through the
Debugger that it is already present on the target. This chapter describes how you
can prepare your target to be debugged using one of these methods.
Chapter Terminology
This chapter uses terms that have specific meanings in the following sections. These
terms are defined in the list below:
For information about phrases that are used in the target list, see “Target
Terminology” on page 20. For information about statuses that appear in the target
list, see “The Status Column” on page 20.
To do so, select the executable in the target list and then perform one of the following
actions.
• Click the Connect button ( ). Using the Connection Chooser that appears,
connect to a target that contains a CPU compatible with the executable.
• Select Debug → Use Connection. The submenu that appears lists compatible,
currently active connections. If a connection appears dimmed, the current
executable cannot be associated with that connection. Select an Available
connection (if any) from the top of the menu, or select Create New Connection.
(Available indicates that the connection can accept more executables. Current
indicates that the connection is associated with the current executable. Full
indicates that using the connection will cause another executable to stop using
it. See “The Use Connection Submenu” on page 693.)
• In the Debugger command pane, enter the change_binding bind command.
The Connection Chooser prompts you to establish a connection. For more
information, see the change_binding command in “General Target Connection
Commands” in Chapter 17, “Target Connection Command Reference” in the
MULTI: Debugging Command Reference book.
After you perform one of the preceding operations, the executable is automatically
associated with the connection if only one compatible CPU exists on the target you
connected to. (This is usually the case.) If the selected executable is compatible
with more than one CPU on the target, the Use Which Connection/CPU? dialog
box appears. The following graphic is an example of the Use Which
Connection/CPU? dialog box for a multi-core QorIQ P3041 target connected via
a Green Hills Probe.
To disassociate the executable from the connection, select the executable and then
perform one of the following actions:
Note
All the menu items listed in this section are also accessible from the
shortcut menu that appears when you right-click an executable.
For more information about connecting, see Chapter 3, “Connecting to Your Target”
on page 39. For information about how items are arranged in the target list after
the executable is associated with the connection, see “The Target Column”
on page 19. For information about loading the executable on the target, see
“Preparing Your Target” on page 110.
Tip
To remove the deprecated mode=setting argument from a MULTI 4
Connection Method, edit and save the connection in MULTI 7.
If an executable that you would like to debug is already loaded onto your target,
open your executable in the Debugger and do one of the following:
Performing either of the preceding operations allows MULTI to assume that the
program loaded on your target is the same as the executable you opened. In the
target list, the <Direct hardware access> entry and your executable will merge
together, allowing you to run, halt, and/or step your target with reference to your
executable's source code in the source pane.
If you are connected via a Green Hills Probe, you can also disallow access to memory
(or specific areas thereof) with the ma command. For information about the ma
command, see the documentation about probe commands in the Green Hills Debug
Probes User's Guide.
• In the Debugger command pane, enter the prepare_target command. For more
information and options to this command, see “General Target Connection
Commands” in Chapter 17, “Target Connection Command Reference” in the
MULTI: Debugging Command Reference book.
Note
If you have not connected to a target, the Connection Chooser prompts
you to connect. If the selected executable is not automatically associated
with the connection, the Use Which Connection/CPU? dialog box
prompts you to pick a connection. For more information, see “Associating
Your Executable with a Connection” on page 107.
After you perform one of the preceding operations, MULTI either opens the Prepare
Target dialog box, which allows you to choose whether to download, flash, or
verify the executable, or MULTI prepares your target for you by automatically
executing one of these actions. For information about how MULTI determines
which action to execute automatically, see “Program Types” on page 113.
If you want to specify which action is performed (that is, you do not want MULTI
to automatically download, flash, or verify the executable), select the Prepare
Target menu item from the Debug menu or the right-click menu, or pass the -ask
option to the prepare_target command. If you prepare the target by another means
and at least one of the following items is true, MULTI automatically executes an
action:
• Only one action is appropriate and MULTI does not require input (such as the
text offset of a PIC program).
• The last time you prepared the target for the selected program, the option
Automatically use these settings for this program next time was selected
in the Prepare Target dialog box, and the program's memory layout has not
changed since then. (This option is selected by default.)
For more information about the Prepare Target dialog box, see the next section.
• Download to RAM — Writes the executable into RAM on your target. For
more information, see “Downloading Your Executable” on page 116.
○ Text Offset — Allows you to specify where the text section will be located
when the executable is downloaded. This option is only available for
programs using position-independent code. For more information, see
“Downloading Your Executable” on page 116.
○ Data Offset — Allows you to specify where the data section will be located
when the executable is downloaded. This option is only available for
programs using position-independent data. For more information, see
“Downloading Your Executable” on page 116.
• Program Flash ROM — Writes the executable into flash memory on your
target. For more information, see “Flashing Your Executable” on page 116.
• Program already present on target. Verify — Specifies that the executable
is already present in your target's memory. Depending on the Verify option
that you choose from the drop-down menu, MULTI may check to ensure that
the executable is on your target. For more information, see “Verifying the
Presence of Your Executable” on page 116.
• Automatically use these settings for this program next time — Remembers
the Prepare Target dialog box settings for this executable. If the settings
remain applicable, MULTI uses them automatically and does not open the
Prepare Target dialog box unless you request otherwise. For more information,
see “Preparing Your Target” on page 110.
The options that are available in the Prepare Target dialog box vary according to
the item you are debugging. For more information, see the next section.
When you are finished making your selections, click OK. MULTI prepares your
target.
Program Types
MULTI understands a number of general program types, and is able to determine
the action (download, flash, or verify) that should either be selected by default in
the Prepare Target dialog box or automatically executed (for more information,
see “Preparing Your Target” on page 110). The following sections provide specific
information about how MULTI determines a program's type, what each type means,
and what action MULTI defaults to for each type.
Note
If you are using an instruction set simulator, MULTI may determine that
Download to RAM is the only action possible, regardless of what
program type is detected. In this situation, all other options in the Prepare
Target dialog box are disabled, and even programs built to load from
ROM (that is, ROM run and ROM copy programs) should be
“downloaded.”
The Prepare Target dialog box defaults to Download to RAM for programs of
this type. No other option is generally applicable, though if the program has already
been downloaded to the target, it may be possible to verify that this is the case
instead of re-downloading. If you are debugging a native target or a Dynamic
Download INTEGRITY application, downloading is the only action possible. For
information about downloading, see “Downloading Your Executable” on page 116.
For information about verifying, see “Verifying the Presence of Your Executable”
on page 116.
Only RAM download programs can have position-independent code or data, and
if MULTI determines that either or both of those is present, the Text Offset and/or
Data Offset text fields are available for input and must be filled in. For more
information, see “Downloading Your Executable” on page 116.
MULTI determines that a given program has this type if the special symbols
__ghs_rombootcodestart and __ghs_rombootcodeend exist, and the symbols
__ghs_rambootcodestart and __ghs_rambootcodeend do not exist. (Note
that MULTI also searches for and uses various other special symbols, such as
__ghs_romstart, __ghs_romend, __ghs_ramstart, and __ghs_ramend, to
improve the debugging experience.)
If a program is of type ROM run, MULTI expects that the sections marked as
allocated in the program's ELF file should be loaded into the target's ROM. This is
generally achieved by programming the flash ROM on the target.
The Prepare Target dialog box defaults to Program Flash ROM for programs
of this type. Any of the Verify options may also be appropriate if the program has
already been programmed into the target's flash ROM. Downloading is generally
not applicable, unless the program is being run on a simulator (see “Program Types”
on page 113). For information about flashing, see “Flashing Your Executable”
on page 116. For information about verifying, see “Verifying the Presence of Your
Executable” on page 116.
MULTI determines that a given program has this type if the linker-inserted symbols
__ghs_rombootcodestart, __ghs_rombootcodeend,
__ghs_rambootcodestart, and __ghs_rambootcodeend exist. (Note that
MULTI also searches for and uses various other special symbols, such as
__ghs_romstart, __ghs_romend, __ghs_ramstart, and __ghs_ramend, to
improve the debugging experience.) If the special symbol __ghs_after_romcopy
exists, MULTI is able to restore software breakpoints in the RAM image of the
program after the ROM copy is completed.
If a program is of type ROM copy, MULTI expects that the sections marked as
allocated in the program's ELF file should be loaded into the target's ROM. This is
generally achieved by programming the flash ROM on the target.
The Prepare Target dialog box defaults to Program Flash ROM for programs
of this type. Any of the Verify options may also be appropriate if the program has
already been programmed into the target's flash ROM. Downloading is generally
not applicable, unless the program is being run on a simulator (see “Program Types”
on page 113). For information about flashing, see “Flashing Your Executable”
on page 116. For information about verifying, see “Verifying the Presence of Your
Executable” on page 116.
Unknown Programs
If MULTI is unable to determine anything about a program, the default action is
Download to RAM. For information about downloading, see “Downloading Your
Executable” on page 116.
When MULTI cannot detect any program information, it is generally the case that
something is wrong with the program or its debug information.
When the Download to RAM action is available and MULTI detects that your
program has been linked with position-independent code and/or data, the Text
Offset and/or Data Offset fields become available. These fields set the _TEXT and
_DATA system variables, which allow you to specify where the text and data sections
will be located when they are downloaded. If MULTI fails to detect that a program
contains position-independent code or data, you can manually set the offsets using
_TEXT and _DATA. For more information, see “System Variables” on page 323.
After you have flashed your executable to ROM, reset your target and perform any
other operations that are required for booting code from flash, such as interacting
with the ROM monitor.
Note
If you flash your executable to ROM by selecting Program Flash ROM
and Automatically use these settings for this program next time,
clicking the Prepare Target button ( ) or issuing the equivalent
command reflashes your target.
choose from the drop-down menu, MULTI may check to ensure that the contents
of target memory match the contents of the executable program file.
• Sparsely — Verifies a few bytes at the beginning, middle, and end of all
downloaded non-data sections that cannot be written to. The .text section is
an example of one such section. Because certain sections of memory, such as
.bss, .data, and .heap, may be written to during program execution, you
can expect them to differ from the executable program file. When you specify
this option, MULTI does not check these sections.
For information about downloaded sections, see the preceding bullet point.
• Not at all — Assumes, but does not verify that the contents of target memory
match the contents of the executable program file. This option does not halt
your target.
Related Settings
Memory sensitive mode is used when debugging targets whose memory can change
in ways unexpected to the Debugger or while examining memory-mapped I/O to
avoid unexpected memory references. Some ways that a target could cause such
unexpected changes are self-modifying code and references to dual-port memory
or memory-mapped I/O that can be changed in ways asynchronous to the program
execution.
• Memory in areas where executable code resides is read from the target. When
not in memory sensitive mode, MULTI assumes that executable code does not
change and uses the contents of the executable file when displaying disassembly
at such addresses.
• MULTI avoids reading more memory than necessary by only reading the
memory locations requested and by using the specified access size. When not
in memory sensitive mode, MULTI may cache some of the target memory by
reading 64-byte blocks, even if only a small part of memory is actually needed.
• Only one target instruction in the Debugger pane is read and displayed at the
current program location. If you want to expand the allowed range in which
the Debugger can display target machine instructions, set the system variable
$_VOLATILEDISPMAX to the approximate number of instruction bytes to
display.
The MULTI commands memread and memwrite can also be used to perform
precise memory references, even when not in memory sensitive mode. For
information about these commands, see “General Memory Commands” in Chapter
10, “Memory Command Reference” in the MULTI: Debugging Command Reference
book.
Note
We recommend that you disable automatic coherency checking when
you enable memory sensitive mode. For information about the memory
accessed by automatic coherency checking, see “Checking Coherency
Automatically” on page 665.
Note
Because the Debugger's memory cache is disabled when memory sensitive
mode is enabled, the Debugger may access target memory multiple times
for the instructions displayed in the source pane.
No stack trace mode disables call stack viewing and related functionality. You can
also select this mode by setting the system variable $_NOSTACKTRACE=1.
Call stacks and local variables on a call stack are not displayed because generating
a call stack could cause unexpected memory references in the case where the stack
pointer is either uninitialized or points to a nonstandard stack frame. As a
consequence of this, certain debugging features are also disabled. You can perform
instruction single-stepping, set and hit breakpoints, and start the target executing.
Other debugging functionality, such as stepping over function calls, returning from
function calls, and source-level single-stepping, is not supported in this mode. Once
the target's stack is correctly set up, you can enable stack traces and the related
Debugger features.
No stack trace mode is typically used in combination with memory sensitive mode
(“Memory Sensitive Mode” on page 117) although it can be selected independently.
Basic Debugging
Chapter 8
Contents
Starting and Stopping a Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Single-Stepping Through a Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Using Breakpoints and Tracepoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Single-Stepping: Advanced Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Breakpoint-Related Windows GUI Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Chapter 8. Executing and Controlling Your Program from the Debugger
This chapter explains how to use the MULTI Debugger to run a program on your
target. You can examine program details at different points during execution by
halting the process manually, single-stepping through the program, and setting
breakpoints.
A GUI reference for breakpoint-related windows appears at the end of this chapter.
The simplest way to run a program is to click on the MULTI Debugger toolbar.
The process executes and runs until it terminates successfully, encounters a serious
error, is halted manually, or hits a breakpoint.
For an overview of the information you can view about your program and target
during execution or while the process is halted, see “Viewing Program and Target
Information” on page 170.
Note
You can also control execution of a program—sometimes more
precisely—using Debugger commands. For more information, see Chapter
13, “Program Execution Command Reference” in the MULTI: Debugging
Command Reference book.
The and buttons allow you to step through your program, executing one
source line at a time. Both buttons execute the next single source line. The button
steps into function calls. It follows the execution of every individual instruction,
even when functions are called. Conversely, the button steps over function calls.
It does not step into called functions. If the program halts within a called function,
click to step out of the called function.
Note
You can also single-step through your program using Debugger
commands. For more information, see “Single-Stepping Commands” in
Chapter 13, “Program Execution Command Reference” in the MULTI:
Debugging Command Reference book.
specified location. Hardware breakpoint support varies by target type. For more
information, see “Working with Hardware Breakpoints” on page 134.
You can easily set both software and hardware breakpoints by clicking the breakdots
that appear in the Debugger source pane. For more information, see “Breakdots,
Breakpoint Markers, and Tracepoint Markers” on page 126.
On targets that use shared objects, MULTI supports breakpoints that are set in
shared object code. For more information, see “Working with Shared Object
Breakpoints” on page 137.
On some targets, you can also use tracepoints to collect debugging data without
halting your process. For more information, see Chapter 25, “Non-Intrusive
Debugging with Tracepoints” on page 621.
Note
The MULTI Debugger also supports Debugger Notes, which allow you
to attach notes to any line of code. Unlike breakpoints, Debugger Notes
do not halt your process or execute commands. For more information,
see Chapter 10, “Using Debugger Notes” on page 175.
By default, most breakdots in the source pane are green ( ). But you may also
encounter blue, red, or gray breakdots in the following situations:
• Blue breakdots ( ) — Indicate source lines for which the compiler generated
reordered code. For example, if you step through a function with blue breakdots
at the top, you will see that the program counter starts at the first green breakdot
and then goes backwards to the blue breakdots before continuing on to the rest
of the green breakdots. This can happen when the compiler delays the
initialization of variables for a function.
• Red breakdots ( ) — Indicate source lines that the linker removed during
link-time optimization. For example, the linker may use subroutine calls and
tail merges to remove redundant segments of code from object files. Because
this code has been removed, you cannot set breakpoints on these source lines.
Note
Link-time optimization is not available for all target processors. For
more information, see the MULTI: Building Applications book for
your target processor family.
• Gray breakdots ( ) — Indicate source lines for which the compiler has merged
the code associated with the line into another source line. This can happen
when a particular source statement appears multiple times within a function.
Because the code has been merged to a different source line, you cannot set
breakpoints on a line with a gray breakdot. If a breakpoint is set at a source
line where the code has been merged, it will be hit anytime the merged code
is executed.
When you set a breakpoint or tracepoint, you replace the breakdot with a breakpoint
or tracepoint marker. The following table describes these markers.
Tracepoint
If you set multiple software breakpoints on a source line, MULTI displays the
marker for the enabled breakpoint that was most recently set or modified. If none
of the breakpoints on the line are enabled, MULTI displays the marker for the
disabled breakpoint that was most recently set or modified.
Positioning your mouse pointer over a breakpoint or tracepoint marker displays the
properties of the breakpoint or tracepoint. Clicking an active breakpoint or tracepoint
marker clears the breakpoint or tracepoint and changes the marker back to a breakdot.
Clicking an inactive breakpoint or tracepoint marker enables the breakpoint or
tracepoint. For information about clearing and enabling multiple breakpoints and
tracepoints set on a single source line, see “Multiple Breakpoints and Tracepoints
on a Single Line” on page 828.
For more information about software breakpoints, see “Working with Software
Breakpoints” on page 130. For more information about hardware breakpoints, see
“Working with Hardware Breakpoints” on page 134. For more information about
tracepoints, see Chapter 25, “Non-Intrusive Debugging with Tracepoints”
on page 621.
as well as the actions you can perform from this window, see “The Breakpoints
Window” on page 147.
• Breakpoint list commands — You can enter breakpoint commands such as
B to print information about specific breakpoints, or all breakpoints, to the
command pane. For more information about the B command, see Chapter 3,
“Breakpoint Command Reference” in the MULTI: Debugging Command
Reference book.
Note
You cannot set software breakpoints in your target's ROM because
software breakpoint instructions cannot be inserted into read-only
memory. However, some targets support hardware breakpoints, which
can be used for debugging ROM. For more information, see “Working
with Hardware Breakpoints” on page 134.
MULTI denotes a software breakpoint in the source pane with a small red stop sign
( ).
To set a software breakpoint, click a green or blue breakdot; the breakpoint marker
replaces the breakdot. INTEGRITY users can see “Breakdots, Breakpoint Markers,
and Tracepoint Markers” on page 126 for more information about the type of
breakpoint set.
To move a software breakpoint, right-click the breakpoint marker and select Move
Breakpoint. For more information, see “Moving Software Breakpoints” on page 133.
Note
You can also set and delete breakpoints using breakpoint commands. For
a full description of these commands, see Chapter 3, “Breakpoint
Command Reference” in the MULTI: Debugging Command Reference
book.
If you set a breakpoint by clicking a breakdot, the breakpoint halts your process
every time the process reaches the line of code marked with the breakpoint. After
you have created a breakpoint, you can use the command pane or the Software
Breakpoint Editor to set parameters that associate conditions and commands with
the breakpoint. If you set any of these additional features, the breakpoint's stop sign
icon contains a symbol within it. Even if a breakpoint has more than one property,
only one of these icons is displayed. To view these unique breakpoint icons, see
the table in “Breakdots, Breakpoint Markers, and Tracepoint Markers” on page 126.
For more information about the software breakpoint parameters you can set, see
“Creating and Editing Software Breakpoints” on page 131.
After you have set a software breakpoint, you can add conditions and command
lists to it by using the Software Breakpoint Editor. To open a Software
Breakpoint Editor, do one of the following.
• In the Debugger source pane, right-click the breakpoint's stop sign icon and
choose Edit Breakpoint from the shortcut menu.
• Click the Breakpoints button ( ) to open the Breakpoints window, select
the Software tab, and double-click the breakpoint you want to edit. For
You can set and modify all the basic properties of a software breakpoint by using
the fields in this window, which are described in “Software and Hardware Breakpoint
Editors” on page 140.
Note
You can also set software breakpoints by entering breakpoint commands
in the Debugger command pane. For detailed information about these
commands, see Chapter 3, “Breakpoint Command Reference” in the
MULTI: Debugging Command Reference book.
The Software tab contains a list of your program's software breakpoints and their
properties. The information displayed for each breakpoint corresponds to the
breakpoint properties displayed in the Software Breakpoint Editor. For a
description of the columns and buttons that appear in the Breakpoints window and
the actions and shortcuts available from the window, see “The Breakpoints Window”
on page 147.
• You cannot move a breakpoint out of the current function in which it resides.
The number of hardware breakpoints you may set varies from target to target, but
it is usually fewer than four. Additionally, even targets and debugging environments
that support hardware breakpoints may not support all hardware breakpoint
capabilities. For information about how your target handles hardware breakpoints
if you are using a Green Hills Probe or SuperTrace Probe, see the documentation
about target-specific hardware breakpoint support in the Green Hills Debug Probes
User's Guide. For information about hardware breakpoints in specific debugging
environments, see “Hardware Breakpoints in Specific Environments” on page 829.
After you have created a hardware breakpoint, you can add conditions and command
lists to it by using the Hardware Breakpoint Editor. To open a Hardware
Breakpoint Editor, do one of the following:
• In the Debugger source pane, right-click a hardware breakpoint icon, and select
Edit Hardware Breakpoint from the shortcut menu.
• In the Debugger source pane, right-click a variable that has a watchpoint set
on it, and select Watchpoints → Edit Watchpoint.
• Click the Breakpoints button ( ), select the Hardware tab, and double-click
the breakpoint you want to edit.
• In the Debugger command pane, enter the edithwbp command. For information
about the edithwbp command, see Chapter 3, “Breakpoint Command
Reference” in the MULTI: Debugging Command Reference book.
You can set and modify all the basic properties of a hardware breakpoint by using
the fields in this window, which are described in “Software and Hardware Breakpoint
Editors” on page 140.
Note
You can also set hardware breakpoints by entering breakpoint commands
in the Debugger command pane. For detailed information about these
commands, see Chapter 3, “Breakpoint Command Reference” in the
MULTI: Debugging Command Reference book.
To view all hardware breakpoints and access them for editing, use the Hardware
tab of the Breakpoints window. To open the Breakpoints window, click the
Breakpoints button ( ) located on the toolbar. (For other ways to open the
The Hardware tab contains a list of all the hardware breakpoints in your program.
For a description of the columns and buttons that appear in the Breakpoints window
and the actions and shortcuts available from the window, see “The Breakpoints
Window” on page 147.
Breakpoints button ( ) located on the toolbar. (For alternative ways to open the
Breakpoints window, see “Viewing Breakpoint and Tracepoint Information”
on page 129.)
The Shared Object tab is only visible when breakpoints from an unloaded shared
object are available for display.
The Shared Object tab contains a list of all the shared object breakpoints in your
program. For a description of the columns and buttons that appear in the Breakpoints
window and the actions and shortcuts available from the window, see “The
Breakpoints Window” on page 147.
Note
To use the Debugger's command pane to list shared object breakpoints,
enter the B command. See the B command in Chapter 3, “Breakpoint
Command Reference” in the MULTI: Debugging Command Reference
book.
To view deleted breakpoints that you can restore, perform one of the following
actions:
From the Breakpoints Restore window, click the Software tab to view
restorable software breakpoints, the Hardware tab to view restorable hardware
breakpoints, and the Shared Object tab to view restorable shared object
breakpoints.
For complete usage information for the dz command, see Chapter 3, “Breakpoint
Command Reference” in the MULTI: Debugging Command Reference book. For
more information about the Breakpoints Restore window, see “The Breakpoints
Restore Window” on page 153.
You should not set Read and/or Write in conjunction with Execute.
This option is available in the Hardware Breakpoint Editor.
Because the bitwise AND operations cause the last 4 bits of the current
address and the breakpoint address to be 0000, MULTI triggers the hardware
breakpoint when your process accesses memory between addresses 0xCD0
(1100 1101 0000) and 0xCDF (1100 1101 1111).
The default mask is 0xFFFFFFFF, which specifies that the current address
must be identical to the specified breakpoint address.
This option is available in the Hardware Breakpoint Editor.
Rolling Allows MULTI to delete the breakpoint if MULTI needs the breakpoint's
resources. This option is not selected by default.
This option is available in the Hardware Breakpoint Editor.
• Task — The breakpoint stops the task that hits that breakpoint.
• System — The breakpoint stops the whole system.
• Task Group — The breakpoint stops all the tasks in the group
specified by the Group to Stop field.
If your target does not support these breakpoints, this setting is disabled
and cannot be modified.
This option is available in the Software Breakpoint Editor.
Type Specifies a type for the hardware breakpoint. The available settings for this
option are:
1. Performs a bitwise AND operation on the value mask and the hardware
breakpoint value.
2. Performs a bitwise AND operation on the value mask and the current
value of memory at the hardware breakpoint location.
3. Compares the results of these two operations. If the results are equal,
MULTI triggers the hardware breakpoint.
The default value mask is 0xFFFFFFFF, which specifies that the current
value must be identical to the specified breakpoint value.
MULTI verifies Value and Value Mask after verifying the address and
Mask.
This setting is only applicable to read/write hardware breakpoints and certain
targets and debug servers. If you set this field and it is not applicable in
your current environment, MULTI either returns an error or the system
ignores the setting. When used for reads and writes less than 32 bits in size,
the behavior of this field is target dependent. The behavior may also vary
between big- and little-endian targets.
This option is available in the Hardware Breakpoint Editor.
If your target does not support these breakpoint conditions, this setting is
disabled and cannot be modified.
This option is available in the Software Breakpoint Editor.
Note
Most of the actions you can perform from the Breakpoints window, you
can also perform by entering commands in the Debugger command pane.
For more information, see Chapter 3, “Breakpoint Command Reference”
in the MULTI: Debugging Command Reference book.
Column Description
Access The memory access type, which causes your process to trigger the hardware
breakpoint. Access types are:
Column Description
Hit by Identifies what must hit the breakpoint for the breakpoint to halt your
process:
• Any Task
• This Task
• Unattached Tasks
• Attached Tasks
• Group group_name
For information about these trigger types, see the description of When
Hit By in “Software and Hardware Breakpoint Editors” on page 140.
This column is available on the Software tab.
Label The label (if any) of the breakpoint. Breakpoint labels cannot contain
spaces or special characters.
This column is available on the Shared Object tab.
Location The location of the breakpoint in your program's code. For more
information, see “Using Address Expressions in Debugger Commands”
in Chapter 1, “Using Debugger Commands” in the MULTI: Debugging
Command Reference book.
This column is available on the Software and Hardware tabs.
Reached If MULTI is counting (this is the common case): the number of times your
process has hit the breakpoint.
If the target is counting the number of times the process hits the breakpoint
(for example, if you are using software breakpoints with a run-mode
connection to INTEGRITY version 10 or later): this column will show an
approximation of the number of times the breakpoint has been hit.
This column is available on the Software tab.
Shared Object The shared object that each breakpoint is set in.
This column is available on the Shared Object tab.
Stops Identifies what tasks halt when the breakpoint is hit:
Column Description
Task Identifies what must hit the hardware breakpoint for the breakpoint to halt
your process.
This column is available on the Hardware tab.
Button Action
Restore Deleted Opens the Breakpoints Restore window, which allows you to view
Breakpoints and restore breakpoints that have been removed during the current
MULTI debugging session. For more information about this window,
or
see “The Breakpoints Restore Window” on page 153.
Restore Deleted HW
This button is available on the Software, Hardware, and Shared
Breakpoints
Object tabs.
or
Restore Deleted SO
Breakpoints
Save Breakpoint List Opens a Save Breakpoints dialog box where you can choose a file in
which to save your program's currently set breakpoints. You can reload
the file later. Note that the Debugger may not be able to reload group
breakpoints. (See Load Breakpoint List above.)
This button is available on the Software tab.
Press Enter This action is possible on the Software and Hardware tabs.
Click the Active dot Toggles the state of the selected breakpoint between active and inactive.
See also the tog command in Chapter 3, “Breakpoint Command
Reference” in the MULTI: Debugging Command Reference book.
This action is possible on the Software, Hardware, and Shared Object
tabs.
Action Result
Right-click a Opens a shortcut menu. Available menu options are described in the
breakpoint following table.
This action is possible on the Software, Hardware, and Shared Object
tabs.
Press Delete Deletes the selected breakpoint(s).
This action is possible on the Software, Hardware, and Shared Object
tabs.
Note
Most of the actions you can perform from the Breakpoints Restore
window, you can also perform by using the dz Debugger command. For
information about this command, see Chapter 3, “Breakpoint Command
Reference” in the MULTI: Debugging Command Reference book.
Column Description
Command The command that was used to create the deleted breakpoint.
This column is available on the Software, Hardware, and Shared Object
tabs.
Label An identifier for use with the dz command (see Chapter 3, “Breakpoint
Command Reference” in the MULTI: Debugging Command Reference
book).
This column is available on the Shared Object tab.
Location The source location (if applicable) and address that the breakpoint existed
at.
This column is available on the Software, Hardware, and Shared Object
tabs.
Shared Object The shared object that the deleted shared object breakpoint was set on.
This column is available on the Shared Object tab.
Contents
Navigating and Searching Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Navigating, Browsing, and Searching the Source Pane . . . . . . . . . . . . . . . . . . 164
Viewing Program and Target Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Chapter 9. Navigating Windows and Viewing Information
This chapter describes how to navigate and browse MULTI Debugger windows.
• You can either use the scroll bar or enter the scrollcommand command to
scroll through your program. For more information about this command, see
Chapter 11, “Navigation Command Reference” in the MULTI: Debugging
Command Reference book.
• For information about navigating the source pane, see “Navigating, Browsing,
and Searching the Source Pane” on page 164.
Infinite Scrolling
In two situations, normal scrolling behavior is replaced by infinite scrolling. In this
mode, the thumb in the vertical scroll bar stays fixed in the middle of the scroll bar,
does not reflect the relative position of the display, and cannot be dragged to new
locations. The scroll thumb's appearance is also different. On Windows, the
Debugger sets the thumb at its minimum size. On Linux/Solaris, the Debugger
replaces the thumb with a diamond. You can still click above or below the thumb
or use the arrow keys to scroll up or down. Infinite scrolling occurs in the following
situations:
• When the Debugger displays only assembly code in the source pane. See
“Source Pane Display Modes” on page 24.
• In a Memory View window. See Chapter 15, “Using the Memory View
Window” on page 337.
Incremental Searching
You can perform incremental text searches in most MULTI debug windows. (In
some windows, you must select something before you can search.) To start an
After you press Ctrl+F or Ctrl+B and start typing, MULTI begins searching the
active window for the string of characters and highlights the first match it finds. If
subsequent keystrokes do not match the first selection, MULTI continues to search
the active window for an exact match. The search string appears to the right of
SSrch/Srch in the status bar. In most windows, the search starts with the text that
the window currently displays. In the source pane, the search begins at the current
line pointer.
To find the next or previous search match, press Ctrl+F or Ctrl+B again.
Incremental searches wrap around the entire text buffer of the window you are
searching. When the Debugger reaches the end or the beginning of the window
buffer, it beeps to indicate that it is about to wrap.
You can switch the search mode for a single search from case-insensitive to
case-sensitive by typing uppercase characters in the search string. To change the
default case sensitivity for all incremental searches in the current session, enter the
chgcase command in the Debugger command pane. For more information about
this command, see Chapter 16, “Search Command Reference” in the MULTI:
Debugging Command Reference book.
The following table summarizes the shortcuts and keystrokes available for
incremental searching.
Keyboard Effect
Shortcut
Ctrl+F Starts an incremental forward search or, if you have already started a
search, advances to the next matching pattern. If you have not started
searching and you press Ctrl+F twice, you resume the last search.
Ctrl+B Starts an incremental backward search or, if you have already started a
search, jumps backward to the previous matching pattern. If you have
not started searching and you press Ctrl+B twice, you resume the last
search.
Ctrl+U (while in Resets the search pattern.
search mode)
Keyboard Effect
Shortcut
Esc or Enter (while Ends the search. In source pane searches, the last match remains selected.
in search mode)
any_character Adds a character to the search pattern.
(while in search
mode)
Backspace (while Deletes the last character in the search pattern.
in search mode)
Note
You can also enter search commands in the command pane or use the
Source Pane Search dialog box to perform incremental searches in the
source pane. For more information, see Chapter 16, “Search Command
Reference” in the MULTI: Debugging Command Reference book and
“Using the Source Pane Search Dialog Box” on page 169.
If the source pane of an active Debugger window contains the following text:
this is a search string.
and you start a search by pressing Ctrl+F and typing the letter i, the Debugger
highlights the character i in the word this.
If you then type s, the Debugger highlights the two characters i and s in the word
this.
To jump to the next occurrence of the pattern is, press Ctrl+F again. The Debugger
selects the word is.
To search next for the pattern in, press Backspace to reset the search string to i,
and then type n. The Debugger highlights the characters i and n in string.
Searching in Files
The MULTI Debugger supports full-text searching of open files and, if debugging
information is available, of all the files that make up a program. To search your
source files, select Tools → Search in Files. A Search in Files dialog box appears.
Enter your search string in the text box or use the drop-down list to select recent
search strings. You can also select any of the following optional search criteria.
• Case sensitive — The search only finds text that matches the case of the search
string exactly. If this box is cleared, the search ignores case when searching
for a match. By default, this box is checked.
• Whole word — The search only finds text that contains the search terms as
words. This means that the matching string must be preceded by a non-word
character and followed by a non-word character, where word characters are
letters, digits, and the underscore. For example, if you select this check box, a
search for ice does not match slice or ice__, but it does match ice-9. This
box is cleared by default.
• Use Regular Expressions — The search treats the text you enter as a regular
expression. If this box is cleared, the search treats the text you enter as a fixed
string. By default, this box is checked.
After you have entered the search string and set the search criteria, click Search to
perform the search. A Search in Files Results window opens to show the search
progress. For a description of this window, see “Viewing Search in Files Results”
in Chapter 4, “Editing Files with the MULTI Editor” in the MULTI: Managing
Projects and Configuring the IDE book.
Note
To access the same Search in Files capability without using a GUI
interface, use the grep command. For more information about this
command, see Chapter 16, “Search Command Reference” in the MULTI:
Debugging Command Reference book.
Note
The Search in Files capability runs the BSD grep utility. A copy of BSD
grep is installed along with the MULTI IDE. However, BSD grep is not
part of MULTI and is not distributed under the same license as MULTI.
For more information about the license under which BSD grep is
distributed, refer to the file bsdgrep.txt, which is located in the copyright
subdirectory of the IDE installation directory. For information about the
search expression format that BSD grep uses, refer to the OpenBSD
re_format(7) man page.
The following table describes general conventions for selecting, cutting, and pasting
text in MULTI Debugger windows.
To Do this
Select text Use your mouse pointer to highlight text.
Copy text Select text, and press Ctrl+C.
Paste text Copy text, click in the spot where you want to paste the text, and press
Ctrl+V.
Deselect text Click in an area of the window without any text.
Note
On Windows, the copy and paste functions use the Windows clipboard,
so you can copy and paste text among any applications that use the
Windows clipboard.
• To select an item, single-click the row containing that item. This highlights the
row.
• To select multiple, non-adjacent items/rows, hold the Ctrl key while clicking
each item or row.
• To select a range of adjacent rows, click the first row, hold the Shift key, and
then click the last row in the range.
When selecting text in the source pane, you may find that the Debugger performs
a command as soon as you release the mouse button. To prevent the Debugger from
issuing a command, hold down the Ctrl key while selecting text. This also prevents
the Debugger from attempting to auto-complete your selection. Alternatively, you
can configure Debugger key bindings to prevent the Debugger from issuing
commands. See “Customizing Keys and Mouse Behavior” in Chapter 7,
“Configuring and Customizing MULTI” in the MULTI: Managing Projects and
Configuring the IDE book.
When you select text in the source pane, the Debugger automatically copies your
selection. To paste the selection into the command pane, middle-click in the
command pane. To enable this behavior on Windows, select Config → Options
→ MULTI Editor tab, and check Allow middle click to paste. In general, this
behavior is similar to selecting and pasting procedures on Linux/Solaris.
Note
On Windows, the automatic copy that the Debugger makes at the time
of selection only allows you to paste to the command pane. To copy text
and paste it into another window, highlight the text and press Ctrl+C to
copy it. Then press Ctrl+V to paste it into another window.
View the code one level higher on the call • Press Ctrl++ (plus sign).
stack • Click .
• Select View → Navigation → UpStack.
View the first function higher on the call • In the command pane, enter the uptosource
stack that has source code (for example, if command. For information about the
you are stopped inside a library function with uptosource command, see Chapter 11,
no source code and you want to return to “Navigation Command Reference” in the
viewing your program) MULTI: Debugging Command Reference
book.
• Select View → Navigation → UpStack To
Source.
Navigate to a specific file, function, line • In the command pane, enter the e command
number, breakpoint, or other location followed by an address expression. For
information about the e command, see
Chapter 11, “Navigation Command
Reference” in the MULTI: Debugging
Command Reference book.
• On the navigation bar, use the File Locator
to navigate to a file. See “Using the File
Locator” on page 166.
• On the navigation bar, use the Function
Locator to navigate to a function. See
“Using the Function Locator” on page 167.
• Select View → Navigation → Goto
Location and enter an appropriate location
in the dialog box.
To Do this
View the full name Move the cursor over the File Locator. The file path appears in a tooltip.
and path of the
displayed file
Navigate to another Type the name of the file in the File Locator and press Enter. If the name
source file in your you type is of a valid source file that was compiled into your program,
program the Debugger navigates to the file and displays it in the source pane. If
the name you type does not match a filename exactly, the Debugger
displays a file whose name begins with the name that you typed, or if
there is more than one match, it displays a list of files.
If you do not remember the exact name of the file you are looking for,
use a wildcard (see “Wildcards” on page 314). For example, if you know
that a file's name contains the word sort, enter *sort* in the File Locator
to browse a list of all the files in your program that contain the word sort
in their names. If only one file in your program matches the pattern that
you type, the Debugger displays that file immediately. You can use any
number of wildcard characters in your search. Wildcard searching is not
case-sensitive.
View a file recently Click the arrow on the right side of the File Locator to open a drop-down
displayed in the list of recently viewed files. The File Locator sorts the files according to
source pane when you last viewed them, with the currently displayed file at the top
of the list. To display a file in the source pane, select it in the list.
To Do this
Browse a list of all Do one of the following:
the files in your
program • In the command pane, enter the browse files command. For
information about the browse command, see “General View
Commands” in Chapter 21, “View Command Reference” in the
MULTI: Debugging Command Reference book.
• Click the arrow on the right side of the File Locator and select
Browse all source files in program from the list that appears.
• Select Browse → Files.
Performing any of the above actions opens a Source Files with Functions
window. To display a file in the source pane, click the name of the file
in the list.
To Do this
View the full name Move the mouse pointer over the Function Locator. The full name and
and signature of the signature appears in a tooltip. Full signature display is only available for
displayed function C++ functions. The return type of the function is not included in the
signature display.
To Do this
Navigate to another Type the name of the function in the Function Locator and press Enter.
function in your If the name you type is of a valid function that was compiled into your
program program, the Debugger navigates to the function and displays it in the
source pane. If the name you type does not match a function name exactly,
the Debugger displays a function whose name begins with the name that
you typed, or if there is more than one match, it displays a list of functions.
If you do not remember the exact name of the function you are looking
for, use a wildcard (see “Wildcards” on page 314). For example, if you
know that a function's name contains the word sort, enter *sort* in
the Function Locator to browse a list of all the functions in your program
that contain the word sort in their names. If only one function in your
program matches the pattern that you type, the Debugger displays that
function immediately. You can use any number of wildcard characters
in your search. Wildcard searching is not case-sensitive.
View a function Click the arrow on the right side of the Function Locator to open a
recently displayed drop-down list of recently viewed files. The Function Locator sorts the
in the source pane functions according to when you last viewed them, with the currently
displayed function at the top of the list. If more than one function is visible
in the source pane, the name of the function pointed to by the blue current
line pointer is displayed.
Browse a list of all Click the arrow on the right side of the Function Locator and select
the functions in the Browse functions in current file from the list that appears. The
displayed file Functions: current_file window opens. To display a function in the
source pane, click the name of the function in the list.
Browse a list of all Do one of the following:
the functions in
your program • In the command pane, enter the browse funcs command. For
information about the browse command, see “General View
Commands” in Chapter 21, “View Command Reference” in the
MULTI: Debugging Command Reference book.
• Click the arrow on the right side of the Function Locator and select
Browse functions in program from the list that appears.
• Select Browse → Functions.
See also the indexnext and indexprev commands in Chapter 11, “Navigation
Command Reference” in the MULTI: Debugging Command Reference book.
• In the command pane, enter the dialogsearch command. For information about
the dialogsearch command, see Chapter 16, “Search Command Reference” in
the MULTI: Debugging Command Reference book.
• From the main Debugger window, select Tools → Search.
• Use the Ctrl+Shift+F keyboard shortcut.
To search:
1. Enter the text you are searching for in the Find field.
2. Use the radio buttons to specify the direction of the search (Forward or
Backward), the case sensitivity of the search (Exact Case or Ignore Case),
and the type of search (Normal or Regular Expression). The default settings
are Forward, Exact Case, and Normal.
3. Click Find.
MULTI highlights the first match of the search string in the source pane. To find
the next match, click Find again. The search wraps at the end of the source file if
you are searching forwards, and at the beginning if you are searching backwards.
Note
You can also search the source pane incrementally by using simple
keyboard shortcuts (see “Incremental Searching” on page 158) or by
entering the fsearch or bsearch commands in the command pane. For
information about these and about other commands that allow you to
search from the command pane, see Chapter 16, “Search Command
Reference” in the MULTI: Debugging Command Reference book.
Breakpoints window
Displays and allows you to configure software breakpoints, hardware breakpoints, and tracepoints.
To open this window, click the Breakpoints button ( ).
For more information about the contents and features of this window, see “The Breakpoints
Window” on page 147.
Browse window
Allows you to browse information about functions, global variables, source files, data types,
and cross references.
To open this window, select Functions, Globals, Files, or All Types from the Browse menu.
For more information, see “The Browse Window” on page 224.
Call Stack window
Lists the functions currently on the call stack. In addition to naming each function, this window
provides the name and value of each argument.
To open the Call Stack window, click the Call Stack button ( ).
For more information, see “Viewing Call Stacks” on page 394.
Data Explorer window
Displays one or more variables along with their values.
To open a Data Explorer window, double-click a variable in the source pane. The variable may
be of any type, whether an integer, structure, array, or class. Alternatively, click the Locals
button ( ) to open a Data Explorer displaying information about variables local to the current
function.
Double-clicking a variable in the Data Explorer opens a new Data Explorer displaying the
variable.
For more information about the Data Explorer, see Chapter 11, “Viewing and Modifying
Variables with the Data Explorer” on page 185. For more information about viewing variables,
see “Viewing Variables” on page 306.
Graph View window
Displays an include file dependency graph.
To open the Graph View window, select Browse → Includes.
For more information, see “The Graph View Window” on page 256.
Memory Test Wizard
Helps you perform memory test operations.
To open this window, select Target → Memory Test.
For more information, see Chapter 26, “Testing Target Memory” on page 639.
Process Viewer
Linux/Solaris only
Lists processes on your target.
To open this window, enter the top command. For information about this command, see “General
View Commands” in Chapter 21, “View Command Reference” in the MULTI: Debugging
Command Reference book.
Profile window
Reports performance and coverage analysis profiling data.
To open this window, select View → Profile.
For more information, see “Viewing Profiling Data in the Profile Window” on page 373.
Register Information window
Displays detailed information, including bitfields and documentation, about a specific register.
To open this window, enter the regview command followed by a register name. For information
about this command, see “General View Commands” in Chapter 21, “View Command Reference”
in the MULTI: Debugging Command Reference book.
For more information, see “The Register Information Window” on page 278.
Register View window
Displays current register values.
To open this window, click the Registers button ( ).
For more information, see Chapter 13, “Using the Register Explorer” on page 261.
Serial Connection Chooser window
Allows you to interact with a serial terminal.
To open this window, select Tools → Serial Terminal → Make Serial Connection.
For more information, see Chapter 27, “Establishing Serial Connections” on page 667.
Task Manager
Debug servers that support multitasking debugging only
Displays the current status of tasks running on an operating system.
To open this window, select View → Task Manager.
For more information, see “The Task Manager” on page 520.
Tree Browser
Displays information about classes, static calls, and file calls in the target program.
To open this window, select Classes, Static Calls, or File Calls from the Browse menu.
For more information, see “The Tree Browser Window” on page 249.
For information about viewing variables, see “Viewing Variables” on page 306.
When you click a pointer, the command pane also displays the value of the
object pointed to. When you click a structure, the command pane displays the
whole structure, with every structure or class element labeled.
• To evaluate an expression, type it into the command pane. For more information
about evaluating and working with expressions, see Chapter 14, “Using
Expressions, Variables, and Function Calls” on page 299.
Tip
You can also use Debugger commands to print a variety of program and
target information to the command pane. For detailed information, see
Chapter 8, “Display and Print Command Reference” in the MULTI:
Debugging Command Reference book.
Contents
Creating and Editing Debugger Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
Organizing Debugger Notes Into Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Viewing Debugger Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Chapter 10. Using Debugger Notes
This chapter describes how to create, edit, and access Debugger Notes.
Debugger Notes allow you to associate notes with any line of source or assembly
code. You can quickly jump to any part of your program where you have set a Note.
It is also possible to use breakpoints to mark parts of your program that are of
particular interest. Debugger Notes, however, have the following advantages over
breakpoints when marking locations:
• You can set Debugger Notes on source lines that do not have code associated
with them, such as comments.
• You can simultaneously edit multiple Debugger Notes.
• You can organize Debugger Notes into groups.
• If you rebuild your program, Debugger Notes are not deleted—even when they
are no longer in a valid location. In addition, if the line of source code where
you set the Debugger Note moves, the Debugger Note relocates automatically.
• You can quickly display and navigate to any Debugger Note by pressing the
F12 key.
• Enter the noteedit command in the Debugger command pane. For more
information about this command, see Chapter 7, “Debugger Note Command
Reference” in the MULTI: Debugging Command Reference book.
The following table explains each property you can set from this window.
Name Assigns a name to the Debugger Note. The Note Browser and Note listings
display this name. If you do not specify a name when you create a new Note,
MULTI uses a brief version of the Note location as the default name.
Group Specifies the name of the group where the Debugger Note is located. A Debugger
Note must always exist in exactly one group. To put the Note in a group that
already exists, select a group from the drop-down list. To create a new group,
type the new group name in the Group field.
Location Specifies the location of the Debugger Note. This may be either an address
expression or a source line. For information about using an address expression
to specify a location, see “Using Address Expressions in Debugger Commands”
in Chapter 1, “Using Debugger Commands” in the MULTI: Debugging Command
Reference book.
Text Assigns text to the Note.
The buttons in this window allow you to perform the actions listed in the following
table.
Delete Deletes the Note displayed in the window. A dialog box asking you to confirm
the deletion appears.
Go To Navigates to the displayed Note.
Close Closes the window, saving any changes you made to the Note. If the Note location
is not valid, a warning message appears.
1. Select View → Debugger Notes or enter the noteview command to open the
Note Browser. For information about the noteview command, see Chapter 7,
“Debugger Note Command Reference” in the MULTI: Debugging Command
Reference book.
2. Select List from the Style drop-down box.
3. Highlight more than one Debugger Note, right-click, and select Edit from the
menu that appears.
In the Edit Multiple Notes window, use the Text drop-down list to set whether
text should be appended or prepended to the selected Notes. Enter the desired text
in the field underneath the Text drop-down. When you click the Close button, the
text you entered is added to the text of all the Notes listed in the Name field.
Each Debugger Note you create always exists in exactly one group. If no groups
exist when you create a Note, MULTI creates a new group called <default> to
hold the Note. This group becomes the active group, which indicates that any Note
you create is put into this group by default.
To add a Note to a group that is not the active group, you must either:
To list all your program's Debugger Notes in the command pane, enter the notelist
command. To list all your program's Debugger Notes in the Note Browser, select
View → Debugger Notes or enter the noteview command. For information about
these commands, see Chapter 7, “Debugger Note Command Reference” in the
MULTI: Debugging Command Reference book.
The list style display presents all Debugger Notes in a list format in which you can
expand or collapse groups.
To view the list style display, select List from the Style drop-down box. To edit
multiple Notes and to directly modify a group name, use the list style display. For
more information, see “Editing Multiple Debugger Notes” on page 178.
In this display, MULTI highlights the active group in green to indicate that it adds
Notes to this group by default. Clicking a Note navigates to that Note in the
Debugger window.
The full report style display presents all Debugger Notes in report format. Full style
display shows the Note's name, location, and text. This display allows you to search
easily through Note text by using the incremental search capability (Ctrl+F and
Ctrl+B). For more information, see “Incremental Searching” on page 158.
To view the full style display, select Full from the Style drop-down box.
In this display, the Edit button ( ) is always disabled. The Group field, located
in the upper-right corner of the window, determines whether the Notes from all
groups are displayed or only those Notes from a particular group. The Group field
also determines whether the Set Active Group button ( ) is enabled. Choose from
the Group drop-down list according to your preferences.
The following table describes the buttons available in the Note Browser window.
Button Action
Opens a previously saved Debugger Note list from the file you choose. For more
information, see the notestate command in Chapter 7, “Debugger Note Command
Reference” in the MULTI: Debugging Command Reference book.
Saves the current list of Debugger Notes to the file you choose. For more
information, see the notestate command in Chapter 7, “Debugger Note Command
Reference” in the MULTI: Debugging Command Reference book.
Prints the current view.
Creates a new Debugger Note at the line selected in the Debugger window.
Allows you to edit the selected Note(s) or group. This button is disabled if you
select both a Note and a group. It is also disabled in full style display. For more
information, see the noteedit command in Chapter 7, “Debugger Note Command
Reference” in the MULTI: Debugging Command Reference book.
Deletes the selected Notes and/or groups. For more information, see the notedel
command in Chapter 7, “Debugger Note Command Reference” in the MULTI:
Debugging Command Reference book.
Button Action
Sets the active group, to which Notes are added by default if you do not specify
a group. This option is disabled if you select the active group.
Viewing Debugging
Information and Program
Details
Chapter 11
Contents
Opening a Data Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
The Data Explorer Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Types of Variable Displays in a Data Explorer . . . . . . . . . . . . . . . . . . . . . . . . . 191
Viewing Multiple Variables in a Data Explorer . . . . . . . . . . . . . . . . . . . . . . . . . 197
Filtering Data Explorer Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
Navigating Complex Data Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Updating Data Explorer Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Freezing Data Explorer Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Setting Watchpoints on Data Explorer Variables . . . . . . . . . . . . . . . . . . . . . . . . 203
Modifying Variables from a Data Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Changing How Variables are Displayed in a Data Explorer . . . . . . . . . . . . . . 204
Configuring Data Explorers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Data Explorer Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Data Explorer Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
Chapter 11. Viewing and Modifying Variables with the Data Explorer
The Data Explorer is a graphical tool that displays variables of any type in a number
of different formats. You can modify the values of variables from a Data Explorer.
For more information about the view command, see “General View Commands”
in Chapter 21, “View Command Reference” in the MULTI: Debugging
Command Reference book.
1
Viewing expressions with side effects (such as x++) is not recommended. Side effects will occur whenever the Debugger
evaluates the expression, which it may do several times each time the Data Explorer is updated, and at other times as well.
This can lead to unpredictable behavior in the Data Explorer.
If a Data Explorer is already open when you perform any of the preceding actions,
the variables you specified appear in the existing Data Explorer.
To close a Data Explorer, press Ctrl+Q or select Edit → Close. Enter the viewdel
command to close all Data Explorers associated with the active Debugger window.
This command also closes Browse, Register View, Memory View, Call Stack,
and Breakpoints windows. For more information about the viewdel command, see
“General View Commands” in Chapter 21, “View Command Reference” in the
MULTI: Debugging Command Reference book.
• The Star column (the unlabeled, left-most column by default) allows you to
control which variables are displayed in the Data Explorer. For more
information, see “Filtering Data Explorer Variables” on page 198.
• The WP column allows you to set, toggle, and delete watchpoints. For more
information, see “Setting Watchpoints on Data Explorer Variables” on page 203.
• The Variable column displays the names of variables, types, members, or
expressions in an expandable tree format. Context-sensitive arrows allow you
to quickly navigate complex data structures (see “Navigating Complex Data
Structures” on page 200). Numbers preceding variable names indicate call stack
depth. For example, 2: myval indicates that the variable myval is two stack
levels up from the current program counter.
• The Value column displays values when applicable.
See also the description of Show in “The View Menu” on page 212.
To reorder columns:
Column visibility and order are remembered within and across sessions.
• Only show starred items ( ) — Hides all Data Explorer items except those
that are starred and those that have a starred ancestor or descendant. For more
information, see “Filtering Data Explorer Variables” on page 198.
• Undo ( ) — Undoes your last action. Click Undo once for each action you
want to undo. The Undo button appears dimmed when you reach the point at
which no more actions can be undone.
This button is only available for certain operations. The most common
operations you can undo are deleting variables from a Data Explorer, making
This button is only available after you have undone certain operations. The
most common operations you can redo are deleting variables from a Data
Explorer, making arrays, casting variables to a different type, rerooting
members, and dereferencing pointers.
Click the Freeze button again to reactivate the variable. When the variable is
unfrozen, the Data Explorer updates it every time your process stops. For more
information, see “Freezing Data Explorer Variables” on page 202.
• Refresh Unfrozen Items ( ) — Refreshes all the variables in the Data
Explorer that are not frozen. If necessary, the Data Explorer halts the process
to refresh the data and then resumes it.
• Dereference Pointer ( ) — Displays the actual value, rather than the address,
of the variable a pointer points to. This button is only available if the selected
variable is a pointer.
• Cast Type — Casts the selected variable to the newly specified type. Specify
a new type by entering a valid type in the text field. Press Enter to see your
change take effect. If you enter an invalid type, your text appears red and no
change occurs.
The Undo button ( ) becomes available after you change a variable's type.
Click the Undo button to return to the previous type.
The Cast Type entry is automatically selected when you click a variable in the
Variable column.
• Edit Value — Edits the value of the selected variable. Define a new value by
entering a valid number, string, or enumeration in the text field. Press Enter
to see your change take effect. If you enter an invalid value, your text appears
red and no change occurs.
The Edit Value entry is automatically selected when you click in the Value
column.
• Array Bounds — Specifies the range of elements to display. In the text boxes,
enter the indexes with which you want to begin and end the array. Press Enter
to see your changes take effect.
The Undo button ( ) becomes available after you change array bounds. Click
the Undo button to return to the previous view.
The Array Bounds entry is automatically selected when you click an array in
the Variable column.
Displaying Structures
The following graphic displays a Data Explorer showing a structure named my_tree.
It was generated with the view my_tree command.
In this example, the name of the displayed variable is my_tree, and its type is
struct tree_node. This structure contains five fields, which each appear on
separate lines: language, word, id, left, and right. These fields are in Natural
format. The Data Explorer dereferences pointers to simple items and shows the
value of the item pointed to.
Note
In C++, the Data Explorer marks member variables stored by reference
with an “@” preceding the address.
In this example, there are five local variables: param is a parameter to the function;
name, age, and color are ordinary local variables; and p is a pointer to a structure
containing three fields. These variables are shown in a local variable view—a tree
in the Data Explorer containing local variables headed by a node labeled $locals$.
There are two types of local variable views. One tracks the current function, as
shown above. The current function is the function where the program counter (PC)
pointer is located. If the PC pointer moves to a new function or if you move up or
down the call stack (for example, by clicking or or by clicking a function in
the Call Stack window), the local variable view will display local variables for that
new function. For information about the PC pointer, see “The Source Pane”
on page 22.
The other type of local variable view, which you can access by using the command
view number:$locals$, is fixed to a specific stack frame. Instead of tracking the
current function, this type of local variable view shows local variables from the
function whose stack frame you selected. The stack frame does not change when
the program counter (PC) moves to a new function.
For C++ instance methods, the local variable view also displays information about
the this pointer.
The Expand As Container dialog box opens. This dialog box gives you the
following choices for how to display your data type:
After you specify a visualization for the data type, MULTI displays all variables of
that type as a container of elements. To display more element rows, select View →
Show More Elements. To display fewer rows, select View → Show Fewer
Elements. To display all element rows, select View → Show All Elements.
To stop viewing the type as a container, select a variable of that type in a Data
Explorer, and then select View → Stop Viewing as Container. You may also
temporarily disable the capability of viewing the type as a container. To do so, select
a variable of that type in the Data Explorer and then select Format → Format
Container, clearing the Format Container option.
Note
In addition to lists, you can also format other containers or structures as
containers of elements. For more information, see Appendix E, “Creating
Custom Data Visualizations” on page 767.
You can also use the viewlist command to display the elements in a linked list
structure. Entering this command is helpful if you are trying to view a few elements
in the middle of the linked list. However, the display this command creates often
takes up more space than the container display and can be redundant unless you
select View → Stop Viewing as Container first. In addition, you must specify
exactly how many elements you want to view, whereas you can simply select the
Show More Elements, Show Fewer Elements, and Show All Elements menu
items in the container display. For more information about the viewlist command,
see “General View Commands” in Chapter 21, “View Command Reference” in the
MULTI: Debugging Command Reference book.
Displaying Arrays
The following graphic displays an array in a Data Explorer. It was generated with
the view bat command, where bat is an array of 4 integers.
The Data Explorer shows each element of an array on a separate line. The indices
appear in the Variable column and the values of each element appear in the Value
column.
• Select a variable in the Data Explorer and then select Format → Make Array.
Each subsequent time you select Format → Make Array, the size of the array
increases by ten (10).
• Select a variable in the Data Explorer and then select Cast Type from the edit
bar. (If you select the variable from the Variable column, Cast Type is
automatically selected.) Enter any valid type followed immediately by a number
enclosed in square brackets.
type[number]
To view a C or C++ character pointer as an array, select the pointer, ensure that
Settings → Automatically Dereference Pointers is enabled (the default), and then
select Format → View Alternate. You may have to click the plus icon to see
individual elements.
You can also change the size of a selected array by editing the number that appears
in square brackets when Cast Type is selected in the edit bar.
To change the bounds of a selected array, choose Array Bounds from the edit bar.
(If you selected the array from the Variable column, Array Bounds is automatically
selected.) Then enter the indices with which you want to begin and end the array.
Press Enter to see your change take effect.
MULTI can display C++ class types, base class types, and virtual base class types
in a Data Explorer. The Data Explorer displays static members of a class inside
square brackets. It displays members of an anonymous union in an unnamed tree.
When you double-click a variable in the source pane or enter the view command
followed by a variable, MULTI opens a Data Explorer displaying information about
that variable. Information about each additional variable you specify—either by
double-clicking in the source pane or by entering the view command—is added to
the existing Data Explorer. For more information about the view command, see
“General View Commands” in Chapter 21, “View Command Reference” in the
MULTI: Debugging Command Reference book.
If you double-click a variable in the source pane more than once or if you enter the
view command to specify the same variable more than once, the variable appears
in the same Data Explorer multiple times. You can freeze one instance of the variable
and leave the other unfrozen to display the same variable at different points in the
process. For information about freezing variables, see “Freezing Data Explorer
Variables” on page 202.
You can drag variables from the Debugger's source pane or from another Data
Explorer into an open Data Explorer. If you drag a variable from the source pane,
MULTI copies it into the Data Explorer. If you drag a variable from another Data
Explorer, MULTI moves the variable into the specified Data Explorer and removes
it from its original location.
Star filtering is most useful when you are debugging an application that involves
data structures with many fields, or complex functions with many local variables.
Often, only a few of those fields or local variables are relevant to the problem you
are debugging; star filtering makes it easier to find them. Because the Data Explorer
does not read hidden items from target memory when refreshing, using star filtering
can also improve performance—particularly if you have a slow debug connection.
To filter out all items except those that are starred and those that have a starred
ancestor or descendant:
• Click the toolbar button (Only show starred items) until it appears to be
pushed down.
The number of items that have been filtered out are displayed in a message at the
bottom of the Data Explorer.
If star filtering is enabled and you add an item to the Data Explorer (by issuing the
view command, for example), the item is automatically starred so that it is not added
invisibly.
To unstar an item:
When you first open the Data Explorer, star filtering is disabled. In other words,
the state of the toolbar button (Only show starred items) is not remembered.
However, the star setting for an individual item is remembered if the item is:
• A field in a structure,
• A field in a class, or
• A local variable in a Data Explorer local variable view (see “Displaying Local
Variables” on page 191).
Structure field starring is implemented and remembered based on the structure type
name and the field name. For example:
struct foo {
int a;
int b;
} foo1, foo2;
If you view foo1 (by issuing the command view foo1, for example), star a, and
then view foo2, a is automatically starred in foo2. If you subsequently close the
Debugger, launch it again on the same program, and view either foo1 or foo2, a
is automatically starred.
Automatic starring occurs when an item is added to the Data Explorer, so if you
view foo1 and foo2 (by issuing the command view foo1, foo2, for example), and
then star a in foo1, a is not automatically starred in foo2. However, if you remove
foo2 from the Data Explorer and then add it back, a is automatically starred in
foo2.
Local variable starring is implemented and remembered based on the function name
and variable name. For example:
int add(int a, int b) {
return a + b;
}
int main() {
int a, b;
a = add(3, 4);
b = add(2, 4);
return multiply(a, b);
}
If you view local variables (by issuing the localsview command, for example), step
into the first call to add(), star a, and step out of add() into main(), a is no longer
starred because you starred a in add(), not a in main(). If you step into the next
call to add(), a is starred again. If you close the Debugger, launch it again on the
same program, view local variables, and step into add(), a is automatically starred.
Tip
Middle-clicking the row or selecting it and then pressing the space
bar both have the same effect as clicking the right-facing arrow.
When the space bar is used on a field in a structure that points to
another instance of the same type of structure (such as next and
prev pointers in a linked list or left and right pointers in a binary
tree), the same field is selected under the new root. This allows for
rapid traversal of lists because each press of the space bar re-centers
the Data Explorer on the next element in the list.
• A left-facing arrow is present on root nodes that are either fields in a structure
or elements in an array. Clicking the arrow replaces the field or element with
its parent, where the parent is the containing structure or array.
If necessary, the Data Explorer halts the process to update the data and then resumes
the process.
You can also schedule periodic updates if you want to monitor the value of variables
continually:
• Enter the update interval command to update Data Explorer variables every
interval seconds. As above, this halts and resumes the process as necessary.
To deactivate this update, re-enter the update interval command with the interval
set to zero (0).
Note
The update command also attempts to refresh other view windows
including the Register View, Memory View, and Call Stack windows.
For more information about the update command, see “General View
Commands” in Chapter 21, “View Command Reference” in the MULTI:
Debugging Command Reference book.
While the frozen variable is selected, the Freeze button ( ) appears to be pushed
down and a tick mark appears beside the Freeze “variable” menu item. The text
for frozen variables is blue. You cannot update or edit frozen variables.
To reactivate a frozen variable, click the Freeze button again or select View →
Freeze “variable” again. The Data Explorer updates the value of the variable to
reflect the current state of the process and continues to automatically update it each
time the process stops.
Tip
To copy a variable in an existing Data Explorer to another Data Explorer
and then freeze the copy, select the variable and press Ctrl+D.
• Left-click or middle-click the breakdot located to the left of the variable's name,
in the WP column. If a breakdot does not appear to the left of a variable, you
cannot set a watchpoint on it (for example, because it is a local variable that is
stored in a register or because it has been optimized away).
The WP column sets only hardware write breakpoints (or any-task hardware write
breakpoints, if they are supported). However, the watchpoint icon is displayed in
the WP column for other types of hardware breakpoints set through other means.
If a watchpoint icon is displayed in the WP column, left-clicking it deletes the
associated hardware breakpoint, and middle-clicking it toggles the associated
hardware breakpoint. This is true even if the hardware breakpoint could not have
been set by clicking in the WP column.
Note
The WP column may display breakdots next to variables that it is not
possible to set watchpoints on, given the current target. Many targets
have alignment and size restrictions on hardware breakpoints that the
Debugger is not aware of. Additionally, the number of hardware
breakpoints that may be set at one time is often limited. If you click a
breakdot in the WP column, and a watchpoint cannot be set, a dialog box
appears to explain why.
• Change the type used to display a variable. See “Changing the Type Used to
Display a Variable” on page 204.
• View pointers to C++ base classes. See “Viewing Pointers to C++ Base Classes”
on page 205.
• Change the base used to display a number. See the descriptions of the Hex,
Natural, Decimal, Binary, and Octal menu items in “The Format Menu”
on page 214.
To change a variable's type to an array of the current type, see “Displaying Arrays”
on page 195.
An example follows.
#include <iostream>
using namespace std;
class A {
public:
int a;
virtual int af() {return a;}
};
class B : public A {
public:
int b;
};
ap = (A*)&b;
ap->a = 10;
return 0;
}
If, in the preceding example, you open a Data Explorer on the variable ap after the
statement ap = (A*)&b;, MULTI resolves the variable to a pointer to the B class.
It does so by matching the virtual function table for B with the one from ap. To
recast the variable as a pointer to the base class (A), disable Format → Cast To
Derived.
There are limitations to this capability. The base class must have a virtual function
table or no comparison can be made. For example, if class A were defined as follows:
class A {
public:
int a;
};
and then you enable Format → Cast To Derived, the Data Explorer view does not
change because MULTI cannot resolve the derived class. This limitation also applies
to multiple inheritance. An example follows.
#include <iostream>
using namespace std;
class A {
public:
int a;
virtual int af() {return a;}
};
class Z {
public:
int z;
};
m.a = 10;
ap = (A*)&m;
zp = (Z*)&m;
return 0;
}
In the preceding example, MULTI can determine that the variable ap points to an
instance of class M. However, it cannot determine the actual type that the variable
zp points to because class Z has no virtual function table.
You can manually resize a Data Explorer and/or column by dragging the window
edges or the column divider. However, if you manually resize the window, the Data
Explorer no longer auto-sizes to adjust for new data. If you want to use a Data
Explorer that automatically resizes, you must close the current Data Explorer and
open a new one.
You can also specify global Data Explorer dimensions in the Options window. For
more information, see “Configuring Global Data Explorer Dimensions” on page 208.
For more information, see “The Debugger Options Tab” in Chapter 8, “Configuration
Options” in the MULTI: Managing Projects and Configuring the IDE book.
Message Meaning
Not Initialized The variable has not been assigned an initial value and could
have a random value in memory. The Data Explorer shows the
current value of the variable, but this value is most likely
meaningless.
Note
The Not Initialized message may not be
accurate when it appears alongside the elements
of an array. For more information, see the
description of Not Initialized in “Variable
Lifetimes” on page 308.
Unreadable memory MULTI does not have read access to the memory location that
a pointer or address type points to, or the memory location
does not exist.
Unreadable/Unknown TimeMachine was unable to reconstruct the value of the
variable. For more information, see “Dealing with Incomplete
Trace Data” on page 416.
Note
When used with Green Hills Compiler 2014 or later,
the Debugger shows the typedef name instead of the
final type name. For example, given the following C
code, the Debugger displays myNumber (not int) as
the type name of intVal and myObj.count.
typedef int myNumber;
myNumber intVal;
struct myStruct {
char *name;
myNumber count;
} myObj;
Note
The first five menu items, which control how numbers are displayed in
a Data Explorer, pertain to all types except character pointer types. These
string types are always displayed as quoted strings unless the menu items
View Alternate and Settings → Automatically Dereference Pointers
are enabled, in which case they are displayed as an array of characters.
The following table describes the menu items available from the Data Explorer's
Evaluate menu.
Contents
Browsing Program Elements Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
The Browse Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
The Tree Browser Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
The Graph View Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
Chapter 12. Browsing Program Elements
The MULTI Debugger provides several kinds of display windows that allow you
to view program elements in different graphical formats. This chapter describes
each of the following windows:
• The Browse window — Lists information about the selected object type in a
single collapsible and expandable list. For general information about this
window, see “The Browse Window” on page 224.
• The Tree Browser window — Displays information about the selected object
type in collapsible and expandable lists. This window displays expanded
information in new columns, thus offering a hierarchical view of the relationship
among the items it displays. For general information about this window, see
“The Tree Browser Window” on page 249.
• The Graph View window — Displays an object graph that shows the
relationships between items. For general information about this window, see
“The Graph View Window” on page 256.
• Data types — Select Browse → All Types. See “Browsing Data Types”
on page 243.
• Cross references (for a particular symbol in the program you are debugging)
— In the source pane, right-click the symbol and select Browse References
from the menu that appears. See “Browsing Cross References” on page 246.
Note that this menu option is only available if the program you are debugging
was compiled with cross reference information. For information about how to
do this, see the MULTI: Building Applications book for your target.
• Class hierarchies — Select Browse → Classes. See “Browsing Classes”
on page 253.
• Calls:
○ Static calls by function (functions that call other functions, and functions
that the function at the current line pointer calls) — Select Browse →
Static Calls. See “Browsing Static Calls By Function” on page 254.
○ Static calls by file (source files whose functions are called from a particular
source file) — Select Browse → File Calls. See “Browsing Static Calls
By File” on page 255.
Note
For most of these program elements and views, there are alternative ways
to open the browsing tools. The following sections document each
browsing tool, its views, and the ways you can access it.
Note
To browse cross references, files that include the current file, or files that
the current file includes, right-click in the source pane and select the
appropriate menu option from the menu that appears. For more
information, see “Browsing Source Files” on page 240 and “Browsing
Cross References” on page 246.
Every Browse window includes one column known as the primary column. Unlike
other columns, you can never hide the primary column, but you can change the
content formatting via the Show menu. The primary column and available formatting
options differ based on what type of object you view.
Every Browse window includes the following four menus. Menu options vary
according to the type of information you browse.
This menu also allows you to print the contents of the current Browse window,
access MULTI's online help information, or close the Browse window. This
menu is exactly the same in all Browse windows.
• Filter menu — Allows you to specify filters that limit which objects the Browse
window displays. You can set a user-defined filter and/or a selection of
predefined filters. The availability of predefined filters varies depending on
what type of object you are viewing. For more information about filtering, see
“Filtering Content in the Browse Window” on page 226.
• Show menu — Allows you to specify the columns displayed in the Browse
window and the style of the primary column. The availability of columns and
styles varies depending on the type of object you are viewing. Menu options
are described in the sections that cover each type of Browse window.
• Tools menu — Allows you to perform actions on the information in the Browse
window or open other tools that allow you to do so. Most of the options in this
menu also appear in the shortcut menu. The availability of menu items in this
menu and in the shortcut menu vary depending on what type of object you are
viewing. Menu options are described in the sections that cover each type of
Browse window.
Each Browse window contains a status bar, which lists the number of items displayed
in the format:
Shown: visible/total
where:
• visible is the number of items that are not filtered. See “Filtering Content
in the Browse Window” on page 226.
• total (also known as the base set) is the number of total objects encapsulated
by the Browse window. See “Using Filters” on page 229.
where:
The Filter menu displays only those filters that apply to the current type of object.
User-defined filters are applied to the names of the objects being shown in the
Browse window (see “User-Defined Filters” on page 228). The status box at the
bottom of the Browse window lists the number of displayed objects as well as the
total number of objects, which includes those that have been filtered out.
Predefined Filters
The predefined filters you can enable and disable from the Filter menu are described
in the following table. Only those filters appropriate to the object type you are
viewing are available in the menu. You can apply multiple filters.
Menu option Effect
Hide C++ VTBLs Toggles the display of virtual tables in C++ programs. This filter
can only be applied to global variables.
Hide C++ Type Toggles the display of type identifiers in C++ programs. This filter
Identifiers can only be applied to global variables.
Hide C++ Type Info Toggles the display of type information in C++ programs. This filter
can only be applied to global variables.
Hide C++ Initialization Toggles the display of initialization names in C++ programs. This
Names filter can only be applied to global variables.
Hide C++ std::* Toggles the display of objects in the std namespace in C++
programs. This filter can be applied to global variables, functions,
or data types.
Hide .* Toggles the display of objects whose names begin with a period (.).
This filter can be applied to global variables, functions, or data types.
Hide _* Toggles the display of objects whose names begin with an underscore
(_). This filter can be applied to global variables, functions, data
types, or source files.
Hide Globals from Toggles the display of global variables from shared libraries that
Shared Library were loaded into your program. This filter can only be applied to
global variables.
Hide Files without Toggles the display of source files that do not contain any functions.
Functions This filter can only be applied to files.
Hide Functions without Toggles the display of functions that do not have source code. This
Source filter can only be applied to functions.
Hide Inlined Functions Toggles the display of functions that are inlined. This filter can only
be applied to functions.
Hide Static Names Toggles the display of objects that are defined as static. This filter
can be applied to either global variables or functions.
Hide Non-Static Names Toggles the display of objects that are not defined as static. This
filter can be applied to either global variables or functions.
Hide Writes Toggles the display of writes. This filter can only be applied to cross
references.
User-Defined Filters
To define your own filter to apply to the objects listed in the Browse window, select
Filter → User-defined Filter from the menu bar of any Browse window. The
following Define Filters dialog box opens:
To specify what objects to display in the Browse window, enter text and wildcard
patterns in this dialog box (see “Wildcards” on page 314). To specify multiple
patterns in the Show and Hide text fields, use semicolons or whitespace to separate
the patterns.
The next section explains how the Browse window processes user-defined filters
with selected predefined filters.
Using Filters
If you specify a user-defined filter and/or one or more predefined filters, the Browse
window uses the following algorithm to determine what objects to display.
1. The Browse window determines the base set of objects in the Browse window.
When you first open a Browse window, the base set of objects is the set of
objects that were initially specified. For example, if you open the Browse
window with the e f* command (see “Browsing Functions” on page 230), the
base objects are all the functions whose names begin with the letter f. Another
example: if you open the Browse window by selecting Browse → Functions,
the base objects are all the functions in your program. Each time you change
the object type you want to browse by using the Object menu, the newly loaded
objects become the new base set.
2. The Browse window hides any remaining objects whose names do not match
the patterns listed in the Show field of the Define Filters dialog box.
3. The Browse window hides any remaining objects whose names match the
patterns listed in the Hide field of the Define Filters dialog box.
4. The Browse window hides any remaining objects that match the other filters
enabled in the Filter menu.
• Show fa*
• Hide fab*
only those objects from the base object set whose names start with fa but not fab
are displayed.
Note
The base set (described above) does not change based on user-defined
filters or the selections you make in the Filter menu, which only affect
what is displayed in the Browse window. However, the base set does
change based on your selections in the Object menu.
Clicking a plus sign expands the children of that heading; clicking a minus sign
contracts the children. The meaning of each of the headings depends on what type
of objects are displayed. When you first open a Browse window, all headings appear
fully expanded (a minus sign is displayed next to each heading, and all children are
visible).
In filtering and sorting, the Browse window treats headings in the same fashion as
regular objects. Those headings colored the same as keywords, however, are of a
different type than the displayed base object type. If the selected heading is colored
like a keyword, certain Tools options appear dimmed and certain right-click menu
options do not appear.
For example, in the function Browse window all headings appear colored like
keywords, indicating that they are types and not functions. As a result, Tools →
Browse References (among others) is unavailable when such an entry is selected.
For more specific information about headings in function Browse windows, see
“Headings in the Functions Browse Window” on page 236.
Browsing Functions
You can open a Browse window that displays functions by selecting a menu option,
using a shortcut, or issuing a command. Depending on how you open the Browse
window, it displays either all the functions in a program or some subset of functions.
○ From the command pane, issue the browse functions or browse funcs
command. For information about this command, see “General View
Commands” in Chapter 21, “View Command Reference” in the MULTI:
Debugging Command Reference book.
• To open a Browse window displaying only the functions in a specific file, do
one of the following:
○ While viewing the file in the Debugger, select Browse functions in
current file from the Function Locator on the Debugger navigation bar.
○ Double-click the file in a Browse window displaying source files.
○ From the command pane, issue the e command with the arguments
"file"#* (for example, e "test.c"#*). For information about the e
command, see Chapter 11, “Navigation Command Reference” in the
MULTI: Debugging Command Reference book.
• To open a Browse window displaying functions that match a specific pattern,
issue the e command with a pattern that matches more than one function in
your program. For example, issuing the e f* command opens a Browse window
on all the functions in your program that begin with the letter f. For information
about the e command, see Chapter 11, “Navigation Command Reference” in
the MULTI: Debugging Command Reference book.
• To open a Browse window displaying the functions called from a specific
function or the functions that call a specific function, right-click a function in
the source pane and select Browse Other → Browse Callees or Browse Other
→ Browse Callers, respectively, from the shortcut menu.
Note
Sometimes MULTI opens a modal dialog box version of the Browse
window when you have not performed any of the preceding actions. This
usually happens when you have issued a command such as b * and
specified a pattern that matches more than one function or an overloaded
C++ function. You can use this version of the Browse window to specify
the functions you want the issued command to operate on so that the
command can continue. For an illustration and instructions on how to
use this dialog box, see “Function Ambiguities and the Browse Dialog
Box” on page 237. For information about the b command, see Chapter 3,
“Breakpoint Command Reference” in the MULTI: Debugging Command
Reference book.
Note
The primary column when you browse functions is the Function Name
column. The formatting options listed next apply only to this column,
which is always displayed when you browse functions.
C++ we might have a class Foo with a member function bar(int a). The full use
name of this function would then be Foo::bar(int a), with Foo being the scope
and bar(int a) the unqualified name of the function.
To collect all unscoped types into a global scope, use Tools → Global Scope On/Off
to enable the global scope option (see “Browsing Functions Tools Menu”
on page 234). This will place all globally accessible functions into a fake scope, to
ease viewing by allowing all unscoped names to be hidden by contracting the heading
labeled <global_scope>.
By selecting the rows in the Browse dialog box, you can specify which functions
should be used in the action or command to resolve the function name ambiguity.
Depending on the command, you may be allowed to select several functions, or
just one. After you have made your choice, you can click one of the buttons available
at the bottom of the Browse dialog box:
Button Meaning
OK Accepts the current selections.
Button Meaning
All Selects all of the functions displayed in the Browse dialog box, if selecting
multiple functions is applicable.
None Ensures that none of the functions displayed in the Browse dialog box is
selected, if making no selection is applicable.
Cancel Closes the Browse dialog box and cancels whatever operation caused the
dialog box to appear.
Note
The primary column when you browse global variables is the Global
Name column. The formatting options listed next apply only to this
column, which is always displayed when you browse global variables.
Option Meaning
Print Value Prints the value of the selected global variable in the command pane.
This value is available only if your process is running.
View Value Opens a Data Explorer to show the value of the selected global variable.
This value is available only if your process is running.
Go To Definition Displays the selected global variable's definition in the Debugger's
source pane, if it can be found.
Browse References Shows the clicked global variable's cross references in a new Browse
window.
• To open a Browse window displaying all source files, do one of the following:
○ From the Debugger, select Browse → Files.
○ From the File Locator located on the Debugger navigation bar, select
Browse all source files in program.
○ From an existing Browse window, select Object → Files.
○ From the command pane, issue the browse files command. For information
about this command, see “General View Commands” in Chapter 21, “View
Command Reference” in the MULTI: Debugging Command Reference
book.
• To open a Browse window displaying a more limited selection of source files,
issue the e command with a suitable pattern (e *.c, for example). For
information about the e command, see Chapter 11, “Navigation Command
Reference” in the MULTI: Debugging Command Reference book.
• To open a Browse window displaying all of the files included by the current
file, right-click an empty spot in the Debugger's source pane and select Browse
Includers Of This File.
• To open a Browse window displaying all of the files that this file includes,
right-click an empty spot in the Debugger's source pane and select Browse
Files Included By This File.
Note
The primary column when you browse source files is the Source File
Name column. The formatting options listed next apply only to this
column, which is always displayed when you browse source files.
Option Meaning
Browse Functions in Opens a Browse window of functions defined in the selected source
File file, if any.
Contract All Contracts every heading.
Option Meaning
Expand All Expands every heading (this is the way the Browse window looks when
first opened).
Show in Editor Opens the selected file in MULTI's Editor.
Show in Tree Opens a Tree Browser window to show the reference relationships
Browser between the selected source file and other source files.
Graph Includes Opens a Graph View window that displays an include file dependency
graph centered on the selected source file.
Note
Only one column is displayed when you browse data types. You cannot
hide this column.
You can collect all the C-style structs in your program into a global scope by using
Tools → Global Scope On/Off to enable the global scope option (see “Browsing
Data Types Tools Menu” on page 244). This places all C-style structs into a fake
scope, which allows you to hide all of these types by contracting the heading labeled
<global_scope>.
Note
In C++, we also treat template types as scopes over their parameter lists.
For example, displaying the class Foo<int> in a Browse window would
have Foo as a heading and <int> as a child beneath it. This is so that
multiple instantiations of the same base template type do not clutter the
display of data types, and so that they are easy to hide (by contracting
the children of a template type you do not want to examine).
Note
The primary column when you browse cross references is the File
Position column. This column is always displayed when you browse
cross references.
To set breakpoints at all of the locations where the value of a variable (or a type's
member field) is changed:
1. Obtain the references for the variable. (In the Debugger source pane, right-click
the variable, and select Browse References.)
2. In the Browse window, hide the reads (select Filter → Hide Reads).
3. Right-click any entry in the Browse window, and select Set BP on Entries
from the shortcut menu.
The main part of the Tree Browser window is a tree graph, which consists of colored
nodes. The meanings of the colors vary depending on the type of information you
are viewing. (The following sections provide further explanation of coloring.) To
customize the colors used to display information in a Tree Browser, see the
tbTypeFg and tbTypeBg configuration options in “Other Debugger Configuration
Options” in Chapter 8, “Configuration Options” in the MULTI: Managing Projects
and Configuring the IDE book.
One node of the tree graph is called the “root node.” It is the particular function (or
other object) that you are examining. The name of the root node is displayed in the
title bar of the Tree Browser window. You can expand ancestors—callers, if you
are looking at a function, or superclasses, if you are looking at a class—of the root
node towards the left, and descendents—callees or subclasses—of the root node
towards the right. You may expand away from the root node for as many levels as
you want. However, if you want to look at an ancestor of a descendent of the root
node, for example, you will need to reroot your graph. See “Rerooting” on page 253.
To expand ancestors or descendents of a node, click the plus sign ( ) next to the
node. To contract something you have expanded, click the minus sign ( ). If there
is no plus or minus sign, there is nothing to expand or contract.
There are four ways to expand many nodes at once. They are available from the
Expand menu or from the expansion buttons on the toolbar.
To expand the descendents of the selected node (or of the root node if no node is
selected) until there are no more descendents, until recursion is detected, until 50
levels have been expanded, or until 10,000 new nodes have been revealed by
expansion, do one of the following:
Note
To cancel this operation, press Esc.
To perform a similar expansion on the ancestors of the selected node (or on the
ancestors of the root node if no node is selected), do one of the following:
Sometimes you may want to expand one level instead of all the nodes. To expand
one level of the selected node's descendents (or of the root node's descendents if no
node is selected), do one of the following:
To obtain similar results, you can also click every node's plus sign on the descendent
side of the graph. The difference between doing this and performing one of the
preceding operations is that the menu items do not expand recursive nodes.
To expand one level of the selected node's ancestors (or of the root node's ancestors
if no node is selected), do one of the following:
To resize a column of nodes, drag the separator on the column header to the right
of the column that you want to resize.
Node Operations
Each node is labeled with a short, descriptive name. In C++, the short name does
not include class or namespace qualifiers, which come before the final double colon
(::). To view the full name in a tooltip, hover your cursor over the node.
To view more information about a node, click it. Information about the node,
including its full name, is displayed in the status bar of the Tree Browser window.
Clicking certain types of nodes, such as function and file nodes, also causes the
source code for the node to be displayed in the Debugger source pane.
To open a shortcut menu for a node, right-click the node. The shortcut menu for a
function node resembles the following:
The first two operations, Reroot and Reroot in New Window, are described in
“Rerooting” on page 253. The middle portion of the menu contains various actions
you can perform on the node. These actions vary depending on the type of node
and are documented in “Opening a Tree Browser” on page 249. The bottom portion
of the menu lists the types of ancestors or descendents a node may have. It also
allows you to expand or contract them, which is equivalent to clicking the plus/minus
sign on the side of the node.
Rerooting
If there is a node on the graph that you want to make the root node so that you can
examine both its ancestors and its descendents, you can reroot on that node.
Once you reroot on a node, everything that was previously in the Tree Browser
window disappears. However, the previous content of the window is stored in a
history mechanism much like that in a Web browser.
To reroot a node in a new window, rather than replacing the current window contents,
do one of the following:
• Click the node and select Browse → Reroot Selected Node(s) in New
Window(s).
• Right-click the node and select Reroot in New Window.
• Double-middle-click the node.
Browsing Classes
To use a Tree Browser to browse your class hierarchy, do one of the following:
The children of the root classes node are all of the classes (including structs
and unions) that do not inherit from another class. A class that is a subclass of
another class is shown as a child of its parent class. The color green is used to
distinguish classes and structs from unions, which are highlighted in yellow.
To see the definition of the class in the Debugger window, do one of the following:
• In the Debugger command pane, enter the browse scalls command. For
information about this command, see “General View Commands” in Chapter
21, “View Command Reference” in the MULTI: Debugging Command
Reference book.
A Tree Browser opens, centered on the function you are currently looking at in the
Debugger source window.
To open a Tree Browser on a specific function (for example, foo()), do one of the
following:
• In the Debugger, right-click the function and select Browse Other → Browse
Static Calls.
• In the Debugger command pane, enter the following:
browse scalls foo
Color provides information about the function represented by a given node. Purple
indicates a normal function for which MULTI has the source code. Green indicates
a function for which no information is available—usually because the function is
in a library that MULTI does not have symbols for. Pink indicates a recursion in
the Tree Browser.
To view a function in the Debugger source pane, click the function node.
To edit a function, double-click the function node. This feature is also available
from the shortcut menu that appears when you right-click the function node.
A Tree Browser opens on the file you are currently viewing in the Debugger.
To open a Tree Browser on a specific file (for example, foo.c), enter the following
in the Debugger command pane:
browse fcalls foo.c
Color provides information about the file represented by a given node. Pink indicates
a file that has debug information. Gray indicates a file that does not have complete
debug information.
To view a file in the Debugger, click its node. To edit a file, double-click its node.
Right-click a file node to open a shortcut menu that allows you to edit the file, view
the file in the Debugger source pane, browse a list of functions in the file, or view
file properties.
Browsing Includes
To open a Graph View window displaying an include file dependency graph, do
one of the following:
The resulting graph is vertically centered on the current file, and shows all files
included in this file as well as all files that include this file. An edge pointing from
a file to an included file indicates a dependency.
When you display the include dependency graph from a root file (that is, a file that
is not itself included by anything), some files may be marked with a leading (*).
These are files that appear not to contribute anything to the root file and that can
probably be removed from the include graph without harm.
Clicking a file node causes the file to be displayed in the Debugger source pane.
shortcut menu, the Search for Objects window, or the history buttons. The following
sections describe each in more detail.
Option Meaning
Collapse Children Removes all children of the object and then traverses the
subtrees of each child, removing those objects that no longer
show parents. In a simple tree, the net effect is to remove all
nodes in the subtree rooted at the object. You can display the
children again by choosing Expand Children.
Expand Children Redisplays the object's children, if they were previously
collapsed. Also redisplay the children's children, and so on,
since they now have a visible parent.
Collapse Parents Similar to Collapse Children, except operating on the object's
parents, the parents' parents, and so on.
Expand Parents Similar to Expand Children, except operating on the object's
parents, the parents' parents, and so on.
Edit File Opens the file in an editor.
Re-center Graph Re-centers the graph on the selected file, producing a graph
of files that include the selected file, and files that it includes.
This creates a new entry in the history.
• The Find text field, which allows you to specify a filter for the entries in the
All list. Filters may include wildcards and are case-insensitive.
• The All list displays a list of all objects that fit the current filter. Selecting an
item in the All list scrolls to and selects the corresponding object in Graph
View. Similarly, selecting an object in Graph View selects the corresponding
list item in the All list.
• The Parents list displays a list of all parents of the selected object. Entries that
appear dimmed indicate objects that are currently collapsed. Selecting an item
in the Parents list causes Graph View to scroll to, but not select, the
corresponding object.
• The Children list displays a list of all children of the selected object. Entries
that appear dimmed indicate objects that are currently collapsed. Selecting an
item in the Children list causes Graph View to scroll to, but not select, the
corresponding object.
Contents
The Register View Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
The Register Information Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
The Modify Register Definition Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
The Register Setup Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
The Register Search Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Using Debugger Commands to Work with Registers . . . . . . . . . . . . . . . . . . . . 290
Customizing Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
Chapter 13. Using the Register Explorer
The Register Explorer allows you to configure how registers are defined, accessed,
and displayed within the Debugger. The Register Explorer includes the Register
View window, which allows you to view the values of registers within the Debugger
and the Register Information window, which shows you detailed information
about a register and allows you to add and change register definitions.
Despite its name, the Register Explorer is not limited to working with the physical
registers on your target processor. The Register Explorer can also work with objects
that derive their values from other registers, from locations in memory, or even
from the result of a Debugger expression. All of these objects are treated in the
same manner as physical target registers. In this chapter, the term register includes
everything that can be described in a Register Explorer definitions file.
Your Green Hills Compiler installation includes one or more register definition
files for your target architecture. For information about these files' names and
locations, see “Register Explorer Startup” on page 294. For information about their
format, see “The GRD Register Definition Format” on page 802.
To open the Register View window from a Debugger, you can do one of the
following:
The Register View window shows all the registers for your target, your custom
registers, and various configuration controls. An example Power Architecture
Register View window is shown next.
• Menu Bar — Contains entries for various operations that allow you to configure
the tabs and appearance of the Register View window. For a description of
the individual menus and options, see “The Menu Bar” on page 264.
• Toolbar — Provides shortcuts for often-used operations. For a description of
the individual buttons, see “Toolbar” on page 267.
• View tabs — Show the registers of your target organized in different ways. For
information about the default tabs, see “Tabs” on page 268. For instructions on
how to create custom tabs, see “Customizing the Register View Window”
on page 271.
• Register tree — Each tab contains a two-column register tree. You can select
registers and groups from this tree and perform actions on them using the
right-click menu. For details, see “Register Tree” on page 268.
The File menu contains the menu items listed in the following table.
Item Meaning
Save All Register Saves values of all registers into a text file.
Values into File
Save All Register Saves the values of all registers in the current tab into a file.
Values in Active
Tab into File
Save Selected Saves the values of the selected registers in the current tab into a file
Register Values into
File
Load Register Loads register values from a file in the saved register value format. See
Values from File a saved register value file for an example.
Save Register Saves to a .grd file the register definitions modified during the current
Definitions Created debugging session, registers defined with the regadd command, or
on the Fly registers defined from a Data Explorer's View → View “variable” as
Register menu item. See “The Register Setup Dialog” on page 287.
Load Register Loads register definitions from a .grd file and adds them to the definitions
Definitions from already present.
File
Unload Register Unloads register definitions from an incrementally loaded .grd file.
Definitions from
File
Add Creates a memory-mapped register for a memory address. For more
Memory-mapped information, see “The Register Setup Dialog” on page 287.
Register
Reinitialize Reinitialize the register information from the default register definition
Register file(s). This is a slow process for some targets.
Information
Reuse Register Toggles the option that specifies whether to reuse an existing Register
Information Information window or open an additional Register Information
Window window when a new register is viewed.
Item Meaning
Freeze Freezes the Register View window so that it does not automatically
refresh.
When the Register View window is not frozen, the values of the registers
in the window are updated each time the process stops. If the window
is frozen, the register values will not be updated each time the process
stops.
Print Prints all register values.
Close Closes the Register View window.
Item Meaning
Search Register Launches the Register Search window, see “The Register Search
Window” on page 289).
Show Hidden Controls whether registers that are hidden on the active tab are displayed
Registers in the register tree.
When a check mark appears beside this menu item, registers and groups
that have been hidden on the active tab will be displayed in the register
tree as light gray entries. When hidden items are displayed, you can edit
them to remove the hidden attribute.
When no check mark appears next to this menu item, registers and groups
that are hidden on the active tab are not displayed in the register tree.
To toggle between these settings, select the Show Hidden Registers
menu item.
Add New Tab Adds a new tab to the Register View window. See “Adding a New
Register View Window Tab” on page 272.
Remove Active Tab Deletes the active tab from the Register View window. See “Removing
Unwanted Tabs” on page 274.
Promote Active Tab Moves the tab one to the left in the ordering of tabs at the top of the
Register View window. See “Modifying the Ordering of Tabs”
on page 273.
Demote Active Tab Moves the tab one to the right in the ordering of tabs at the top of the
Register View window. See “Modifying the Ordering of Tabs”
on page 273.
Unroot Active Tab Makes the active tab display groups starting from the root of the register
group tree, if the tree has been re-rooted. See “Changing the Root of the
Register Tree” on page 274.
Item Meaning
Refresh Refreshes all of the register values displayed in the register tree if the
Register View window is not frozen.
Expand All Expands all nodes on the current tab of the Register View window.
Collapse All Contracts all nodes on the current tab of the Register View window.
The Format menu contains the menu items listed in the table below. You can use
this menu to configure the tabs and appearance of the Register View window.
Item Meaning
Natural When selected, register values will be displayed in their default format.
This default format corresponds to how values of the register's type are
normally displayed in Data Explorers.
Decimal When selected, register values will be displayed in signed base 10 integer
notation whenever applicable.
Hexadecimal When selected, register values will be displayed in unsigned base 16
notation whenever applicable.
Binary When selected, register values will be displayed in unsigned binary
notation whenever applicable.
Octal When selected, register values will be displayed in unsigned base 8
notation whenever applicable.
View Alternate When selected, register values will be displayed in the natural format as
well as in a secondary format. For example, an enumeration value is
displayed along with an integer value when this menu item is selected.
Pad Hex Values When selected, any hexadecimal values that are displayed will include
leading zeros to their full bit width.
When cleared, hexadecimal values are displayed without leading zeros.
Expand Value When selected, any registers that are pointers to values stored in memory
will be automatically dereferenced and the contents of memory at that
location will appear in a tooltip when you hover over the register's value.
When cleared, only the pointer is shown.
Show Changes When selected, any register values that change while you are stepping
through your program are highlighted to make them distinct from
registers whose values did not change.
When cleared, all registers are displayed in the same way, regardless of
whether their values changed or not.
Item Meaning
Expand Register When selected, the bitfields contained within registers will be displayed
Bitfields as structures (individual values separated by vertical bars).
When cleared, the bitfield registers are displayed as integer hexadecimal
or decimal constants.
Toolbar
Directly underneath the menu bar is the toolbar, which contains the following
buttons:
Button Meaning
Saves the values of the selected registers in the current tab into a file.
Loads register values from a file in the saved register value format. See a
saved register value file for an example.
Creates a memory-mapped register for a memory address.
Expands all nodes on the current tab of the Register View window.
Contracts all nodes on the current tab of the Register View window.
Launches the Register Search window (see “The Register Search Window”
on page 289) so that you can search a register you want.
Refreshes all of the register values displayed in the register tree if the
Register View window is not frozen.
Freezes the Register View window so that it does not automatically refresh.
When the Register View window is not frozen, the values of the registers
in the window are updated each time the process stops. If the window is
frozen, the register values will not be updated each time the process stops.
Toggles the option that specifies whether to reuse an existing Register
Information window or open an additional Register Information window
when a new register is viewed.
Prints all register values.
Tabs
Directly underneath the toolbar is a list of tabs. Each tab of the Register View
window shows the registers of your target organized in a different way. In addition
to tabs that you create, you may see default tabs, which are automatically created.
The possible default tabs are listed below:
• The Processor tab usually contains all of the registers present on the target
processor.
• The Board tab contains all memory-mapped registers and dynamic registers
defined in the Debugger, as well as indirect registers. These registers are usually
specific to the target board you are using.
• The Ungrouped tab displays any user-defined registers that have not been
placed into any register group.
These default tabs are present only if they contain registers. For example, the
Ungrouped tab will probably not appear unless you have defined your own registers
and these registers have not been placed in any group.
Each register tab except for Ungrouped views the same hierarchical register structure
as defined in the register definition files. Different tabs can be configured to display
different subsets of the available registers. You can alter the visibility of registers
and groups on a single tab without affecting other tabs. See “Selectively Displaying
Registers and Groups” on page 272.
To switch between tabs, click the name of the tab you want to view in the tab list.
For information about adding a new tab or performing other operations on tabs, see
“Customizing the Register View Window” on page 271.
Register Tree
Underneath the tab list is a tree of the registers and groups that are visible for the
active tab. The column on the left displays the names of register groups and the
names of registers. The column on the right shows the current value for registers.
If the list of registers and groups is larger than the visible area of the register tree,
scroll to view parts of the tree that are not visible.
Each group in the left column has a plus or minus icon next to it. To expand or
contract a group, click this icon.
When a group is expanded, the minus sign icon will be shown and all of the items
contained in that register group will be visible in the register tree. Note that
expanding register groups causes extra overhead when debugging. By default, the
Debugger queries the target for the values of the expanded registers each time the
target is stepped or halted. To change this behavior, you may freeze the window.
For more information, see “Controlling Refresh of Register Values” on page 276.
When a group is contracted, the plus sign icon will be shown and the items contained
in that register group will not be visible in the register tree. Registers containing a
pointer also display plus/minus icons.
To select a single row of the register tree, click the row. To select a contiguous
range of rows of the register tree, use Shift+click. To make a noncontiguous selection
of rows, use Ctrl+click.
To operate on an entry in the register tree, right-click the entry. A shortcut menu
will appear. For more information, see “Performing Actions on Registers Using the
Shortcut Menus” on page 270.
To open a Data Explorer (see also “The Data Explorer Window” on page 187) or a
Register Information window (if the register has bitfields definition) on a register
that is in a row of the register tree, double-click the row.
• For registers or groups that have names that extend beyond the width of the
Name column;
• For registers or groups that have an alternate name specified in the GRD file
with the long_name or ln option;
• For registers that have certain special values, such as a pointer to code.
• Groups are displayed in the color MULTI uses for string constants;
• Registers are displayed in the standard text color;
• Register bitfields are displayed in the color MULTI uses for customized items;
• Dereferences of pointer registers are displayed in the color MULTI uses for
keywords.
For more information, see the description of “Syntax Color Settings” in “Colors
Configuration Options” in Chapter 8, “Configuration Options” in the MULTI:
Managing Projects and Configuring the IDE book.
Each tab in the Register View window contains a distinct view of the hierarchical
organization of groups and registers. You can choose to display only certain registers
and groups on each tab independently of other tabs. This means that you can create
new tabs that only display the registers you are interested in at particular points in
your process, and flip between these displays by clicking the appropriate tabs.
Note
You cannot modify the way registers are hierarchically grouped or ordered
without modifying the register definition files.
The Register View window remembers how it was configured between debugging
sessions. Settings are saved and restored based upon which register definition file
is loaded when the Debugger is opened. This usually means that configurations of
the registers for different target processor families are saved and restored
independently of each other.
When you create a new tab, it displays the full structure of the register tree by
default. You can now show or hide registers and groups to pare this tree down to
the information that is most important to you.
To hide a register, right-click the register you want to hide and choose Hide Register
from the shortcut menu.
To hide groups of registers, right-click the group and choose Hide Group from the
shortcut menu. The group, and anything the group contained, will no longer be
displayed on that tab.
To hide multiple objects, use Shift+click or Ctrl+click in the register tree to select
multiple items. When you have selected everything you want to hide, right-click
one of the selected items and choose Hide Selected Items from the shortcut menu.
You can also show and hide items on a tab by using the regtab command. For more
information about this command, see “Register Commands” in Chapter 14, “Register
Command Reference” in the MULTI: Debugging Command Reference book.
To move a tab one position to the left, first click its label to make it the active tab.
Then choose View → Promote Active Tab in the Register View window.
To move a tab one position to the right, first click its label to make it the active tab.
Then choose View → Demote Active Tab in the Register View window.
You can also modify the ordering of tabs in the Register View window by using
the regtab command. For more information about this command, see “Register
Commands” in Chapter 14, “Register Command Reference” in the MULTI:
Debugging Command Reference book.
• Click the tab's label to make it the active tab, and then select View → Remove
Active Tab.
• Use the regtab command. For information about this command, see “Register
Commands” in Chapter 14, “Register Command Reference” in the MULTI:
Debugging Command Reference book.
Removal is permanent for customized tabs (see “Adding a New Register View
Window Tab” on page 272). However, the automatically created Processor, Board,
and Ungrouped tabs can be restored. To restore these tabs:
1. Exit MULTI.
2. Remove the relevant .ini configuration file from:
• Windows 8/Windows 7/Vista —
user_dir\AppData\Roaming\GHS\regview\
• Windows XP — user_dir\Application Data\GHS\regview\
• Linux/Solaris — user_dir/.ghs/regview/
Note that removing this configuration file also permanently deletes all
customized tabs.
To hide the parents of a visible register or group, change the root of the register tree
for a tab. When you change the root of the register tree on a tab, only the children
of the group chosen to be the new root are displayed. To specify that a group should
be the new root, right-click the group and choose Reroot Tab at Group from the
shortcut menu. Afterwards, the register tree on that tab now displays only the children
of the group you specified to be the root.
You can display all of the groups in the default register tree and undo a rerooting
operation by unrooting the register tree on a tab. First click the desired label to make
it the active tab. Choose View → Unroot Active Tab in the Register View window.
The tab will now display all of the default register tree's visible groups.
You can also reroot and unroot tabs by using the regtab command. For information
about this command, see “Register Commands” in Chapter 14, “Register Command
Reference” in the MULTI: Debugging Command Reference book.
Sometimes you may want to copy just the value of a particular register or set of
registers and omit the register names. To do this, first select the registers whose
values you want to copy. Then right-click the selection and choose Copy Values
from the shortcut menu that appears. If you only want to copy the value of a single
register, right-click the register and it will be selected automatically.
To edit the contents of a register, right-click the register you want to modify and
choose Edit Contents of Register from the shortcut menu that appears. A dialog
box will appear that shows the current value of the register. Type in the new value
or a Debugger command line expression that evaluates to the new value you want
the register to have. When you click OK, the register will be assigned either the
value you typed in or the result of evaluating your expression in the current Debugger
environment.
To modify the values of registers that have complicated structures, you must do
your editing from a Register Information window or a Data Explorer. To modify
register value with the Register Information window:
1. Open a Data Explorer on the register (right-click the register you want to
modify and choose Open a Data Explorer on Register from the shortcut
menu). A Data Explorer will appear showing the details of the register's
structure.
2. Edit the register's contents as you would edit the values of any other structure
in a Data Explorer.
See Chapter 11, “Viewing and Modifying Variables with the Data Explorer”
on page 185.
To suppress the automatic updating of register values, click the button in the
Register View window. The button will appear to be pushed down to indicate that
the window is frozen. While the window is frozen, the register values will not be
automatically updated from your target. In the frozen state you may still scroll
through the register tree to view all of the register values that were present when
the window was frozen. You are not allowed to switch between tabs when the
Register View window is frozen. To unfreeze the window and allow the register
values to be automatically refreshed again, click the button again.
By default, when the value of a particular register changes, that register's entry will
be highlighted in the register tree. To toggle this highlighting on and off, choose
Format → Show Changes.
If you want to manually refresh register values in the Register View window while
your process is halted, choose View → Refresh. Usually the values will be
automatically refreshed each time the process is halted, but you will need to manually
refresh to see any changes to volatile registers that occur while your process is
halted.
• In the Register View window's shortcut menu, choose Open an Info View on
register_name.
• In the Register View window, double-click a register with a bitfield definition.
• Issue the regview command followed by a register name. For information about
the regview command, see “Register Commands” in Chapter 14, “Register
Command Reference” in the MULTI: Debugging Command Reference book.
The currently selected hexadecimal digits in the bitfield panes (see below for
more information) are displayed in the color used for selections, and any digits
changed in this display but not yet written to the target by clicking Apply are
displayed in red.
• Binary value — Displays the register's binary value.
The bits are displayed in groups of 4 or 8 bits. To toggle between 4 and 8 bit
groups, select Show Binary in Nibbles from the shortcut menu accessible in
the bitfield panes. Bit groups are separated by an underline. As in the Hex
value display, the currently selected binary digits in the bitfield panes (see
below for more information) are displayed in the color used for selections, and
any bits changed in this display but not yet written to the target by clicking
Apply are displayed in red.
• Concise display pane — Displays the register's bitfield names as column
headings and values in the corresponding cells. Any bits changed in this display
but not yet written to the target by clicking Apply are displayed in red. For
more information, see “Concise Display Pane” on page 280.
• Detailed display pane — Displays the register's detailed bitfield information.
Any bits changed in this display but not yet written to the target by clicking
Apply are displayed in red. For more information, see “Detailed Display Pane”
on page 281.
• Help pane — Displays the register's documentation. For details, see “Help
Pane” on page 282.
Whenever you select a bitfield in the bitfield panes, its description (if defined
in the register definition file) will be shown in the help pane in a special
background color.
• Button set — Allows you to write any changes made in this window to the
target, revert any changes, or close the Register Information window. For
more information, see “Button Set” on page 283.
When you right-click a value cell, a shortcut menu appears with the following items:
Item Meaning
Set Value:value Sets the value to the bitfield.
This menu item is displayed for a writable register's enumeration
bitfields or 1 or 2 bit bitfields. The current value is dimmed.
Change Value Allows you to provide a new value for the bitfields.
This menu item is displayed for a writable register's bitfields that are
not enumeration types and that are wider than 2 bits.
Modify Register Launches a Modify Register Definition dialog (see “The Modify
Definition Register Definition Dialog” on page 284) to modify the register's bitfield
definitions.
You can save the modified register bitfield definition into a file by
choosing File → Save Register Definitions Created on the Fly from
the Register View window.
Show Numeric Toggles whether to show numeric or literal values for bitfields in the
Values concise display pane.
Pad Undefined Toggles whether to display undefined bitfields.
Bitfields
Show Binary in Toggles whether to display binary values grouped by nibbles (4 bits)
Nibbles or bytes (8 bits).
Item Meaning
Reverse Bit Reverses the numbering for bits.
Numbering This option only changes the displayed bit indices; it does not change
the register's value.
Reverse Byte Order Swaps the bytes in the register value displayed in the Register
Information window.
This option changes the register value in the Register Information
window. Click the Apply button to write the modification to the target.
The register's bitfields and their possible values (for enumeration bitfields) are
displayed in rows in the detailed display pane. The following columns are present
in the display:
Item Meaning
Bit # Bit number or bit number range for a bitfield.
The column's value can be changed by toggling the Reverse Bit
Numbering option in the shortcut menu.
Name Bitfield name.
Value Bitfield's numeric value.
Description Bitfield's description.
If a bitfield has a single-line description, it will be fully displayed in
the column; if a bitfield has a multiple-line description, the first line
will be displayed in the column followed by ...; if a bitfield has no
description but has a long name, the long name will be displayed in the
column.
When you right-click a cell, a shortcut menu appears with the following items:
Item Meaning
Show Possible Field Toggles whether to display the possible values for each bitfield of the
Values register.
When the flag is on, an enumeration bitfield's possible values are shown
below the bitfield. In the row showing a possible bitfield value, the
other columns are blank. Double-click one of these bitfield value choices
to change the bitfield to that value.
Other items Other items in the shortcut menu have the same functions as the
corresponding items in the shortcut menu of the concise display pane.
Help Pane
The help pane is below the detailed display pane.
At the top, it displays the register's general description in the following order:
Then, for each bitfield, the help pane displays information in the following order:
The bitfields are shown in the order they are defined in the corresponding register
definition file.
Whenever you click a cell in the concise display pane or the detailed display pane,
the help pane will automatically scroll to and highlight the corresponding bitfield's
documentation.
Button Set
The button set is at the bottom of the Register Information window. It contains
the following buttons:
Item Meaning
Apply Writes the register value displayed in the Register Information window
to the target.
Revert Discards any changes made to the register value and reloads the current
register value.
Close Closes the Register Information window.
If any unwritten changes have been made, those changes will be
discarded.
• In the Hex value, Binary value, the concise display pane's numeric cells and
the detailed display pane's Value column, you can directly modify the register
value:
1. Select the text you want to change (the hex prefix in Hex value cannot
be changed);
2. Type in the new value.
If you modify an existing register's definition or create a new register, you will be
asked to save these definitions into a GRD file when you quit MULTI. To save any
new or modified register definitions to a GRD file, choose File → Save Register
Definitions Created on the Fly from the Register View window. You can merge
the changes into your default register definition system later or dynamically load
the GRD file in future debugging session by choosing File → Load Register
Definitions from File from the Register View window.
• The bitfield editor pane, which contains fields for a bitfield's attributes and a
set of buttons to manipulate the changes. For more information, see “Bitfield
Editor Pane” on page 285.
• The bitfield list pane, which lists the information for all bitfields. For more
information, see “Bitfield List Pane” on page 286.
• The button set, which allows you to commit (OK) or discard (Cancel) the
changes made in the dialog.
The functions of the buttons in the bitfield editor pane are listed below:
Button Meaning
New Creates a new bitfield in the bitfield editor pane.
Submit Propagates the changes shown in the bitfield editor pane to the bitfield
list pane.
If the bitfield shown in the bitfield editor pane is an existing bitfield in
the bitfield list, the corresponding entry in the bitfield list will be
changed; otherwise, the new bitfield will be added to the end of the
bitfield list.
In order to accept any changes made, you still have to click the OK
button in the lower button set.
To display or change a bitfield's attributes, click a list entry to select it. The bitfield's
attributes will be displayed in the bitfield editor pane, where they can be examined
or changed.
The following choices appear in the right-click menu of the bitfield list:
Item Meaning
Add Creates a new bitfield in the bitfield editor pane.
Delete Deletes the selected bitfields.
Modify Displays the most recently selected bitfield in the bitfield editor pane
where it can be examined or changed.
Move Up Moves the selected bitfield or bitfields up one row.
Move Down Moves the selected bitfield or bitfields down one row.
Sort by Bit Position Sorts the bitfields by their bit position in ascending order.
in Ascending Order
Sort by Bit Position Sorts the bitfields by their bit position in descending order.
in Descending Order
The following keyboard shortcuts can be used to manipulate the bitfield list:
Key Action Meaning
Ctrl+UpArrow Moves the selected bitfields up one row.
Ctrl+DownArrow Moves the selected bitfields down one row.
Ctrl+D Deletes the selected bitfields.
Delete Deletes the selected bitfields.
The Register Setup dialog box opens so that you can specify basic information for
the newly created register.
The Register Setup dialog contains the fields listed in the table below.
Field Meaning
Name Name of the register. This name must not already be used for an existing
register.
Field Meaning
Access Type Access type of the register.
The only available choice is Memory-mapped.
Address Memory address of the register.
Width Memory size of the register.
Tab Register View window tab on which the register will be displayed.
Choose one of the tab names from the list.
Group Group with which the register is to be associated. Choose one of the
group names from the list.
Byte Order Byte order of the register:
Bit Order Whether bits will be numbered with bit 0 referring to the least significant
bit, as on most CPU architectures, or with bit 0 referring to the most
significant bit, as on Power Architecture.
When a register is created, a new Register View window is launched to show the
register in the proper tab, and a Register Information window is launched to show
detailed information about the register.
Note
For most targets, the memory-mapped register that is created uses physical
data memory space by default. (For MIPS, it uses the default data memory
space.) To define and use a different memory space:
Note
Register information is not shared between TimeMachine mode and live
mode (that is, when the target is live). If you define a new register while
in one mode, the definition is not applied to the other mode.
The register list's columns display the information in the following table.
Field Meaning
Name Register name.
Tab Tab in which the register is displayed in the Register View window.
Path The path of the register in the hierarchy shown in the Register View
window.
The tab name is at the beginning of the path.
Matched Item The register attribute that matches the text entered in the Text field.
To locate a register in the Register View window, single-click the entry in the
register list; to display a register in the Register Information window (if the register
has bitfields defined) or in the Data Explorer (otherwise), double-click the
corresponding entry in the Register List.
The following items appear in the right-click menu of the register list:
Item Meaning
Show “register” in Displays the register in the Register View window. The tab to which
Register Explorer the register belongs is displayed and all group nodes in the register's
path are expanded, if necessary.
Show Register Shows the register in the Register Information window.
Information for
“register”
Show “register” in Shows the register in the Data Explorer.
Data Explorer
Bitfield registers and structured registers are accessed from the command line in
the same way as C-style structs. Assuming that a bitfield register y with the following
bitfield description in the GRD format is defined as follows:
# Bitfields of register y
bitfield {
y_bitfield {
"cache_state" {loc="0..1"}
"reserved" {loc="2..31"}
}
}
This register definition indicates that y has two bitfields, cache_state in the low
two bits and reserved in the high 30 bits. Assume the initial value of y is 0x13.
If you print out the register in the command pane, it will be displayed as a C-style
struct:
> $y
y = struct y {
reserved = 0x00000001;
cache_state = 0x00000003;
} y
In the above example, the cache_state bitfield will be modified without affecting
the reserved bitfield:
> $y
struct y {
reserved = 0x00000001;
cache_state = 0x00000002;
} y
Registers that are pointers to structures are accessed like C-style pointers on the
command line. Assume that a structure frame and a register fp are described in
the register definition files, as follows:
# Structure frame definition
struct {
frame {
hi_word {type="short"}
lo_word {type="short"}
}
}
register {
fp {address=0; type="frame *"}
}
Assume that fp is currently pointing to a the memory address 0xbbb that contains
0x000a0007. The following illustrates what you would see in the command pane
when printing out the contents of fp.
> $fp
$fp : *fp *0xbbb: struct frame {
hi_word = 10;
lo_word = 7;
}
The pointer was automatically dereferenced when the register contents were printed.
To print out a single field, dereference the field:
> $fp->lo_word
lo_word = 7
Registers that are pointers to raw types are accessed the same way as variables that
are pointers to the corresponding type. When using a register's value as an argument
to a MULTI command or a command line function call, use the same syntax as you
would for printing out register values or assigning to registers from the command
line.
Customizing Registers
Note
Register information is not shared between TimeMachine mode and live
mode (that is, when the target is live). If you define a new register while
in one mode, the definition is not applied to the other mode.
Note
Any modifications to the register definitions made from the command
line are active only until you reload the program or connect to a different
target. For persistent modifications, you must customize the default
register definition files, as described below.
To find the root GRD file, MULTI searches the directories in “File Locations”
on page 295. The root GRD file is the first of the following four register files that
MULTI locates. MULTI searches for the register files in the order listed.
1. prog.grd — prog is the name of the program you are debugging. prog.grd,
if it exists, is a user-defined file.
Note
If you are connected to a homogeneous multi-core target, the first
prog.grd file loaded onto any core will be used by all the
homogeneous cores in the system. If, however, you reinitialize
register information on a core, it is the prog.grd file corresponding
to the program loaded onto that core that will be used by all the
homogeneous cores in the system.
2. dbserv-dbtarget.grd — dbserv is the debug server you are connected to, and
dbtarget is your debug server target. dbserv-dbtarget.grd, if it exists, is a
user-defined file.
3. cpu.grd — cpu is the acronym for your processor family. (For a list of possible
cpu values, see the following table.) cpu.grd is included in your Green Hills
Compiler installation. If you have not defined the register files listed above,
cpu.grd is used as the root GRD file.
4. dbserv.grd — dbserv is the debug server you are connected to. dbserv.grd,
if it exists, is a user-defined file.
Appropriate values for cpu (in cpu.grd) are listed in the following table.
File Locations
MULTI searches for the register files listed in “Register Explorer Startup”
on page 294, one at a time, in the following five standard directory locations unless
otherwise noted. When MULTI finds one of the register files, it discontinues the
search and uses the located file as the root GRD file (see “Register Explorer Startup”
on page 294). MULTI searches the directories in the order listed.
Note
MULTI does not search for prog.grd in the registers directories.
Tip
If the root GRD file contains non-absolute include directives, MULTI
attempts to resolve the locations of the directives by searching the
directory where the root GRD file is located. If you defined the root GRD
file and you want to include the Compiler installation's cpu.grd file in
it, you can use the variable ${__TOOLS_DEFAULTS_DIR__} when
specifying the path to cpu.grd. For example, for a Power Architecture
target, you could specify:
%include "${__TOOLS_DEFAULTS_DIR__}/registers/ppc.grd"
# foo.grd
#
# ... description of this file ...
%include "${__TOOLS_DEFAULTS_DIR__}/registers/ppc.grd"
#
# add custom register descriptions here
#
Whenever you debug a program prog, MULTI will find prog.grd first and load it,
applying the standard Power Architecture register definitions from ppc.grd and
then the custom register definitions.
Note
Be sure you insert an appropriate %include for the target on which your
process is running. Otherwise you may be unable to view the standard
registers on your target.
To apply custom register definitions to all programs compiled for a specific target,
follow these steps:
2. In the registers directory, create a file with the name cpu.grd, where cpu is
the acronym for your processor family (for example, ppc.grd). For a list of
possible cpu values, see the table in “Register Explorer Startup” on page 294.
3. Use a text editor (such as the MULTI Editor) to edit the new cpu.grd file:
a. To include MULTI's default register definition file, add:
%include "${__TOOLS_DEFAULTS_DIR__}/registers/cpu.grd"
to the top of the file. cpu is the acronym for your processor family. If
you do not insert this %include directive, you may be unable to view
the standard registers on your target.
b. Add your custom register definitions to the end of the file. For example:
# include my custom defintions
%include "my_regs.grd"
Using Expressions,
Variables, and Function Calls
Contents
Evaluating Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
Viewing Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
Variable Lifetimes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
Examining Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
Wildcards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
Function Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
Preprocessor Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
Debugger Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
MULTI Special Variables and Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Syntax Checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
Chapter 14. Using Expressions, Variables, and Function Calls
This chapter describes how you can type expressions into the Debugger command
pane to examine and perform calculations with the values of variables in your
program. It also describes how you can use MULTI variables to examine and modify
the behavior of the Debugger.
Evaluating Expressions
To evaluate an expression, enter it into the Debugger's command pane. Expressions
may contain:
The Debugger calculates the value of the expression and displays it. If you want to
watch the value of an expression and have it reevaluated as you step through your
program, you should use a Data Explorer. See “The Data Explorer Window”
on page 187.
Expression Scope
Expressions are evaluated in a specific context, which affects what variables can
be meaningfully used in an expression. MULTI determines the scope of an
expression based on the position of the blue current line pointer ( ) and the scope
rules of the language in use.
For example, suppose you are stopped inside the function main():
int main() {
int foo = 3;
printf("Hello World! foo = %d", foo);
return foo;
}
If the current line pointer is located in the function prologue (the code before the
first source-level breakpoint) or is otherwise on a line above the function main(),
the variables defined in the function are out of scope. In this case, entering the
following expression in the command pane:
> print foo
However, if the current line pointer is located inside the function main(), the same
input:
> print foo
outputs:
foo = 3
For information about variable lifetimes, see “Variable Lifetimes” on page 308.
#line
Address of the code at line number line in the current file.
("foo.c" # func # line)
Address of line line for function func in file foo.c.
func # line
Address of line line for function func.
("foo.c" # func ## label)
Address of label label for function func in file foo.c.
func ## label
Address of label label for function func.
Language-Independent Expressions
The Debugger always follows the operator definitions for the current language. For
example, in C, the assignment operator is one equal sign (=) and the equality
comparison is two equal signs (==). On the other hand, in some languages, (Ada,
for example) colon equal (:=) is the assignment operator, and one equal sign (=) is
the equality comparison. This can make definition of language-independent
expressions difficult. To overcome this problem, the Debugger always recognizes
colon equal (:=) as the assignment operator (in addition to the correct operator in
the current language) and two equal signs (==) as the comparison operator. To
ensure that expressions are language-independent, these operators should be used
to implement features or capabilities (such as button definitions) that may remain
in operation over several source languages.
Language Keywords
When the Debugger evaluates expressions, it understands the following keywords
for the current source language.
Language Keywords
C char, const, double, enum, float, int, long, long long, q15,
q31, short, signed, sizeof, struct, union, unsigned, void,
volatile, __accum, __bigendian, __bytereversed, __fixed,
__littleendian
C++ (All C Keywords), class, namespace, bool
• If the expression begins the same way as a Debugger command or begins with
a number, put the expression in parentheses () or explicitly use the print or
call command to distinguish it from the Debugger command. For example, to
look at the value of the variable c, enter (c) or print c. To call a function
named c(), enter call c(). If you just enter c, the Debugger will execute
the c (continue) command. For information about the print command, see
Chapter 8, “Display and Print Command Reference” in the MULTI: Debugging
Command Reference book. For information about the call command, see
Chapter 2, “General Debugger Command Reference” in the MULTI: Debugging
Command Reference book.
• If a filename such as class.cc or namespace.cc is the same as a language
keyword and is used in an expression or command, you must enclose the
filename in quotation marks. For example, the e foo.cc#2 command executes
successfully but the e class.cc#2 command does not. The second command
must be e "class.cc"#2.
• Use \ followed by Enter to span multiple lines.
• Comments begin with /* (forward slash + asterisk) and end with either a new
line or */ (asterisk + forward slash).
• C++ style (//) end-of-line comments are also supported.
• If the process has not been started, the expression may only contain constants
(global addresses may be considered constants, depending on your system).
After the process has started, the expression may also contain in-scope variables
and function calls.
• If the process is running, the expression may only contain constants and, if the
system allows, global and static variables and their addresses.
• If the process has not been started and was linked against shared objects,
expressions referring to functions and variables located within these shared
objects may not be allowed.
• There are restrictions on function calls and overloaded operator calls. For more
information, see “Function Calls” on page 315.
• The MULTI Debugger allows you to run, halt, step and set breakpoints in C99
programs just as in regular C programs. However, the MULTI expression
evaluator generally follows C89 rules, not C99 rules. Specifically, expressions
whose meaning depends on any of the following are not guaranteed to be
evaluated correctly by MULTI:
○ C99 complex types
○ C99 imaginary types
○ C99 NAN and INFINITY constants
○ Differences in the types of integer literals in C99
• MULTI may not be able to parse C++ expressions (such as casts) involving
types that contain non-type template parameters.
• In C++, template types with multiple adjacent right angle brackets (>) may
appear without intervening spaces, contrary to the C++ standard.
• C++ templated functions are not supported.
• In C++, the .* and ->* pointer-to-member operators and values of
pointer-to-member types are not supported.
• In C++, casts to reference types are not supported.
• In C++, the Debugger never calls destructors while evaluating an expression.
• In C++, you must include the enum, struct, or union keyword when referring
to an enumeration, structure, or union.
• In C++, expressions containing fully qualified function names are treated as
command line function calls.1 To work around this behavior, leave off the types
when specifying function names. If more than one function with the given
name exists—for example, foo(int) and foo(char)—a Browse window
prompts you to pick one.
• In C++, referring directly to the name of an overloaded operator function is
legal only within address expressions. See “Using Address Expressions in
Debugger Commands” in Chapter 1, “Using Debugger Commands” in the
MULTI: Debugging Command Reference book.
• In C++, names of types and variables inside of nested namespaces may not be
accessible.
• In C++, when multiple types with the same name exist in your program in
different namespaces, types outside the namespace of the function you are
1
There is an exception: expressions containing fully qualified names are treated as expressions, not command line function
calls, when used in conjunction with MULTI's e or examine command.
stopped in (if applicable), as well as types in the global namespace, may not
be accessible.
• Support for AltiVec vector data types is limited:
○ You cannot perform math operations on them.
○ You cannot cast them to or from non-vector types. You can, however,
convert pointers to them. For example, you can convert void * to vector
float *.
○ Vector assignment is supported, but direct numerical assignment is not.
For example:
vector unsigned int vector1;
vector unsigned int vector2;
Viewing Variables
There are several different methods for viewing the value of a variable, including
the following:
• Click the variable in the source pane to see information about the variable in
the command pane. For more information, see “Viewing Information in the
Command Pane” on page 174.
• Double-click the variable in the source pane.
• Use the print command or the examine command. For information about these
commands, see Chapter 8, “Display and Print Command Reference” in the
MULTI: Debugging Command Reference book.
• Enter the variable name in the command pane.
• Right-click the variable and select View Value.
You can use any of the formats listed in the following table to unambiguously refer
to a specific variable. Note that an arbitrary variable called fly is used in these
examples. Spaces before and after the # symbol are optional, but the pair of straight
double quotes ("") around a filename is required. Local variables need to be either
static or within a function on the stack.
fly
Performs a scope search for the variable fly, starting at the blue arrow and proceeding outward.
Local variables, local static variables, and parameters are checked first, then file static variables,
global variables, and special variables.
$fly
Searches the list of special variables for fly. See “MULTI Special Variables and Operators”
on page 322.
:fly
::fly
Searches for a global variable named fly.
(stack_depth # fly)
(stack_depth ## fly)
Uses the stack_depth function on the call stack for the scope search. This is useful if you are
debugging a recursive function and multiple instances are on the stack. You can then pick the
instance and display the value of the variable for that instance. The function currently containing
the program counter is at stack depth 0 (zero). See the e command in Chapter 11, “Navigation
Command Reference” in the MULTI: Debugging Command Reference book. Parentheses are
required for these cases.
(stack_depth ## label # fly)
Local variable fly in the lexical block at label label in function at stack depth stack_depth.
Parentheses are required for this case.
("foo.c" # func ## label # fly)
Local variable fly in the lexical block at label label in function func in file foo.c. Parentheses
are required for this case.
func ## label # fly
Local variable fly for block at label label in function func.
("foo.c" # func # fly)
Local variable fly for function func in file foo.c. Parentheses are required for this case.
func # fly
Local variable fly for function func.
("foo.c" # fly)
Static variable fly in file foo.c. Parentheses are required for this case.
. (This designator is a period.)
Represents the result of the latest expression.
Variable Lifetimes
The Green Hills Compilers augment the location description (such as register
number, stack offset, memory location) for user variables with lifetime information,
which indicates when the value at the given location is valid.
When you use Debugger commands (for example, print or view) or Data Explorers
to evaluate expressions, the messages listed in the following table may appear next
to the value of the expression.
Dead
The value displayed may be invalid because the location used to store the value of this variable
may have been reused by the compiler to store the value of a temporary (or another) variable.
Not Initialized
The value displayed may represent an uninitialized value.
Note
The Not Initialized message may not be accurate when it appears alongside
the elements of an array. For example, in the following code:
5 2 int localArr[10];
6 3 int idx;
7 4
8 5 * for (idx=0; idx < 10; idx++) {
9 6 * localArr[idx] = globalArr[idx];
10 7 * if (localArr[idx] > 10) {
11 8 * return -1;
12 9 }
13 10 }
The variable localArr is live in the file-relative line number range [9, 13). If
the PC pointer is located at file-relative line number 9, and idx has a value of 4,
all the elements of the array are displayed as Not Initialized, even though the
first four elements are initialized. But when you step to file-relative line number
10, all the elements of the array are displayed as initialized, even though it is only
the first five elements that are initialized.
Optimized Away
The variable was optimized away by the compiler and does not have any storage. No value will
be displayed in conjunction with this message.
For information about expression scope, see “Expression Scope” on page 300.
Examining Data
The following sections describe commands and shortcuts for examining data. In
the Debugger source pane, you can examine most items by double-clicking them.
See “The Data Explorer Window” on page 187.
Variables
Variable names are represented exactly the same way they are named in the program.
The case sensitivity of the current source language is used.
To display the value of a variable in the Debugger command pane, do one of the
following:
Expression Formats
You can use an expression format to specify the output format of some commands.
An example expression format follows:
[count][style[size]]
where count is the number of times to apply the format style style, and size is
the number of bytes to format. For example, print /4d2 fly prints, starting at
fly, four 2-byte numbers in decimal. If not specified, count defaults to one, and
size defaults to the size of the type printed.
These are appended to style. For example, print /xb fly prints a single
character-sized hex value.
If a format has a preset size (for example, character-sized in the case of /b, or
int-sized in the case of /O), the target dictates the size (for example, a target-sized
character).
When using an integer format style, specifying a size larger than the size of the
integer expression has no effect.
Note
Size specifiers override any preset size from a format. For example,
print /Ob fly prints a byte-sized octal, not an int-sized octal.
Value Effect
B Prints expr in binary.
c Prints expr as an ASCII character.
C
d Prints expr in decimal. If capitalized, expr is printed as an int-sized value.
D
e Converts expr to the style [-]d.ddde+dd, where there is one digit before the
radix character and the number of digits after it is equal to the precision
E
specification given for size. If size is not present, then the size of a double on
the current target is used.
f Converts expr to the decimal notation in the style [-]ddd.ddd, where the
number of digits after the radix character is equal to the precision specification
F
given for size. If size is not present, then the size of a double on the current
target is used. If size is explicitly zero, then no digits or radix characters are
printed.
g Prints expr in style f or e. The style chosen depends on the converted value.
Style e is used only if the exponent resulting from the conversion is less than -4
G
or greater than the precision given by size. Trailing zeros are removed from the
result. A radix character appears only if followed by a digit. This is the default
for floats and doubles. If size is not present, then the size of a double on the
current target is used.
i Using the expr as an address, disassembles a machine instruction.
You cannot specify a size with this format style.
I (Uppercase i) Using the expr as an address, disassembles a machine instruction.
If the address maps evenly to a line number in the source, it prints the source line
first. This allows you to see what the compiler generated for a line of source.
Using the mixed source/assembly mode in the source pane is an easier way to
view the same information.
You cannot specify a size with this format style.
n Prints expr using the “normal” format based on its type. If no format is specified,
this is the default. If capitalized, expr is not dereferenced; otherwise, if expr is
N
a pointer, it is dereferenced first.
Value Effect
o Prints expr in octal. If capitalized, expr is printed as an int-sized value.
O If expr is a floating-point number and either no size is specified or a size at least
as large as the floating-point type is specified, prints the octal number that has
the same bit representation as the floating-point number given by expr. For
example:
> print /o 1.1
00377614631463146314632
If a smaller size is specified either explicitly or by using the capitalized style, the
floating-point value is cast to an integer of the specified size before printing.
p (Lowercase p) Prints the name of the function containing address expr, along
with the filename and the source line or instruction that addresses maps. If size
is 1 or b, only the function name will be printed. If size is 2 or s, only the
filename and function name will be printed.
P (Uppercase p) Prints the name and signature of the function containing address
expr.
q Prints the floating-point number that has the same bit representation as the binary
number given by expr. For example:
> print /q 0x3ff199999999999a
1.100000
Value Effect
t Prints the type of expr after it has been evaluated. Note that this means that
print /t x++ increments x and prints its type. Also, if you print the type of a
reference, evaluation of the expression dereferences it. For example, if x is defined
as int& x = y;, the type printed by print /t x is int, not int&.
When used with Green Hills Compiler 2014 or later, the Debugger prints the
typedef name instead of the final type name. For example, given the following
C code:
typedef int myNumber;
myNumber intVal;
struct myStruct {
char *name;
myNumber count;
} myObj;
The Debugger prints myNumber (not int) as the type name of intVal and
myObj.count.
u Prints expr in unsigned decimal. If capitalized, expr is printed as an int-sized
value.
U
v Prints expr using the “normal” format based on its type. This is identical to n.
x Prints expr in hexadecimal. If capitalized, expr is printed as an int-sized value.
X If expr is a floating-point number and either no size is specified or a size at least
as large as the floating-point type is specified, prints the hexadecimal number
that has the same bit representation as the floating-point number given by expr.
For example:
> print /x 1.1
0x3ff199999999999a
If a smaller size is specified either explicitly or by using the capitalized style, the
floating-point value is cast to an integer of the specified size before printing.
See also q above.
z Prints expr as a set.
Note
For more information about expression formats and the various commands
that use them to display data or expressions, see the commands print,
examine, and eval in Chapter 8, “Display and Print Command Reference”
in the MULTI: Debugging Command Reference book.
Note
For information about the numberSeparator configuration option, which
allows you to specify a character to break up large numbers, see “Other
General Configuration Options” in Chapter 8, “Configuration Options”
in MULTI: Managing Projects and Configuring the IDE.
Language Dependencies
In C++, when the Debugger displays a class, it also displays the fields of all the
parents of that class, including virtual parents, if that information is available. Static
fields associated with a class are also displayed. Additionally, fields of the class or
its parents that are stored by reference will be displayed as an address preceded by
an at sign (@).
Wildcards
In some contexts, the Debugger supports the use of wildcards in function and file
names (for example, with the e command and in the File Locator and Function
Locator). A question mark (?) matches any single letter, while an asterisk (*) or an
at sign (@) matches any number of letters. For example, the sequence ??* matches
all names that are at least two characters long.
The following table lists several different formats for referring to functions in C++.
Text you substitute for the replaceable words (italicized) may contain wildcards.
class::func
Matches all members whose names match func of all classes whose names match class,
regardless of their arguments.
::func
Matches all global or static functions whose names match func. Argument types may be supplied
to restrict the match.
func
Matches all functions, whether class members or not, whose names match func.
Function Calls
Making function calls from the Debugger command pane requires your program
to be linked with libmulti.a, a library supplied by Green Hills. For more information,
see the documentation about enabling command line function calls in the MULTI:
Building Applications book.
In C++, overloaded operators may be called provided that they are not inlined and
that the left side of the expression is not contained completely within a register.
Thus, the following expression:
complex(1,2) + complex(2,3)
is converted into the appropriate function calls. Constructors are called when
appropriate, again provided that they are not inlined.
However, if fly were a small struct contained entirely within a register, the
following expression:
fly += bee;
would fail.
You can make a command line function call to any non-inlined function in the
program being debugged. For example, assume that the function printf() is
referenced in the program, and thus the code for it is on the target. In this case you
may enter:
printf("Hello, %s!\n", "world")
If the name of the function you are trying to call is the same as that of a MULTI
command, the MULTI command is executed instead of the function. To specify
that MULTI commands are ignored when you call a function from the command
pane, enter the call command before the function. For example, suppose you want
to make a command line function call to a function named e that takes an integer.
Enter:
call e(1)
MULTI executes the e command instead. For information about the call command,
see Chapter 2, “General Debugger Command Reference” in the MULTI: Debugging
Command Reference book.
To find out what functions are available to be called, use one of the following
commands to list the functions in the program being debugged:
Tip
To gain access to library routines that are not referenced anywhere in the
program code, and thus are not linked into the program image, add a
dummy reference to the program and recompile.
Note
Attempting to make function calls from a setup script (.mbs) file will
result in an error. Additionally, if your setup script contains a call to a
Debugger macro that has the same name as a function in your program,
the Debugger macro will be chosen in preference to the function.
• Once you initiate a command line function call, control will not be returned to
the user until the called function returns, or the target halts (for example, because
it hit a breakpoint). You can typically regain control by hitting the Esc key.
Command line function calls to functions that use the host I/O facilities of the
Debugger to make blocking calls (for example, reading input from the user via
the I/O pane) are not supported.
• Any breakpoints encountered during command line function calls are handled
as usual.
• In some cases, interrupts may need to be disabled before command line function
calls will work.
• When you are debugging via a freeze-mode connection to an operating system
kernel:
○ Command line function calls are not allowed if an OSA task is selected
in the target list; and
○ Command line function calls are not recommended if the OSA master
process is selected. You can bypass this restriction if you know it is safe
to do so by issuing the command configure AllowProcCallInOsaTask
on (see “Other Debugger Configuration Options” in Chapter 8,
“Configuration Options” in the MULTI: Managing Projects and
Configuring the IDE book).
• If function prototype information is available, the Debugger checks the function
prototype and converts each argument expression to the type of the
corresponding argument. If it is not available, automatic promotion of arguments
and detection of invalid arguments are not supported. In this case, you should
ensure that function arguments specified are compatible with the function being
called.
• For calls to functions written in assembly language, the Debugger cannot
perform argument conversions, check that the types of arguments are correct,
or check that the number of arguments is correct.
• When evaluating an expression, the Debugger may call any compiled function,
with or without arguments, including both application and operating system
functions. However, an OS function on the target system is only called if it is
already linked into your program. You are responsible for ensuring that any
system calls that are called from the command line are linked into the program.
• C++ templated functions are not supported.
• In C++ or any language with inlined functions, a function that is always inlined
(so there is no stand-alone version of the function) may not be called.
• In C++, when the expression evaluator is unable to disambiguate overloaded
function names, a dialog box prompts you to identify what function to use.
• In C++, default arguments are not inserted.
• In C++, the class member operator(), the function call operator, and the
new() and delete() operators are not supported.
• In C++, any function or method whose return type has a copy constructor cannot
be called from the command line.
• In C++, any function or method that takes a parameter having a type with a
copy constructor cannot be called from the command line.
• If you are using a run-mode debug server such as rtserv or rtserv2, you may
only make command line function calls on halted tasks that are actually runnable
(as opposed to halted tasks that were pended before being halted). If MULTI
detects an attempt to make a function call on a task that was halted while
performing a system call (tasks are not runnable in this context), MULTI will
attempt to step the task out of the system call. If you want to regain control of
the task before the system call completes, press Esc. However, MULTI is not
always able to detect situations in which it is unsafe to make command line
function calls on a given run-mode task that is halted. If you are debugging an
INTEGRITY run-mode target, see “Run-Mode Debugging” in the INTEGRITY
Development Guide for more information.
• You cannot step or run back into TimeMachine mode while a command line
function call is in progress.
• Arguments of function pointer type are not supported on targets such as 64-bit
Power Architecture where the ABI requires the use of function descriptors.
The Debugger will attempt to detect and reject attempts to pass a value of
function pointer type as an argument to a command line function call on these
targets.
• If you are using synchronous debugging, only one task (among all the tasks
for which synchronous debugging is enabled) is allowed to execute a command
line function call at a time.
Preprocessor Macros
From the command pane, you can evaluate C/C++ preprocessor macros defined in
the program you are debugging if the macro is used somewhere in the program and
if the program has been compiled with generation of debugging information enabled.
See the MULTI: Building Applications book for information about generating
debugging information.
is a function-like macro.
If an object-like preprocessor macro and another symbol in your program share the
same name, the symbol takes precedence over the macro if the symbol is local to
the current function or file. If, however, a function-like preprocessor macro and
another symbol in your program share the same name, the macro always takes
precedence over the symbol.
The following table lists the most common methods of interaction with preprocessor
macros.
Action Meaning
Click • Object-like preprocessor macros: displays the evaluated value of the
macro, whatever that may be. In some instances, this may result in
an error message similar to Unknown name "foo" in
expression. This is because the Debugger is evaluating the
preprocessor macro in the current context, and a variable necessary
to completely evaluate it is not defined within the current scope.
• Function-like preprocessor macros: displays the definition of the
macro.
Action Meaning
Click and Select • Object-like preprocessor macros: equivalent to a click.
• Function-like preprocessor macros: displays the evaluated value of
the macro if the arguments are selected as well. If they are not, this
is equivalent to a click. The caveats that apply to clicking an
object-like preprocessor macro (see above) apply to clicking and
selecting a function-like preprocessor macro and its arguments.
Right-click Opens a shortcut menu. See “The C/C++ Preprocessor Macro Shortcut
Menu” on page 736.
In a standard Expands the preprocessor macro with its evaluation in the current scope,
expression (that is, as click above (or click and select for function-like preprocessor macros)
not an address does. Expression evaluation is aborted entirely if any of the variables used
expression) by the macro are not defined in the current scope.
Debugger Macros
You can evaluate Debugger macros from the command pane, alone or as part of
larger expressions.
Debugger macros are defined using the define command. See “define” in Chapter 15,
“Scripting Command Reference” in MULTI: Debugging Command Reference.
The body of a Debugger macro is a command list that can contain if statements and
loops. See “Using Command Lists in Debugger Commands” in Chapter 1, “Using
Debugger Commands” in MULTI: Debugging Command Reference, and see the
descriptions of the if, do, for, and while commands in “Conditional Program
Execution Commands” in Chapter 15, “Scripting Command Reference” in MULTI:
Debugging Command Reference.
Debugger macros can also return a value by using the return command in the body.
See “return” in Chapter 15, “Scripting Command Reference” in MULTI: Debugging
Command Reference.
You can invoke a Debugger macro as if it were a function or MULTI special operator
by issuing the command name([argument_values]). The statements in the body
of the Debugger macro will then be executed as described above.
For example, you can define a Debugger macro that returns the sum of its arguments
like this:
> define sum(x, y) {return(x + y)}
> sum(3,6)
9
If a function in your program has the same name as a Debugger macro, you can
invoke the Debugger macro by prefixing it with a dollar sign ($). This is good
practice in setup script (.mbs) files. For example:
> $sum(3,6)
9
Debugger macros differ from C/C++ preprocessor macros in that the values of the
arguments to Debugger macros are not simply lexically substituted. This means
that when executing some MULTI commands in Debugger macros, you may have
to take extra steps to ensure that arguments are evaluated correctly. One method is
to use the substitute command. See “substitute” in Chapter 15, “Scripting Command
Reference” in MULTI: Debugging Command Reference. For example:
> define fails(bar) { b bar }
> fails(main)
No match to bar*
> define works(bar) {substitute %EVAL{mprintf("b %s",bar)}}
> works("main")
main#1: 0xlocation count: 1
A trace of the Debugger macro call stack can be produced with the macrotrace
command. See “macrotrace” in Chapter 15, “Scripting Command Reference” in
MULTI: Debugging Command Reference. If an error occurs inside a Debugger
macro, a trace of the Debugger macro call stack is printed, and all pending Debugger
macro executions are aborted.
While Debugger macros give you the ability to execute most MULTI commands,
they may not be appropriate for all scripting purposes. For information about more
powerful scripting functionality in MULTI, see Chapter 2, “Introduction to the
MULTI-Python Integration” in MULTI: Scripting.
The MULTI special variables and operators include user-defined variables (such
as $foo), pre-defined system variables (such as _DATA), processor registers (such
as $r1), and special operators (such as $bp_adr(%bp_label)).
When the Debugger is evaluating an expression and it finds a variable name such
as foo, it first performs a scope search in the program to see if the variable exists.
If the variable does not exist, then the list of special variables and operators is
searched. Variable names beginning with a dollar sign ($), such as $foo, are assumed
to be special variables or operators.
User-Defined Variables
You can define a new variable by entering a statement of the following format into
the Debugger command pane:
$variable_name [=expression]
where:
User-defined variables are of the same type as the last expression assigned. For
example, entering:
• $foo=1
creates the special variable $foo, assigns it the value 1, and makes its type int.
• $bar=3*4
creates the special variable $bar, assigns it the value 12, and makes its type
int.
• $baz=myInstance.a
creates the special variable $baz, assigns it the value of myInstance.a, and
makes it the same type as myInstance.a.
User-defined variables are just like any other, except that it is meaningless to evaluate
their addresses.
User-defined variables are generally accessible only in the thread context in which
they were defined. Exceptions to this are:
• Variables whose names begin with G_, indicating that they are global (that is,
common to all thread contexts in the current Debugger session).
• Variables whose names begin with R_, indicating that they are common to all
thread contexts on the same target connection (debug server) in the current
Debugger session.
System Variables
The following table lists supported system variables. Modifying the values of these
variables changes the way the Debugger operates. To display the value of a system
variable, enter it in the Debugger command pane with a dollar sign prepended to it
(for example, $ANSICMODE).
ANSICMODE
Note
This variable is deprecated. It has a true value by default, and you should not
change it. It may be made read-only and/or removed in a future release.
When set to true, which is the default value, expressions are evaluated as in ANSI C. When
set to false, expressions are evaluated as they are in K+R C. Generally, this affects how
unsigned shorts, unsigned chars, and unsigned bitfields are coerced. In K+R, they are
coerced to unsigned int, whereas in ANSI they are coerced to int. Thus ((unsigned
short) 3)/ -3 yields different results in ANSI and K+R. The type of sizeof is different,
as is the interpretation of the op= operators in certain obscure cases.
CONTINUECOUNT
If this is 0 (zero) or 1, the Debugger will stop at the next breakpoint. If it is 2, the Debugger
will stop at the second breakpoint reached by the process, and so on. To set its value, use a
continue command that takes @continue_count as an argument. For example, to set it to 3,
you could enter c @3. When the program is restarted, the count is cleared. For more information,
see “Continue Commands” in Chapter 13, “Program Execution Command Reference” in the
MULTI: Debugging Command Reference book.
DEBUGSHARED
Enables/disables debugging of shared objects. This system variable is only relevant with targets
that support shared libraries, such as certain native Linux/Solaris platforms or advanced embedded
real-time operating systems.
DEREFPOINTER
Controls whether or not pointers are automatically dereferenced when displayed by the print,
examine, and view commands. For information about the print and examine commands, see
Chapter 8, “Display and Print Command Reference” in the MULTI: Debugging Command
Reference book. For information about the view command, see “General View Commands” in
Chapter 21, “View Command Reference” in the MULTI: Debugging Command Reference book.
DISNAMELEN
Controls the length of the label printed when labels appear in certain cases in disassembly. For
example, the disassembly of a call or branch may include the target label; DISNAMELEN controls
how many characters of that constant to print.
FASTSTEP
When set to nonzero (the default), the Debugger attempts to speed up source code stepping. On
each source step, the Debugger analyzes the code, sets temporary breakpoints on all possible
step destinations, and allows the process to run until one of the breakpoints is hit. This allows
the process to run at nearly full speed during the source step. When set to 0 (zero), the Debugger
usually steps one machine instruction at a time until it reaches the next source line. However,
it still sets temporary breakpoints and runs to step over function calls. This method is generally
much slower.
This system variable corresponds to Debug → Debug Settings → Fast Source Step.
SERVERTIMEOUT
How long (in seconds) MULTI will wait for a debug server to respond before concluding that
the server has failed. MULTI will prompt the user to close the connection or keep waiting.
TASKWIND
If this is 0 (zero), the Task Manager (for multitasking targets) will be disabled.
VERIFYHALT
Verifies halting a process before setting a breakpoint by bringing up a confirmation dialog.
System variables beginning with an underscore (_), such as those shown in the
following table, represent the internal state of the Debugger and are not normally
listed. To see them, use the command l s _ (lowercase L, lowercase s, underscore).
For information about the l command, see Chapter 8, “Display and Print Command
Reference” in the MULTI: Debugging Command Reference book.
_ASMCACHE
When set to 1, which is the default value, the disassembly of program code in the Debugger
window is done by reading data from the executable file, not from the program being debugged
on the target. This allows a faster disassembly display to the screen. Setting _ASMCACHE to 0
(zero) forces the Debugger to read the text to be disassembled from the program being debugged,
instead of from the buffer or executable file. If instruction memory is modified or destroyed
and _ASMCACHE is 1, then displays of disassembled instructions will continue to show the
original, unmodified instructions in the executable file. This is confusing because the instructions
actually executed are not those shown by the disassembly display.
Sometimes, when a peculiar behavior occurs on the target system, such as when the process
stops on an apparently valid instruction or when it refuses to single-step or continue past a valid
instruction, then the instruction memory on the target system has been corrupted. Try setting
_ASMCACHE to 0 (zero) and redisplaying the assembly code. You may find invalid instructions
at the point of failure. (You may need to turn off _INTERLACE (assembly) mode and examine
another part of the program, turn _INTERLACE mode back on, and then return to the point of
the entry to clear out the Debugger's internal disassembly cache.)
_AUTO_CHECK_COHERENCY
If nonzero, automatic coherency checking is enabled. If zero, automatic coherency checking is
disabled. For more information, see “Detecting Coherency Errors” on page 664.
See also the _AUTO_CHECK_NUM_ADDRS variable below.
_AUTO_CHECK_NUM_ADDRS
Sets the number of addresses to check for coherency. Because extra memory is read on every
stop, use care when setting the number of addresses to be read. Setting a large number of
addresses may slow normal run control. By default, MULTI checks either 16 addresses or the
number of addresses lasting the length of 4 instructions (whichever is fewer).
The value of this variable is only meaningful if automatic coherency checking is enabled. See
the _AUTO_CHECK_COHERENCY variable above.
For more information, see “Detecting Coherency Errors” on page 664.
_CACHE
If nonzero, the Debugger uses a cache for reading memory from the target. The cache is
invalidated every time the process state changes. This speeds up embedded debugging.
Because certain devices such as memory-mapped hardware registers and control ports must be
accessed using a specific memory access size, you must disable the _CACHE variable before
viewing memory that corresponds to these devices. Alternatively, you may choose to use the
memread and memwrite commands to precisely access memory for these devices even while
the cache is enabled. For information about these commands, see Chapter 10, “Memory Command
Reference” in the MULTI: Debugging Command Reference book.
_DATA
Used only for position-independent data (PID) systems where the executable is linked as if it
were at one address, while it runs at another. This variable is set to the offset between the location
at which the data segment resides and at which it is linked. It should not be set to -1. This is
set on the command line with the -data option.
_DISPMODE
Determines whether assembly code is interlaced with source code in the source pane. See “The
Command Pane Shortcut Menu” on page 736. This variable has no effect in Assem source pane
display mode.
_INIT_SP
Tells the Debugger the value of the stack pointer at program startup, in certain target environments
where this information is not available.
_LANGUAGE
Shows which language-specific rules for the expression evaluator are in use. 0 (zero) means C,
3 means C++, 7 means Assembly, and 31 [default] means auto-select based on the type of
current file. You should not usually need to change this system variable from its default value.
_LINES
This controls the number of lines displayed by the printwindow command, and in non-GUI
mode, also controls the number of lines shown between More? prompts. For information about
the printwindow command, see Chapter 8, “Display and Print Command Reference” in the
MULTI: Debugging Command Reference book.
_OPCODE
If nonzero, disassembly mode displays the hexadecimal value of the instruction.
_TEXT
Used only for position-independent code (PIC) systems where the executable is linked as if it
were at one address, while it runs at another. This variable is set to the offset between the location
at which the text segment resides and links. It should not be set to -1. This variable is set on
the command line with the -text option.
_VOLATILE
If nonzero, the Debugger attempts to limit memory reads from the target. If zero, the Debugger
does not attempt to limit memory reads. For more information, see “Memory Sensitive Mode”
on page 117.
_VOLATILEDISPMAX
Sets the approximate number of bytes that the Debugger will read around the program counter
when trying to display machine instructions. For more information, see “Memory Sensitive
Mode” on page 117.
The value of this variable is only meaningful if memory sensitive mode is enabled. See the
_VOLATILE variable above.
Note
Supported values for the system variables whose names begin with
_TARGET are defined in the os_constants_internal.grd file located at
compiler_install_dir/defaults/registers.
_BREAK
The current breakpoint number.
_CURRENT_TASKID
The task ID of the currently executing OSA task.
_ENTRYPOINT
The address of the entry point (for example, _start) for the current thread, if any. Note that
this may differ from the entry point of user code (for example, main). _ENTRYPOINT is not
adjusted for the PIC base address of PIC programs.
_EXEC_NAME
The name and path of the program currently loaded in the Debugger.
_FILE
The name of the current file.
_INTERLACE
Indicates whether assembly code is displayed in the source window. If there is assembly code
currently displayed in the source window, then this is 1; otherwise it is 0 (zero).
_LAST_COMMAND_STATUS
The status of the last MULTI command execution (0 means failure, 1 means success).
_LAST_CONNECT_CMD_LINE
The argument(s) last run with the MULTI connect command. For information about the connect
command, see “General Target Connection Commands” in Chapter 17, “Target Connection
Command Reference” in the MULTI: Debugging Command Reference book.
_LINE
The current line number.
_MC_CONFIG_FILE
The full path to the multi-core configuration file, if any.
_MULTI_DIR
The name of the directory that contains the MULTI executable.
_MULTI_MAJOR_VERSION
MULTI's major version (for example, 1 in MULTI 1.2.3).
_MULTI_MICRO_VERSION
MULTI's micro version (for example, 3 in MULTI 1.2.3).
_MULTI_MINOR_VERSION
MULTI's minor version (for example, 2 in MULTI 1.2.3).
_NONGUIMODE
This indicates whether or not MULTI was started in non-GUI (-nodisplay) mode.
_OS_DIR
The full path to the directory containing the Green Hills RTOS installation used to build the
program currently loaded in the Debugger. _OS_DIR contains an empty string if the RTOS
installation directory cannot be determined.
_PID
The identification number (ID) of the process, as reported by the debug server.
_PROCEDURE
The name of the current function.
_PROCESS
MULTI's internal slot number for the current process.
_REMOTE_CONNECTED
This is 1 if a remote target connection has been established, 0 (zero) otherwise.
_RTSERV_VER
The version number of rtserv (2 indicates rtserv2, 1 indicates rtserv, and 0 indicates a
non-rtserv connection).
_SELECTION
A string variable representing the current selection from the source pane.
_SETUP_SCRIPT
The full path to the file containing the setup script for the current connection. If the current
process is not connected or the current connection does not have a setup script, _SETUP_SCRIPT
contains an empty string.
_SETUP_SCRIPT_DIR
The full path to the directory containing the setup script for the current connection. If the current
process is not connected or the current connection does not have a setup script,
_SETUP_SCRIPT_DIR contains an empty string.
_STATE
The process state, where:
• 1 = No child
• 2 = Stopped
• 3 = Running
• 4 = Dying
• 5 = Just forked
• 6 = Just exec'ed
• 7 = About to resume
• 8 = Zombied
_SYNC_RC
This indicates whether synchronous debugging is enabled for the connection, where:
• -1 = No connection is established
• 0 = Synchronous debugging is not enabled
• 1 = Synchronous debugging is enabled
_TARGET
Contains a unique identifier indicating the target processor's family and variant.
_TARGET_COPROCESSOR
Contains a unique identifier indicating the target coprocessor's variant.
_TARGET_FAMILY
The family of the target on which the program being debugged is running.
_TARGET_IS_BIGENDIAN
Indicates whether the target is big endian (1) or little endian (0).
_TARGET_OS
Displays an identifier indicating which OS is running on the target, if such information is
available. If you are debugging an OS with a freeze-mode connection, this is 0.
_TARGET_MINOR_OS
Displays an identifier indicating which minor type of OS is running on the target, if such
information is available. If you are debugging an OS with a freeze-mode connection, this is 0.
_TARGET_SERIES
This may contain information about whether the target processor is a member of a certain series
of processors (for example, the PowerPC 400 series). This does not work for all processor
families.
_TASK_EXIT_CODE
The exit code of the current task.
_TOOLS_DIR
The name of the directory that contains the Green Hills Compiler executables.
_TOP_PROJECT
The full path to the Top Project used to build the program currently loaded in the Debugger.
The setting of this variable reflects the path that was correct at the time the program was built;
if you move the project, you must rebuild it and reload the program to update this variable. This
variable contains an empty string if the name of the project file cannot be determined.
_TOP_PROJECT_DIR
The full path to the directory containing the Top Project used to build the program currently
loaded in the Debugger. The setting of this variable reflects the path that was correct at the time
the program was built; if you move the project, you must rebuild it and reload the program to
update this variable. This variable contains an empty string if the name of the project file cannot
be determined.
Processor-Specific Variables
Processor registers are included as predefined variables. To find out what register
names are available on your system, use the command l r (lowercase L, lowercase
R) to list the registers. For information about the l command, see Chapter 8, “Display
and Print Command Reference” in the MULTI: Debugging Command Reference
book.
All registers can be treated as integers of the correct size for the register. Be careful
when you modify the contents of registers when you are debugging high-level code;
the results of these modifications can often produce unpredictable effects.
$result
Holds the return value of the most recently completed function. This variable is an alias for the
register on the processor architecture used for returning integers. On most systems, this is also
the register to return pointers. It may be written to as well as read from.
This value is not guaranteed to be correct; it depends on the return type of the function and the
processor architecture. The actual return variable may be located elsewhere. As with any register,
you must be careful when you change its value.
Special Operators
The Debugger maintains a list of special operators that are not a part of your program,
but can be used in the Debugger as if they were. For example, you can use special
operators in expressions that you evaluate in the Debugger.
$bp_adr(%bp_label)
Returns the address of the breakpoint with label bp_label.
$entadr(function)
Returns the address of the first instruction after the given function function's prologue code.
(The function prologue code is also known as the stack frame setup code or the entry code.)
If the function does not exist within the program being debugged, $entadr() returns -1.
If function is not given, the current function is used.
$exists("symbol")
$M_sym_exists("symbol")
Returns a Boolean indicating whether the symbol symbol exists within the program currently
being debugged.
$in(function)
Returns true if the current process is stopped and the current program counter (PC) is in the
given function function.
$M_called_from(level, "string")
Returns a Boolean indicating true if the level is 0, and "string" is the name of a function
on the current call stack. Otherwise, it returns true if "string" is the name of the function at
the call stack depth indicated by level.
$M_can_read_address(num)
Returns true if the address indicated by num is readable; returns false otherwise.
$M_file_exists("file")
Returns a Boolean indicating whether the file file exists within the program currently being
debugged.
$M_get_temp_memory(size)
Returns an address that points at a chunk of memory of size address units. If size is too large,
an error message is printed and -1 is returned as the address. This chunk of memory is guaranteed
to be valid only until MULTI needs more temporary memory on the target. In practice, it should
remain valid until the next time the user stores a string or other data structure to the target (by
calling a constructor at the command pane, for example).
Using this special operator requires that:
• Your program has been linked with libmulti.a, a library supplied by Green Hills. For more
information, see the documentation about enabling command line function calls in the
MULTI: Building Applications book.
• Global variables have been initialized in the program being debugged. Typically,
initialization occurs before main() is called; however, this may not be true while you are
debugging startup code.
$M_offsetof(type, field)
offsetof(type, field)
Returns the offset in bytes of the member field field within the aggregate type type. The first
parameter must be either an aggregate (struct, union, or class) type name or an instance of an
aggregate type. The second parameter must be the name of a field within that type.
Note that entering offsetof(type, field) in the command pane may execute a preprocessor
macro or function call if the current program has a preprocessor macro or function call with the
name offsetof. To guarantee the use of the Debugger's built-in operator, use $M_offsetof().
$M_proc_end(function)
Returns the address one byte past the end of function's last instruction.
$M_sec_begin("section")
Returns the address of the beginning of the section section. It returns -1 if the section does
not exist within the program currently being debugged.
$M_sec_end("section")
Returns the address of the end of the section section. It returns -1 if the section does not exist
within the program currently being debugged.
$M_sec_exists("section")
Returns a Boolean indicating if the section section exists within the program currently being
debugged.
$M_sec_size("section")
Returns the size of the section section. It returns -1 if the section does not exist within the
program currently being debugged.
$M_strcmp(expr, "string")
Returns an integer greater than, equal to, or less than zero if the string pointed to by the first
parameter is lexicographically greater than, equal to, or less than the string pointed to by the
second parameter. The first parameter must be an expression that evaluates to a string and the
second parameter must be a string constant.
$M_strcpy(expr, "string")
Returns the number of bytes written. The first parameter must be an expression that evaluates
to a string and the second parameter must be a string constant.
$M_strprefix(expr, "string")
$M_strcaseprefix(expr, "string")
Returns a Boolean indicating whether the first parameter is prefixed by the second
($M_strcaseprefix is case-insensitive). The first parameter must be an expression that
evaluates to a string and the second parameter must be a string constant.
$M_strstr(expr, "string")
Returns a pointer to the first occurrence of the second parameter string within the first parameter
string, or a null pointer if it is not found. The first parameter must be an expression that evaluates
to a string and the second parameter must be a string constant.
$M_typeof(var)
Returns the type of var, suitable for use in casting. For example:
$foo = (($M_typeof(my_var)) 0x10000)
would give the value of 0x10000 to the MULTI local variable $foo and give it the same type
as my_var.
Note
This operator is only intended to be used in cast expressions. Use print /t to print
the type of an expression. For more information, see “p, print” in Chapter 8, “Display
and Print Command Reference” in MULTI: Debugging Command Reference.
$M_var_is_valid(var)
Returns true if var is initialized and its location has not been reused to store the value of some
other variable (that is, it is not yet dead, and it has not been optimized away). Returns false
otherwise. You must specify a variable that exists in the current scope; if it does not, attempting
to use this operator will produce an error.
$retadr(function)
Returns the address of the first instruction of the given function function's epilogue code.
(The function epilogue code is also known as the stack frame release code or the return code.)
For a function without source line debug information, $retadr() returns the address one byte
past the end of function's last instruction (the same as $M_proc_end()).
If the function does not exist within the program being debugged, $retadr() returns -1.
If function is not given, the current function is used.
sizeof(variable)
sizeof(type)
sizeof(“string”)
sizeof((expression))
Behaves similarly to the C sizeof operator and returns the size in bytes of the type of variable,
of type, or of the type resulting from expression. If “string” is specified, this operator
returns strlen("string") + 1. Unlike the C sizeof operator, this operator actually evaluates
any argument provided, such that if an expression with side effects is specified, the side effects
occur.
Syntax Checking
The syntax checking mechanism checks the validity of a command without actually
executing it, and thus without requiring target interactions and without changing
the system settings.
The Debugger command sc performs syntax checking. It can be used in two different
ways.
To check the syntax of an entire script file and all nested files, enter:
sc < script_file_name
For more information, see the sc command in “Record and Playback Commands”
in Chapter 15, “Scripting Command Reference” in the MULTI: Debugging Command
Reference book.
Note
You can use the bpSyntaxChecking configuration option to disable this
automatic syntax checking. For more information, see the
bpSyntaxChecking option in “The More Debugger Options Dialog” in
Chapter 8, “Configuration Options” in the MULTI: Managing Projects
and Configuring the IDE book.
Contents
Setting the Active Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
The Memory Pane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
Controlling Memory Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
Editing Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
The Memory View Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
Memory View Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
Chapter 15. Using the Memory View Window
The Memory View window is useful for examining large buffers, strings, and other
contiguous blocks of memory. The window can be configured to display memory
in a variety of formats. Memory may also be modified from this window.
To open the Memory View window, perform one of the following actions:
When you specify a new active location, target memory is read and the displayed
memory begins with the address of the active location. To change the active location,
do one of the following:
Note
Scrolling the window does not change the highlighted location or the
contents of the Location bar. To return to the active location, press Enter.
If you would like the Memory View window to track the location of the symbol
each time it changes, click the Lock Address button ( ) so that it no longer appears
pushed down. In this mode, the active location is updated every time the address
for the symbol changes.
The Address column displays the location of the first byte of each row and can
never be removed from the pane. You can view the rows of memory in ascending
or descending order. To change the order, click the header of the Address column.
Each view column displays the formatted contents of memory at that location.
• Right-click the header of a column and select a formatting option from the
shortcut menu.
• Select View → Column number name and select a formatting option from
the submenu.
The primary formatting options are Hex, Decimal, Binary, Floating Point, Fixed
Point, Ascii, Symbols, Disassembly, and Offset. You may see additional view
column formats if your CPU supports them.
Action Procedure
Resize Column One of:
Automatically
• Right-click the header of a column and enable Size to Fit from
the shortcut menu.
• Enable View → Column number name → Size to Fit.
• Double-click the access size display area. In the Access Sizes dialog box that
appears, select the new access sizes from the drop-down lists.
• Right-click the access size display area, select Read Access Size or Write
Access Size, and select the new access size from the submenu.
• Select Memory → Set Access Sizes. In the Access Sizes dialog box that
appears, select the new access sizes from the drop-down lists.
The contents of the memory pane are automatically refreshed to reflect your changes.
Note
Access sizes do not affect how memory is displayed in the view columns.
Editing Memory
You can edit the contents of memory in the Hex, Decimal, Binary, and ASCII
columns. To edit the contents of memory, perform the following steps:
3. Repeat steps 1 and 2 for all of the characters you would like to modify.
4. Do one of the following:
• Click .
• Right-click the memory pane and select Write Changes to Target.
• Select Memory → Write Changes to Target.
Until you perform this step, your changes will not be written to target memory.
Button Effect
Reload Forces the window to update its contents, even if frozen, by
immediately re-reading target memory.
Clicking this button is equivalent to selecting Reload from
Target from the Memory menu or the shortcut menu.
Write Changes to Target Writes memory modifications made in the Memory View
window to the target.
Clicking this button is equivalent to selecting Write Changes
to Target from the Memory menu or the shortcut menu.
Lock Address Locks the address of the symbol in the location bar. This is
the default behavior. To unlock the address and track the
location of the symbol each time it changes, click this button
so that it no longer appears pushed down. For more
information, see “Locking the Current Symbol's Location”
on page 339.
Freeze Prevents location changes and automatic updates. To re-enable
these window updates, click the Freeze button again.
Open Cache View Opens the Cache View window. See “The Cache View
Window” on page 398.
This button is not available for all targets.
Find in Caches Opens the Cache Find window on the active location. See
“The Cache Find Window” on page 402.
This button is not available for all targets.
Save Current View to File Saves the contents of the Memory View window to a text
file. The information contained in the text file is formatted
exactly as it appears in the columns of the Memory View
window.
Print Prints the memory pane contents. All view column data is
printed for each address currently in view.
Close Closes the Memory View window.
Clicking this button is equivalent to selecting Memory →
Close.
Whether this button appears on your toolbar depends on the
setting of the option Display close (x) buttons. To access this
option from the Debugger, select Config → Options →
General Tab.
Item Meaning
Reload from Target Forces the window to update its contents, even if frozen, by
immediately re-reading target memory.
Selecting this menu item is equivalent to clicking the Reload
button ( ) or selecting Reload from Target from the shortcut
menu.
Set Access Sizes Opens a window that allows you to specify preferred read
and write access sizes.
Selecting this menu item is equivalent to double-clicking the
access size display area.
Use Block Reads Toggles whether or not the Memory View window performs
all target memory reads as block memory accesses. By default,
this option is enabled. For more information, see “Disabling
Block Reads” on page 343.
Selecting this menu item is equivalent to right-clicking the
access size display area and selecting Use Block Reads.
Open Cache View Opens the Cache View window. See “The Cache View
Window” on page 398.
Selecting this menu item is equivalent to clicking the Open
Cache View button ( ).
This menu item is not available for all targets.
Find in Caches Opens the Cache Find window on the active location. See
“The Cache Find Window” on page 402.
Selecting this menu item is equivalent to clicking the Find
in Caches button ( ).
This menu item is not available for all targets.
Save View to File Saves the contents of the Memory View window to a text
file. The information contained in the text file is formatted
exactly as it appears in the columns of the Memory View
window.
Selecting this menu item is equivalent to clicking the Save
Current View to File button ( ).
Print Prints the memory pane contents. All view column data is
printed for each address currently in view.
Selecting this menu item is equivalent to clicking the Print
button ( ).
Save Settings as Default Saves the memory pane settings as the default Memory View
window configuration.
Item Meaning
Close Closes the Memory View window.
Selecting this menu item is equivalent to clicking the Close
button ( ).
For information about the commands referenced in the preceding table, see Chapter
10, “Memory Command Reference” in the MULTI: Debugging Command Reference
book.
Unless otherwise stated, all descriptions of toggle options explain the behavior of
the option when enabled.
Item Meaning
Hide/Show Hides or shows the column. This option toggles between Hide
and Show.
Remove Deletes the column.
Size to Fit Sets the column to automatically adjust its width to contain
displayed data.
Hex Displays the column's memory contents as hexadecimal
numbers.*
Decimal Displays the column's memory contents as decimal numbers.*
Binary Displays the column's memory contents as binary numbers.*
Floating Point Displays the column's memory contents as floating-point
numbers.*
Fixed Point Displays the column's memory contents as fixed point
numbers.*
Ascii Displays the column's memory contents as ASCII characters.
Any memory that cannot be represented by an ASCII character
is displayed as a dot (.).
Symbols Displays the column's memory contents as a comma-separated
list of global symbols. Symbols that continue from previous
addresses are represented with the string “...”.
Disassembly Displays the column's memory contents as a
semicolon-separated list of assembly instructions. In regions
of memory without symbol information, inaccurate
instructions may be displayed if the beginning of the window
is not aligned with the start of an instruction.
Offset Displays the offset between the active location and the start
of the row.
number byte(s) Sets the column's unit size. Available numbers are 1, 2, 4, and
8.
These menu items are only available for the Hex, Decimal,
and Binary columns.
Signed Interprets memory data as signed decimal integers.
This menu item is only available for the Decimal column.
Unsigned Interprets memory data as unsigned decimal integers.
This menu item is only available for the Decimal column.
Item Meaning
Single Precision Interprets memory data as single precision floating-point
numbers.
This menu item is only available for the Floating Point
column.
Double Precision Interprets memory data as double precision floating-point
numbers.
This menu item is only available for the Floating Point
column.
q15 Interprets memory data as q15 fixed point numbers.
This menu item is only available for the Fixed Point column.
q31 Interprets memory data as q31 fixed point numbers.
This menu item is only available for the Fixed Point column.
Big Endian Sets the column byte order to big endian. If this is not the
default byte order for your target, the setting is displayed in
the column header.
This menu item is only available for the Hex, Decimal,
Binary, Floating Point, and Fixed Point columns.
Little Endian Sets the column byte order to little endian. If this is not the
default byte order for your target, the setting is displayed in
the column header.
This menu item is only available for the Hex, Decimal,
Binary, Floating Point, and Fixed Point columns.
Item Meaning
Write Changes to Target Writes memory modifications made in the Memory View
window to the target.
Selecting this menu item is equivalent to clicking the Write
Changes to Target button ( ) or selecting Memory →
Write Changes to Target.
Reload from Target Forces the window to update its contents, even if frozen, by
immediately re-reading target memory.
Selecting this menu item is equivalent to clicking the Reload
button ( ) or selecting Memory → Reload from Target.
Contents
Using the Memory Allocations Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
Chapter 16. Viewing Memory Allocation Information
To get the most out of the Memory Allocations window when you are developing
for an embedded target, enable run-time memory checking by setting Builder or
driver options prior to compiling your program. For Solaris and x86-based Linux
targets, you may be able to access run-time memory checking information without
setting build options. Unless you have enabled call count profiling, simply open
the Memory Allocations window before starting program execution. If you have
enabled call count profiling, you must explicitly enable run-time memory checking
via Builder or driver options. See the MULTI: Building Applications book for
information about enabling run-time memory checks.
You can open the Memory Allocations window at any time by doing one of the
following:
Note
The Memory Allocations window is designed for use during run-mode
debugging. However, the window may also display helpful information
if launched on the master process during a freeze-mode debugging session
(that is, if the master process is selected in the target list when you open
the window). The Memory Allocations window is not accessible if you
attempt to open it when an OSA task is selected in the target list. For
information about freeze-mode debugging, the master process, and OSA
tasks, see Chapter 22, “Freeze-Mode Debugging and OS-Awareness”
on page 547.
Before you can perform any of the operations available through the Memory
Allocations window, your process must be halted, and, if you are debugging in run
mode, you must be able to run the program; it cannot be blocked or pending. A
convenient way to halt the process is to set a breakpoint on the last line of your
program's source code and then open the window when the process hits the
breakpoint. For information about run-mode debugging, see Chapter 21, “Run-Mode
Debugging” on page 517.
Note
When you use the Memory Allocations window to view allocations,
leaks, and run-time errors, code that may allow interrupts to be serviced
is executed on the target. If any interrupt servicing results in calls to
memory allocation routines, the memory checking code may crash or
give inaccurate results. You may need to disable interrupts before using
these memory analysis operations. Use of the visualization should be
safe, however, as it only reads the target memory and does not execute
any code on the target.
Note
The deprecated findleaks command provided in previous versions of
MULTI is equivalent to heapview showleaks.
The Memory Allocations window contains four menus: File, Checking, View,
and Help. Menu items are described in the table below. Unless otherwise stated,
all descriptions of toggle menu items explain the behavior of the menu item when
enabled.
File → Save information Opens a Save Report dialog that allows you to
specify a file to save the contents of the active
tab (information will appear on the menu as
Visualization, Leaks, or Allocations, depending
on which tab is active).
File → Print information Prints the contents of the active tab (information
will appear on the menu as Visualization, Leaks,
or Allocations, depending on which tab is
active).
File → Close Closes the Memory Allocations window.
Checking → Disable Checking Specifies the amount and frequency of run-time
error checking. For more information, see the
Checking → Minimal Checking
documentation about performing selective
Checking → Occasionally Maximal run-time memory checking in the MULTI:
Checking Building Applications book.
Checking → Frequently Maximal Note: The current state of the Checking menu
Checking items is stored on the target. Selecting an item
Checking → Maximal Checking from the Checking menu causes a function call
to be executed on the target, so be sure the
process is halted in a safe location first (see
“Before Performing Operations that Execute
Function Calls” on page 363). If the target cannot
be accessed, the menu items in the Checking
menu appear dimmed.
View → Human Readable Numbers Displays rounded numbers in the Memory
Allocations window.
View → Show Hexadecimal Values Displays the hexadecimal equivalent for memory
sizes in the Memory Allocations window.
View → Display Heap Discontinuities as Displays unused sections of the heap as memory
Blocks blocks. Otherwise, discontinuities are collapsed
into a single bar.
View → Clear Runtime Errors Clears the run-time errors displayed in the lower
pane of the Memory Allocations window.
The Visualization tab of the Memory Allocations window is divided into several
panes.
The upper-left pane displays general statistics about the memory usage of your
application. The information that is available varies depending upon whether your
application was built with run-time memory checking enabled. The following list
describes the information that may be available in this pane.
Note
The current heap size may exceed the reserved size if the
malloc() library extends the heap beyond the region initially
reserved for it. For more information, see your target operating
system's documentation for malloc(). If you are using
INTEGRITY, see the documentation about heap configuration
in the INTEGRITY Development Guide.
The upper-right pane of the Visualization tab displays a visualization of the heap.
In this visualization, sequences of red squares indicate allocated blocks of memory,
while sequences of green squares indicate free blocks of memory. Adjacent allocated
or free blocks alternate shades for clarity. Blocks that are recognized as malloc()
overhead are marked in purple. Discontinuities in the heap are shown as long gray
bars unless you have enabled View → Display Heap Discontinuities as Blocks,
in which case, discontinuities are displayed as gray blocks.
depicted using at least one square, so the amount of heap represented by each square
may vary widely when you have zoomed out all the way.
Click any of the squares in the heap visualization to get more details about a specific
heap block. These details appear in the bottom pane, described next. You can
navigate among heap blocks by clicking them in the visualization or by using the
arrows located in the middle-right side of window.
The bottom pane of the Visualization tab displays specific details about the heap
block you have chosen in the heap visualization pane. In addition, the check boxes
located above the bottom pane allow you to search several locations in memory for
references to a particular heap block. The following list describes the memory
locations you can search.
• Registers — Search the general purpose registers for references to this heap
block.
• Stack — Search the program stack for references to this heap block.
• Globals — Search the program globals (such as those defined in .data or
.bss sections) for references to this heap block.
• Heap — Search the other allocated blocks of the heap for references to this
heap block.
If run-time errors are detected while the Memory Allocations window is open,
they are displayed below the block references. To clear run-time errors, select View
→ Clear Runtime Errors.
Note
Updating the Visualization tab while the program is halted inside
malloc() library code may cause incorrect heap data to be displayed.
The columns of the Leaks and Allocations tabs display the following information
for each block of memory:
• Root — Any memory block that is referenced by another block in the heap is
marked with a dot in this column. If a memory block is not referenced by
anything else on the heap, it is considered a root and is marked with a red
asterisk. In cases where a memory block contains pointers to memory that
becomes unreachable when the block itself becomes unreachable, this marking
makes it easier to find the origin of memory leaks. For example, suppose a
linked list is leaked. The memory block that contains the head of the linked list
is marked with a red asterisk, and everything following the head of the list is
marked with a gray dot.
• Caller 0, Caller 1, etc. — The function and line number (or address) of the
first five levels of the call stack of the allocation. (On some native targets
(Solaris and x86-based Linux), there may be more than five levels.)
• Address — The address of the block of memory.
• PID or TID — The process or task ID of the process that called malloc(), if
applicable. This column is only shown when run-time memory checking is
enabled and the target supports reporting of process or task IDs on a
per-allocation basis.
If the Leaks or Allocations tab is up to date with respect to the Visualization tab,
block information for the selected leak or allocation (including the references selected
in the Visualization tab) is shown in the bottom pane.
Note
Viewing memory leaks and allocation information requires that a small
amount of target memory be available. If the heap has been exhausted,
checking for leaks and allocations is not supported.
To Do this
View a memory block in a Memory View Double-click the address of the memory block.
window
Display a function in the Debugger's source Click the function.
pane
Edit a function in the Editor Double-click the function.
Reclaim some leaks by calling free() on Select the desired leaks and click the Reclaim
them Leaks button on the Leaks tab.
Note: This causes a function call to be
executed on the target, so be sure the process
is halted in a safe location. For more
information, see “Before Performing
Operations that Execute Function Calls”
on page 363.
• On INTEGRITY, the program should not be halted inside a Task that you have
not created, such as the kernel's Idle Task. For more information, see the
documentation about run-mode debugging limitations in the INTEGRITY
Development Guide.
• The program should not be halted inside a task that holds the lock from
__ghsLock(). Additionally, no task in the address space should be halted in
a location where it holds the lock from __ghsLock(). The preceding
operations, which rely on being able to obtain this lock, become pended if you
try to complete them while the lock from __ghsLock() is held.
• When run-time memory checking is enabled, the program should not be halted
inside malloc() library code.
is stopped. To refresh the leaks and allocations information, click the Refresh Leaks
or Refresh Allocations button ( ). Note that refreshing leaks or allocations causes
a function call to be executed on the target, so be sure that the process is halted in
a safe location. For more information, see “Before Performing Operations that
Execute Function Calls” on page 363.
Note
Refreshing leaks or allocations requires a small amount of dynamic
memory. To guarantee heap integrity, ensure that the target will not
exhaust its heap.
Note
Because tasks running in the same address space share memory, refreshing
leaks or allocations information for one task while other tasks in the same
address space are still running can lead to inconsistent results. If MULTI
detects that other tasks in an INTEGRITY AddressSpace are still running,
a dialog box appears to inform you of this and to give you the opportunity
to cancel the refresh operation. In this situation, we recommend that you
do the following:
shown. Marked leaks are shaded gray in the Leaks and Allocations tabs. To monitor
memory leaks and allocations:
1. Halt the application at a safe and useful checkpoint. For information about
safe locations, see “Before Performing Operations that Execute Function Calls”
on page 363.
2. Click the Refresh Leaks or Refresh Allocations button ( ) to update the
Leaks or Allocations information.
3. While still halted in a safe location, click the Mark All button on the Leaks
or Allocations tab of the Memory Allocations window. This marks the current
set of allocations.
4. Resume execution of the application.
5. Halt the application in a safe location again.
6. Click the Refresh Leaks or Refresh Allocations button ( ) to update the
Leaks or Allocations information.
7. Select the Show Leaks since last Mark or Show Allocations since last Mark
check box so that the tabs display only those leaks and allocations that occurred
since the last time you marked the allocations.
8. Repeat this process as necessary as you run through the entire application.
If the Show Leaks since last Mark or Show Allocations since last Mark check
box is selected, and you click the Refresh Leaks or Refresh Allocations button
( ), the target may only transfer information about leaks or allocations that have
occurred since the last mark. If you want to see information about leaks or allocations
from before the mark, you may have to clear the check box and refresh again.
Note
The Mark All button and the Show Leaks since last Mark and Show
Allocations since last Mark check boxes are only available when
run-time memory checking is enabled.
Tip
You can achieve the same results by using Debugger commands in the
command pane. The command heapview setmark marks the current set
of allocations, and the command heapview showleaks -new or heapview
showallocations -new displays the new leaks or allocations. For more
• The Leaks tab of the Memory Allocations window may not display all of the
leaks in the program being debugged at any given moment. If dead variables
are still on the stack or in registers, MULTI assumes they are alive and does
not report anything they reference as a leak. Once the process has run further
(for example, returned out of the current routine, which should clear out the
stack), some or all of these false negatives vanish and additional leaks may
show up.
• In some target implementations, a register may be a base register, a general
purpose register, or both. It is possible that the value of the base register may
point into the heap (for example, on some targets, when the register is the SDA
base pointer, and there is no data). This can prevent a memory leak from being
reported for a dead object at the same location as the base register.
• Blocks referenced only via pointer arithmetic may be falsely marked as leaks.
Additionally, false positives may occur in INTEGRITY applications. For more
information, see the documentation about memory leaks in the INTEGRITY
Development Guide.
Contents
Types of Profiling Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
Creating and Managing Profile Recordings . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
Viewing Profiling Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
Profile Window Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Chapter 17. Recording and Viewing Profiling Data
MULTI's powerful profiling capabilities allow you to gather and view information
about the performance and coverage of your programs. You can use this information
to optimize the efficiency of your code and the coverage of your test system.
• Sampled Data — Randomly timed PC samples that show where the process
spends its time. When you start a profile recording, MULTI almost always
collects this data. You can use sampled data to find where you spend an
unnecessary amount of execution time. The only requirement for recording
sampled data is that your debug server supports it. Sampled data does not
require instrumentation, but results are not deterministic.
• Traced Data — Trace output collected from a supported trace-capable target.
Traced data provides similar performance information to sampled data, but it
is complete (for caveats, see “Discarding Trace Data” on page 416 and “Dealing
with Incomplete Trace Data” on page 416). It also provides the same information
as instrumented coverage data, but it does not require instrumentation.
• Instrumented Coverage Data — A record of whether or not each basic block
executed. This data can help you determine if your tests are covering an
acceptable amount of your code base. It can also help find code that never
executes, which you may want to remove from your program. Recording this
data requires you to set a driver option to instrument your code, and the results
are deterministic.
• Instrumented Performance Data — A record of how many times each basic
block executed. This data provides all of the information in coverage data, but
is also useful for seeing where the process spends its time. Unlike sampled
data, instrumented performance data contains information about all block
executions instead of randomly timed samples. Recording this data requires
you to set a driver option to instrument your code, and the results are
deterministic.
For information about using driver options to enable the recording of profiling data,
see the documentation about obtaining profiling information in MULTI: Building
Applications.
If you are using Compiler version 2012.5 or newer, follow these steps to record
profiling data between two specific points of execution:
If you are using Compiler version 2012.1, follow these steps to record profiling
data between two specific points of execution:
You can also start and stop recordings with the profile start and profile stop
commands (see “profile” in Chapter 12, “Profiling Command Reference” in MULTI:
Debugging Command Reference).
If the program was built with instrumented coverage profiling enabled, you are able
to view instrumented coverage data for your program up to the point where data
was collected. If your program was built with performance profiling enabled,
instrumented performance data is available as well as instrumented coverage data.
You cannot collect or view sampled data by clicking the Process button.
As an alternative to the preceding steps, you can use the profile collect command,
as follows. This is useful if you want to script the collection of instrumented profiling
data from the target.
1. Halt the running program. You can do this with the halt command.
• When legacy coverage profiling is enabled, MULTI uses command line function
calls when starting and stopping profile recordings.
○ If you are using INTEGRITY, ensure that instrumented tasks are halted
in a safe location prior to starting or stopping a recording (see “Caveats
for Command Line Function Calls” on page 316).
○ If you are not using INTEGRITY, interrupts may need to be disabled and
the program may need to be halted for command line function calls to
work.
• On native targets, MULTI uses command line function calls when starting the
collection of PC samples if the program is already running and if this is
supported by your connection. Ensure that the program is halted in a safe
location prior to starting a recording in this situation.
1. Trace the code that you want to profile, and retrieve the trace data as described
in “Managing Trace Data” on page 410. If you are profiling an INTEGRITY,
velOSity, or u-velOSity system, profiling data includes all traced Tasks and
AddressSpaces, regardless of the selection in the target list.
2. Open the Profile window on the trace data by doing one of the following:
• In the Debugger, select TimeMachine → Profile.
• In the Trace List or the PathAnalyzer, click the Profile button ( ).
Warning
If you do not save your recordings, they are deleted when you close the
Profile window.
Recordings saved in .gpro format contain profile data and debug information. They
do not include source code. If you change your source code or share the .gpro file
with another user who has local changes, the information in the recording may not
correlate correctly with the source code.
You can also export the data from the recording in .csv format by selecting File →
Export to CSV.
Merging Recordings
When new profiling data is collected and processed, it appears as a new recording
in the Profile window. To merge multiple recordings, select them and click the
Merge button. Merging data across multiple executions may be useful for getting
a more accurate understanding of application performance.
• In the Profile window — The tabs in the Profile window display profiling
information in different report formats. For more information, see “Profile
Window Reference” on page 376.
• In the Debugger window — The Debugger can indicate the percentage of time
spent in each source line (or each instruction, if in assembly only mode or
interlaced assembly mode), which lines of code were never executed, and the
number of times each source line was executed. For more information, see
“Viewing Profiling Information in the Debugger” on page 375.
Note
Support for these display capabilities depends on the type of profiling
data in the recording.
• The recording view allows you to create and manage recordings. It appears
when you first open the Profile window, or when you double-click the
<<Create new recording>> option in the recordings list.
• The display view allows you to view information for a specific recording. It
appears when you create or load a recording, or when you double-click a
recording or click the dot to the left of a recording while in the recording view.
For more information about the Profile window, see “Profile Window Reference”
on page 376.
Note
When a program associated with a recording is rebuilt, the profiling data
for the program can no longer be displayed. To preserve profiling data
for a program, be sure to save the recording to a .gpro file before
rebuilding the program. To display the profiling data after the program
has been rebuilt, load the .gpro file into the Profile window. Any
recording loaded from a .gpro file is not affected by a program being
rebuilt.
You can configure the Debugger to display Time % or Inst % values by clicking
the Percentage View button ( ) in the Profile window. If coverage information
is available, you can configure the Debugger to highlight uncovered and partially
uncovered source lines and display line counts by clicking the Coverage View
button ( ) in the Profile window.
Note
Functions marked with the ghs_noprofile function attribute and the
code paths that call these functions are not highlighted when they are
uncovered. Instead, they are highlighted in the color configured for
diffHighlight when they are covered or are partially covered. The default
color configured for diffHighlight is light green.
Note
If there is no profiling data for a particular line, a question mark appears
to the left of the line instead of actual count or time percentage
information. If performance data covers multiple source lines, the lines
are grouped together in the source pane.
• Performance
• Coverage
Each is described in the Profile window, along with instructions for the use of the
following buttons:
Start Starts a new profile recording of the connection selected in the target
list.
Some targets require the Start button to be clicked before the program
is loaded to the target. If this is necessary, it is indicated above the
performance text in the GUI.
Stop Stops the profile recording, adds an entry for it in the recordings list,
and loads it into the display.
Process Collects instrumented profiling data from the target, adds an entry for
it in the recordings list, and loads it into the display.
After you have created a recording, information about it appears in the display view.
To return to the recording view from the display view, double-click the <<Create
new recording>> option in the recordings list.
Mode Selects which kind of profile information to load from the recording
and tailors the Profile window to display it for the purpose of measuring
either performance or code coverage. The options are:
The options available in this drop-down list depend on the target, probe,
and driver options used to build the program.
Percentage View Displays Time % or Inst % values for each line in the Debugger source
pane.
Coverage View Shades uncovered lines in the Debugger source pane and displays the
number of times each line was executed, if this information is available.
Overview Selects how you want to browse and organize profile data. The tabs
are:
Tasks
AS • Overview — Provides a summary of the loaded recordings (see
“The Overview Tab” on page 381).
Files
• Tasks — Organizes data by Task (see “The Tasks Tab”
Functions
on page 382).
Coverage • AS — Organizes data by AddressSpace (see “The AS Tab”
Blocks on page 383).
• Files — Organizes data by file (see “The Files Tab” on page 384).
• Functions — Organizes performance data by function and source
line (see “The Functions Tab” on page 385).
• Coverage — Organizes coverage data by function and source line
(see “The Coverage Tab” on page 387).
• Blocks — Organizes data by function and block address (see “The
Blocks Tab” on page 388).
Note
Not all tabs appear in all contexts.
The information in the summary depends on the selection you make in the Mode
drop-down list. The summary may contain the following fields:
Sampled Time The approximate amount of time that the recording covers. Sampled
time may not directly reflect wall clock time due to handling of system
or
calls or other target activity.
Time
Samples The number of PC samples in the recording.
Instructions The number of instructions executed in the recording.
% in filter The percentage of samples or executed instructions in the filter out of
the total number of samples or executed instructions in the recording.
% covered overall The percentage of instructions covered out of all instructions in the
program.
% covered in filter The percentage of instructions covered out of all instructions in the
filter.
Uncovered The number of instructions in the recording that are not covered.
instructions
Note
If you profile an SMP application, the Sampled Time and CPU Usage
values represent the sum of the total time and usage across all cores.
• Total Time — The percentage of time in the Task out of all time
in the recording.
• Filter Time — The percentage of time in the Task out of all time
in the filter.
Inst % The value of this column depends on the selection you make in the
Percentage of drop-down list in the Filter.
The AS Tab
The AS tab summarizes profiling information by AddressSpace. It does not appear
in all contexts.
Uncov Inst The number of instructions in the AddressSpace that are not covered
in the filter.
Cov % The percentage of instructions covered in the AddressSpace out of all
instructions in the AddressSpace (excluding functions that have been
filtered out).
The information in this tab depends on the selection you make in the Mode
drop-down list. Columns may include:
File The files that contain the source code for your program. The <no
source file> item represents all instructions the compiler generated
that cannot be mapped to a source line, such as library code.
Time % The value of this column depends on the selection you make in the
Percentage of drop-down list in the Filter.
• Total Time — The percentage of time in the file out of all time
in the recording.
• Filter Time — The percentage of time in the file out of all time
in the filter.
Inst % The value of this column depends on the selection you make in the
Percentage of drop-down list in the Filter.
Uncov Inst The number of instructions in the file that are not covered in the filter.
Cov % The percentage of instructions covered in the file out of all instructions
in the file (excluding functions that have been filtered out).
Clicking a function displays information about that function's source lines on the
right side of the tab and jumps to that function in the Debugger. If there are multiple
definitions for the function, the Debugger prompts you for the function to jump to.
Inst % The value of this column depends on the selection you make in the
Percentage of drop-down list in the Filter.
Source Lines
Ln The function-relative source line. Ranges of lines are denoted using a
hyphen (for example, 11-15).
Time % The value of this column depends on the selection you make in the
Percentage of drop-down list in the Filter.
Inst % The value of this column depends on the selection you make in the
Percentage of drop-down list in the Filter.
Clicking a function displays information about that function's source lines on the
right side of the tab and jumps to that function in the Debugger. If there are multiple
definitions for the function, the Debugger prompts you for the function to jump to.
Covered Yes or No, depending on whether or not the basic block was covered.
Calls The number of times the basic block was called.
Inst % The value of this column depends on the selection you make in the
Percentage of drop-down list in the Filter.
To show the filter, click the Filter button while in the display view.
• The Tasks tab displays AddressSpaces and Tasks, while the AS tab displays
AddressSpaces. (Only one or the other of these will appear, and only if the
loaded recording was made from an INTEGRITY application.)
• The Files/Functions tab displays directories, files, and functions.
Next to each item in the filter, there is a three-state check box. The check box states
are:
• Checked ( ) — Samples and instructions from this item are included in the
filter, and the item is displayed in the report.
• Cleared ( ) — Samples and instructions from this item are not included in
the filter, and the item is not displayed in the report.
• Mixed ( ) — Samples and instructions from some, but not all, of this item's
children are included in the filter, and the item is displayed in the report.
Checking or clearing an item that has children also checks or clears all of that item's
children. The buttons and search box above the list of items work as follows:
Search box Searches the list and displays only matching items and their parents.
The search is case-sensitive. Wildcards and regular expressions are not
supported.
All Checks all items displayed in the filter list.
None Clears all items displayed in the filter list.
• Flat — Displays only the file base name. You can view the full
path to a file by hovering over its name.
• Tree — Displays files and directories in a tree view.
Contents
Viewing Call Stacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
Viewing Native Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
Viewing Caches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
Chapter 18. Using Other View Windows
The following table describes the buttons available from the toolbar of the Call
Stack window.
Button Effect
Hide Toggles the display of parameters in function calls.
Parameters
Hide Positions Toggles the display of the filename and line number of the function call.
Hide Toggles the display of types of function parameters. This button only
Parameter Types affects functions within files compiled in C++ mode.
Collapse C++ Toggles whether C++ template parameters are displayed or collapsed. This
Template button only affects functions within files compiled in C++ mode.
Parameters
Display stack Toggles whether to display stack frames before main().
frames before
main()
Copy Window Copies the contents of the window to the clipboard.
Contents
Freeze Toggles whether the window is refreshed.
Window
Edit Function Opens an Editor on the selected function, if it has source code.
View Locals Displays local variables of the selected function in a Data Explorer. For
more information, see “Displaying Local Variables” on page 191.
Button Effect
Print Prints the text contents of the Call Stack window to your printer.
To print call stack information to the command pane, enter the calls
command. For information about the calls command, see Chapter 5, “Call
Stack Command Reference” in the MULTI: Debugging Command
Reference book.
Close Closes the Call Stack window. Whether or not this button appears on your
toolbar depends on the setting of the option Display close (x) buttons.
At the far right of the toolbar is the Max Depth field, which controls the maximum
number of stack levels which the window will display. You can change it according
to your preference. For example, if you are debugging a program on a very slow
target and you only want information about the first few levels of the call stack,
you can decrease the number so that the window is refreshed more quickly.
Below the toolbar is the call stack pane, where the call stack is displayed. The
following table lists the mouse and keyboard operations you can perform in the call
stack pane.
To Do this
Display a function in the source pane Click the function
Open an Editor on a function Double-click the function
Copy the entire call stack pane to the clipboard Press Ctrl+Shift+C
Search forward in the call stack pane Press Ctrl+F
Search backward in the call stack pane Press Ctrl+B
During a debugging session, if you change the attributes of a Call Stack window,
the changes will affect subsequently created Call Stack windows. You can also
change these attributes with the cvconfig command. For information about this
command, see Chapter 5, “Call Stack Command Reference” in the MULTI:
Debugging Command Reference book.
portion is the call stack from before the function call; the upper portion is the call
stack starting from the command line function call.
To open a Process Viewer, do one of the following from your native debugging
environment:
• Select View → Task Manager from the Debugger menu bar. (If you are in a
non-native environment and in run mode, this menu selection will open a Task
Manager instead of a Process Viewer.)
• Issue the top command from the Debugger command pane. For information
about this command, see “General View Commands” in Chapter 21, “View
Command Reference” in the MULTI: Debugging Command Reference book.
• Issue the command multi -top from your shell (see Appendix C, “Command
Line Reference” on page 747).
The Process Viewer displays all of the processes that you own, color-coded
depending on their type, where:
To attach to a process and debug it, either select the process and click Attach, or
simply double-click the process. If the Debugger cannot locate the executable image
associated with the process, you will be prompted to choose it from the disk.
If the Process Viewer's contents become out of date and you want to see the current
list of processes available on your native target, simply click Update to refresh the
list. You can also enable automatic periodic refreshing by selecting the Auto Update
check box and entering an integer in the Interval text box, which specifies how
often (in seconds) updates should occur. The default interval is 5 seconds.
Viewing Caches
MULTI includes two display windows that allow you to view the contents of the
caches on your processor. You can use the Cache View and Cache Find windows
to browse cache contents and search all of the caches at a specific address.
Note
Support for cache viewing and searching varies according to processor
type. Not all processors support these features, and availability also
depends on your debug server connection.
The drop-down box on the toolbar allows you to select which cache to view.
By default, the Cache View window shows invalid cache entries. You can change
this default behavior by clicking the button.
The columns in the Cache View window also vary depending on your processor
and cache type. The following table describes all possible columns, which are
ordered alphabetically below. See your processor's manual for more information
about the data in the caches.
Column Description
A0, A1 Displays the allocate bit for the first/second cache block of this cache entry.
Address Displays the address of the cache line. This address may be a virtual or
physical address, depending on your processor, cache and whether the
memory management unit is enabled.
D0, D1 Indicates whether the first/second half of the cache line is dirty. Each dirty
bit corresponds to 32 bytes of cache data.
Data Displays the data associated with this cache line. The number of bytes
displayed depends on your processor and cache type.
Data Locked Indicates whether the cache line has been locked for data.
Dirty*‡ Indicates whether the cache line is dirty.
On ARM920/922, ARM946, and ARM1136, each dirty bit corresponds to
16 bytes of cache data.
On PowerPC 440, each of the 4 bits corresponds to a double word of data
in the cache line.
Instruction Indicates whether the cache line has been locked for instructions.
Locked
Lock, Locked Indicates whether the cache line has been locked.
LRU On Intel XScale IXP2350, indicates which way of the cache line is next in
line for replacement on a line eviction. The following list provides the
mapping of LRU bit values to cache ways:
• 01x — Way 0
• 11x — Way 1
• x00 — Way 2
• x01 — Way 3
MESI0, MESI1 Displays the MESI bits for the first/second cache block of this cache entry.
Column Description
N Indicates whether the cache line has been loaded incoherently. If set, only
instructions hit in this line (data accesses will miss).
Set Displays the set of the cache line. Each address maps to a single set in the
cache.
Shared‡ Indicates whether the cache line is shared in a multiprocessor system.
Stale Indicates whether the cache line is stale (that is, whether the data is invalid).
State Displays the MOESI state for the cache line. Available states are:
• 0 — Invalid
• 1 — Shared
• 3 — Owned
• 5 — Exclusive
• 7 — Modified
*: On PowerPC 6xx, 7xx, 51xx, 52xx, 7400, 7410, 82xx, and 83xx, MESI states
are encoded in the Valid and Dirty bits as follows:
State Valid Dirty
Modified 1 1
Exclusive 1 0
Shared 0 1
Invalid 0 0
‡: On PowerPC 744x, 745x, 85xx, 86xx, and QorIQ, MESI states are encoded in
the Valid, Dirty, and Shared bits as follows:
State Valid Dirty Shared
Modified 1 1 0
Exclusive 1 0 0
Shared 1 0 1
Invalid 0 x x
You can sort the data in the Cache View window by clicking the column header
above the column that you want to sort by. You can also change the display, refresh
the window, or open other windows using the buttons described in the following
table.
Button Effect
Refreshes the current view by reloading cache data from the target.
Hides or shows all invalid cache entries. When the button is pushed down,
invalid caches entries are not displayed. Otherwise, all cache entries,
including invalid entries, are visible.
Opens a Memory View window at the address of the selected cache line.
Opens a Cache Find window at the address of the selected cache line. See
“The Cache Find Window” on page 402.
Contracts all entries in the Cache View window so that each cache line
takes up a single line in the cache list.
Expands all valid entries and contracts all invalid entries in the Cache View
window so that each valid cache line is fully displayed and each invalid
entry takes up a single line.
Button Effect
Expands all entries in the Cache View window so that each cache line is
fully displayed.
The Cache Find window displays the valid line that contains the specified address
for each cache. If the address is not found in a cache, the set that was searched will
be displayed and the window will indicate that the address was not found in that
cache. If a cache line is found that contains the address, the cache tags associated
with the cache line are displayed along with the data from the cache line.
The data in the Cache Find window is colored to indicate the state of the data. This
makes the display easy to read and can help you to find cache coherency problems.
A cache coherency problem occurs when there is data in the cache that is clean (not
dirty) and it differs from data in memory or a cache further from the processor. In
this case, the data that makes up the cache coherency conflict is colored in red. In
addition, data in memory that has a dirty cache line associated with it is colored
gray.
To refresh the cache data in the Cache Find window, click . To change the
address to search for, enter a new address in the Address field and click Go.
To freeze the cache data in the Cache Find window so that it does not update when
the target changes state, click . (The window is frozen when this button appears
pushed down. Click the button again to unfreeze the window.)
To open a Memory View window at the specified address, click . (See Chapter 15,
“Using the Memory View Window” on page 337 for information about using this
window.)
TimeMachine Debugging
Chapter 19
Contents
Supported Trace Targets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
TimeMachine Quick Start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
Overview of Trace Analysis Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
Managing Trace Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
The TimeMachine Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
The PathAnalyzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
Viewing Trace Data in the Trace List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
Bookmarking Trace Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
Searching Trace Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453
Saving and Loading a Trace Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
Browsing Trace Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
Viewing Trace Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
The TimeMachine API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
Viewing Trace Events in the EventAnalyzer . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
Using Trace Data to Analyze Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
Viewing Reconstructed Register Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
Caveats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
Chapter 19. Analyzing Trace Data with the TimeMachine Tool Suite
• A Green Hills debug probe with a supported target (for more information, see
the documentation about supported devices in the Green Hills Debug Probes
User's Guide)
• A Green Hills simulator for a supported target
You can analyze collected trace data with a set of tools provided in the MULTI
Debugger and with the separately licensed TimeMachine tool suite, which expands
MULTI's standard trace analysis capabilities to let you step and run backwards,
examine process flow over significant periods of time, analyze high-level execution
patterns, and debug RTOS applications from trace data.
In addition to making it possible to run and step backwards, trace data enables many
other powerful tools, which are described in the next section. To use any of these
tools, you must retrieve trace data from your trace-enabled probe or target. Trace
data is automatically retrieved when you click one of the TimeMachine run control
buttons. You can also retrieve it at any time by selecting TimeMachine → Retrieve
Trace or by clicking the Retrieve Trace button ( ) located in the Trace List or
PathAnalyzer. In addition, you can configure MULTI to automatically retrieve trace
data each time your target halts. See the description of Retrieve trace when target
halts in “The Collection Tab” on page 487.
Both the MULTI Debugger and the TimeMachine tool suite include the following
standard trace analysis tools:
• Trace List — Allows you to view and explore trace data at the function and
assembly levels and control trace collection. You can also access advanced
trigger, search, filter, and bookmark controls, in addition to various trace data
analysis tools. For more information, see “Viewing Trace Data in the Trace
List” on page 440.
• Trace Browsers — Allow you to quickly locate events in your trace data by
finding similar events, such as instructions and memory accesses. For more
information, see “Browsing Trace Data” on page 458.
• Trace Statistics — Calculates and displays statistical information about trace
data. For more information, see “Viewing Trace Statistics” on page 465.
When trace configuration options are set to their defaults, it is usually possible to
use TimeMachine to step or run backward in time from the current location. This
default trace configuration presents a convenient way to use trace data, but sometimes
you may require more precise control over when trace data is collected, retrieved,
and discarded. The following sections describe the many ways that you can manage
trace data in MULTI.
You can also manually enable and disable trace collection. When you manually
enable trace collection, MULTI clears any previously collected data on the target.
Data that has already been retrieved is not cleared, but if trace retrieval is currently
in progress, it is aborted. To manually enable trace collection, do one of the
following:
When you disable trace collection, all the trace data currently stored on the trace
collection device is retrieved.
You can also control trace collection via trace triggers. For information about trace
triggers, see “Configuring Trace Collection” on page 494.
Note
Even if you have one of these operating systems and hardware trace
support, the operating system trace features may be unavailable. Different
strategies are employed to enable task-aware trace depending on the
operating system, BSP, and operating system version. In some cases,
task-aware trace relies on instrumentation that is only included in debug
builds of the kernel libraries. In other cases, instrumentation to enable
task-aware trace is provided by the BSP and can be included in both
debug and release builds. In some cases, a process ID (PID) register that
the operating system already writes to when switching tasks is traced,
and no instrumentation is required. Additional information may be
available in documentation for your operating system. For updated
information about which hardware and operating system versions support
these enhanced features, contact your Green Hills sales representative.
Note
Some target processors limit the number of unique AddressSpaces that
can be traced. Tracing a target on which the number of AddressSpaces
exceeds this limit is not supported.
MULTI uses the state of the operating system at the time when trace data is retrieved
for trace decoding. If a task or AddressSpace was traced, but is no longer present
on the target when trace data is retrieved, MULTI will be unable to decode the trace
data for that task or AddressSpace. Additionally, MULTI may not be able to decode
some or all of the subsequent trace data.
After you have established a run-mode partner, you can enable and disable the
tracing of specific AddressSpaces by right-clicking a task in the target list and
selecting Trace. This toggles trace collection for the AddressSpace that encapsulates
the selected task. Note that if you manually start your run-mode connection, the
Trace menu entry may not be available until MULTI offers to partner your
connections the first time you retrieve trace data.
Once you have toggled trace collection for an AddressSpace, any new AddressSpaces
that are created will not be traced until you enable tracing of them.
Interrupt and exception handlers in the kernel are traced if the interrupt or exception
occurs while executing in a traced AddressSpace.
You can manually retrieve trace data by doing one of the following:
• In the Debugger command pane, enter the trace retrieve command. For
information about this command, see Chapter 19, “TimeMachine Command
Reference” in the MULTI: Debugging Command Reference book.
• In the Trace List or PathAnalyzer, click the Retrieve Trace button ( ) at any
time.
You can also control trace retrieval via trace triggers. For more information about
trace triggers, see “Configuring Trace Collection” on page 494.
configuration, the type of target being traced, the code traced, the performance of
the host machine, and local network conditions.
In many cases, the most interesting trace data is the most recent data near the end
of the trace buffer. With SuperTrace Probe v3, all available trace RAM is always
used regardless of the Target buffer size setting (see “The Collection Tab”
on page 487). However, it is still possible to step or run backwards quickly because
MULTI quickly retrieves the configured Target buffer size from the end of the
SuperTrace Probe's trace buffer. You can manually retrieve more data later if the
originally configured amount is insufficient.
If you have already retrieved some of the trace data, do one of the following things
to retrieve twice as much:
• In the Trace List or PathAnalyzer, click and hold the Retrieve Trace button
( ). In the drop-down menu that appears, choose how much data to retrieve.
To retrieve all of the trace data from the SuperTrace Probe, do one of the following:
• In the Trace List or PathAnalyzer, click and hold the Retrieve Trace button
( ). In the drop-down menu that appears, choose to retrieve all of the trace
data.
• In the Debugger command pane, issue the trace retrieve -all command.
Note
If you retrieve more trace data than is configured by Target buffer size,
all of the data in the tools is cleared and retrieved from the SuperTrace
Probe again. This also ends TimeMachine Debugger sessions and clears
all bookmarks.
MULTI attempts to discard unnecessary trace data by basing its deletion on the age
of the trace data and the locations of triggers, bookmarks, and the current selection.
As trace data is discarded over time, you may encounter side effects such as gaps
in the timestamps displayed in the Trace List and Path Analyzer.
Sometimes you may want to discard all your trace data and start trace collection
over again. When you perform one of the following operations, MULTI clears all
current trace data on the host, trace probe, and target:
Most trace tools, such as the PathAnalyzer, Profile window, and EventAnalyzer,
are unaffected by incomplete data trace; however, data trace is very important for
the TimeMachine Debugger. Incomplete data trace can prevent the TimeMachine
Debugger from determining the values of registers, memory, and, by extension,
local and global variables. Values that the TimeMachine Debugger cannot determine
given the available trace data are displayed as <<Unreadable/Unknown>>.
Incomplete data trace can also prevent read/write hardware breakpoints from being
hit.
Some trace architectures also drop instruction trace when on-chip trace buffers
overflow. MULTI attempts to fill in the missing instruction trace by inferring it
from the trace data collected before and after the overflow (see the option Attempt
to reconstruct gaps in trace data in “The Analysis Tab” on page 490).
Unfortunately, reconstruction is not always possible, and incomplete instruction
trace impacts all trace analysis tools. It can cause discontinuities in the PathAnalyzer
call stack, the exclusion of events from the EventAnalyzer, incorrect or incomplete
data in the Profile window, and problems when running and stepping in the
TimeMachine Debugger. In the Trace List window, missing instruction trace may
be indicated by a line with the text FIFO Overflow or Trace Disabled. If the
TimeMachine Debugger encounters missing instruction trace, and if the option Stop
at discontinuities is enabled (this is the default), the TimeMachine Debugger
typically stops and prints:
Stopped by discontinuity in trace data
Stopping prevents it from skipping over any breakpoints set on instructions that
were not traced. Note that the TimeMachine Debugger does not stop in all cases:
if it is running (as opposed to stepping), it will not stop on instruction trace that is
missing due to a FIFO overflow. For information about the option Stop at
discontinuities, see “The Analysis Tab” on page 490.
Many trace architectures can be configured to only generate instruction trace data
of certain functions or when certain conditions are met. All of the MULTI trace
tools attempt to deal with the sparse trace data that results from this trace suppression,
but as more instruction trace is disabled, the usefulness of high-level tools such as
the TimeMachine Debugger and the PathAnalyzer degrades rapidly. If instruction
trace is suppressed to the point that only short bursts of instructions are traced, the
TimeMachine API and the instruction pane in the Trace List are likely to be the
only useful trace analysis tools. In the Trace List window, suppressed instruction
trace is indicated by a line with the text Trace Disabled.
Most trace architectures provide some mechanism for configuring when data accesses
are traced, or for completely disabling data trace. You can control this through the
Set Triggers window (see “The Set Triggers Window” on page 499). Limiting or
disabling data trace can prevent instruction trace from being lost. You may therefore
want to disable data trace if you are primarily using trace data for performance
analysis or for the PathAnalyzer, where data trace is not important. If you are
collecting trace data over Nexus, you may alternatively enable the option Stall
Processor to Avoid Overflows to prevent instruction trace from being lost. For
information about this option, see the documentation about target-specific trace
options in the Green Hills Debug Probes User's Guide.
It is also possible for trace data to include incomplete context switch markers. For
example, on some INTEGRITY targets, the raw trace data includes sufficient
information for MULTI to determine the active AddressSpace, but not enough
information for it to determine the active task. On some architectures, MULTI
attempts to infer the active task by leveraging data trace and knowledge of the
kernel. In this case, missing data trace may prevent MULTI from determining the
task associated with some context switches. Such context switches are marked as
switching into an unknown task. On other architectures, debug builds of the kernel
include special instrumentation that allows MULTI to extract active task information
from the trace data. In some cases, active task information is not available and trace
data for all tasks in the same AddressSpace is lumped together. In other cases, even
active AddressSpace information may not be available due to incomplete trace data.
1. Ensure that your primary ELF file does not include any address ranges
containing code that changes at run time.
2. Use one of the following techniques:
• If run-time changes are the result of loading different overlays into
memory, we recommend that you create a separate ELF file for each
overlay. Prior to retrieving trace data, use the loadsym command to load
the ELF file corresponding to the currently loaded overlay. For information
about the loadsym command, see “loadsym” in Chapter 2, “General
Debugger Command Reference” in MULTI: Debugging Command
Reference.
• Enable the option Read unknown opcodes from target (may halt target).
For information about this option, see “The Analysis Tab” on page 490.
If your trace data includes information about data accesses, MULTI uses that
information to infer as much as possible about the state of the target at each point
recorded in the trace log. If you have a complete log of the address and value of
every data access, TimeMachine is usually able to completely reconstruct the state
of all registers and memory accessed by your program. This allows features such
as the Data Explorer, the Register View window, and the Memory View window
to be used in the TimeMachine Debugger just as they are used in the standard
MULTI Debugger.
However, if your trace log does not contain a complete log of the address and value
of every data access, or if the trace log does not go back far enough to include
necessary data accesses, MULTI may be unable to reconstruct some parts of the
target state. Values that MULTI cannot infer from the available trace data are
displayed as << Unreadable/Unknown >>. For more information, see “Dealing
with Incomplete Trace Data” on page 416.
Note
MULTI cannot infer register and memory values from trace data collected
on a MIPS target.
The following things happen to indicate that you are in TimeMachine mode:
To disable TimeMachine mode for selected target list entries, do one of the
following:
Tip
You can also issue TimeMachine commands in the Debugger command
pane to move backward through your code. The command equivalents
for each button are given in the following table. For more information
about these commands, see Chapter 13, “Program Execution Command
Reference” in the MULTI: Debugging Command Reference book.
those hardware breakpoints to the live target as are supported; the rest are retained
but disabled.
The first time you want to launch TimeMachine on a task, you must launch it
manually. After you have launched TimeMachine on the first task, TimeMachine
may be automatically launched on other tasks if hardware breakpoints are hit in
those tasks while TimeMachine is running. To launch TimeMachine on a task, do
one of the following:
• Select the task in the target list and then click the TimeMachine Debugger
button ( ) or any one of the TimeMachine run control buttons ( , , , or
). For information about the run control buttons, see “TimeMachine Run
Control Buttons” on page 422.
• Select the task in the target list and then enter the timemachine command in
the Debugger command pane.
• In the Debugger command pane, enter timemachine –tid task_id to launch
TimeMachine on the specified task.
• In the Debugger command pane, enter timemachine –as_name AddressSpace
to launch TimeMachine on the first task in the specified AddressSpace.
For more information about the timemachine command, see Chapter 19,
“TimeMachine Command Reference” in the MULTI: Debugging Command
Reference book.
Note
You can only launch TimeMachine on tasks that exist on the target. If a
task has been removed or unloaded from the target, you will not be able
to launch TimeMachine on it even if it has trace data associated with it.
You can work around this behavior by saving the trace data to a file and
then loading it back into MULTI (see “Saving and Loading a Trace
Session” on page 455). Once the trace file is loaded, TimeMachine is
automatically launched on all tasks that were traced.
After TimeMachine has been launched on two or more tasks, the mode of these
tasks is synchronized. As a result, if you disable TimeMachine mode for one of the
tasks, it is also disabled for the other(s). Similarly, if you enable TimeMachine again
for one of the tasks, it is also enabled for the other(s). Tasks on which you never
launched TimeMachine are unaffected by these actions.
Once TimeMachine has been launched on several tasks, you can step or run forward
or backward from any of them. If you do so from a task that is not the currently
executing one, the step/run operation begins from the location of the blue program
counter arrow ( ) in the currently executing task. The end location of a successful
step is relative to the location of the blue program counter displayed in the selected
task.
Note
OS-awareness in TimeMachine requires specific parts of OS execution
to be reconstructed. If kernel trace data is incomplete, MULTI may discard
trace data for some tasks. For more information, see “Dealing with
Incomplete Trace Data” on page 416.
When you are debugging the OSA master process in TimeMachine mode, you can
single-step and run through traced interrupts and exceptions. TimeMachine treats
all execution inside of interrupts and exceptions as a separate logical task, even
though it does not correspond to any physical task. Note that this behavior differs
from that of the OSA master process when not in TimeMachine mode. When not
in TimeMachine mode, you can use the OSA master process to run through all the
different tasks on the target.
When you run an OSA task for which TimeMachine is enabled, other OSA tasks
on the same processor, and for which TimeMachine is also enabled, run as well.
Similarly, if an OSA task for which TimeMachine is enabled halts for any reason,
other OSA tasks on the same processor, and for which TimeMachine is also enabled,
halt as well. Because halting a stepping task cancels the step, all step operations on
these tasks are canceled.
If your freeze-mode target halts, and you want to step or run backward in the current
task, select the OSA task in the target list before stepping or running backward. If
you do not select the task first (that is, you leave the OSA master process selected),
stepping or running backward steps/runs you back in the task with the most recently
traced data. To step/run back through interrupts and exceptions, select the
TimeMachine target list entry associated with the OSA master process.
Tip
If you want the current task to be automatically selected whenever the
target halts, ensure that the osaSwitchToUserTaskAutomatically
configuration option is set to on (the default). See the
osaSwitchToUserTaskAutomatically option in “Other Debugger
Configuration Options” in Chapter 8, “Configuration Options” in the
MULTI: Managing Projects and Configuring the IDE book.
Even though you cannot set any-task breakpoints on tasks in TimeMachine mode,
you can hit them. When TimeMachine is launched on an OSA task, TimeMachine
inherits any breakpoints set in the task. Additionally, any-task breakpoints existing
in TimeMachine tasks are copied to other tasks contained in the same AddressSpace
when TimeMachine is launched on these new tasks.
Because any-task breakpoints are inherited from OSA tasks, you can set an any-task
breakpoint in freeze mode and then enable TimeMachine if you want to hit the
breakpoint while in TimeMachine mode. Alternatively, you can simulate the behavior
of an any-task breakpoint without actually using one by setting a breakpoint in each
task of an AddressSpace.
In TimeMachine mode, breakpoints that are not task specific are only hit when the
breakpointed instruction is executed at the same virtual address and AddressSpace
where the breakpoint was originally set. This is in contrast to the way these
breakpoints behave on the live target, where regardless of how they are set, they
are hit when the breakpointed instruction is executed, even if that instruction has
been mapped to a different virtual address in a different AddressSpace and is
executed there.
Note
Before you can set a hardware breakpoint in an OSA task for which
TimeMachine is enabled, TimeMachine must be enabled for the master
process. If TimeMachine is not enabled for the master process, MULTI
prompts you to enable it.
When TimeMachine is disabled, any changes that you have made to software or
hardware breakpoints while in TimeMachine mode are applied to the live target.
All breakpoints in the master process revert to normal breakpoints on the target.
For some applications, it is not practical or desirable to halt a live target. If you
want the capability to run and step backward while your live target is running, you
may debug the process by launching TimeMachine as a separate session (called
Separate Session TimeMachine). Doing so creates an additional entry in the target
list. Selecting the original target list entry allows you to run and step the process in
live mode. Selecting the new target list entry allows you to run or step the process
backward in Separate Session TimeMachine.
Separate Session TimeMachine functions like regular TimeMachine except for one
key difference: breakpoints are not shared between Separate Session TimeMachine
and live mode. Breakpoints that exist in live mode are copied over to Separate
Session TimeMachine when it first starts, but from that point on, each has distinct
breakpoint sets. If you set a breakpoint on a process while in Separate Session
TimeMachine mode, the breakpoint does not appear in live mode, and vice versa.
• Select the process in the target list and then enter the command timemachine
–newsession in the Debugger command pane. See also the timemachine
command in Chapter 19, “TimeMachine Command Reference” in the MULTI:
Debugging Command Reference book.
• While the target is running, launch TimeMachine in any of the usual ways. In
the dialog box that appears, choose to launch TimeMachine as a separate
session.
All TimeMachine processes on a particular CPU are synchronized. When you debug
a process in Separate Session TimeMachine, any processes that are already in
TimeMachine mode are switched to Separate Session TimeMachine. Once a process
is in Separate Session TimeMachine, attempts to enter TimeMachine mode on any
other process automatically enable Separate Session TimeMachine. It is not possible
to simultaneously debug one process in TimeMachine mode and another in Separate
Session TimeMachine.
The PathAnalyzer
The PathAnalyzer shows your call stack over time so that you can analyze the
execution path of your program. In addition to displaying the relationship between
all functions, the PathAnalyzer keeps track of the number of times each function is
called and the execution time of every function called.
The PathAnalyzer is a great tool both for debugging and for optimizing for speed.
The graphical display allows you to look for anomalies in your program's execution
path. You might find functions calling functions they should not or taking much
longer than they should. Or you might discover the converse: functions not making
calls they should be making or exiting more quickly than expected. Because the
PathAnalyzer is linked with the TimeMachine Debugger, you need only double-click
a function in the PathAnalyzer to examine it more closely in the TimeMachine
Debugger. The PathAnalyzer's graphical display also makes the distribution of work
clear by showing the amount of work involved for each function. Once you know
what functions take longest, you can examine them in the TimeMachine Debugger
to see what you can do to speed them up.
The PathAnalyzer is also a great tool to use for getting a rough idea of how
unfamiliar code works. It usually only takes a couple minutes of exploring in the
PathAnalyzer to figure out what functions you need to examine in more detail to
solve a problem.
Depending on the target you are tracing, the horizontal axis of the PathAnalyzer's
central pane can represent time, instruction counts, or cycle counts. If your trace
data includes timestamps, the horizontal axis represents time. If your trace data
includes cycle counts, but does not include timestamps, the horizontal axis uses
cycle counts. If neither timestamps nor cycle counts are available, the horizontal
axis uses instruction counts.
Some hardware targets support more than one type of data collection. To set which
type of trace data you want to collect, perform the following steps:
Tip
Typically, if you want to analyze performance, you should collect trace
data with timestamps. However, if you are tracking down a difficult bug
or race condition or are trying to get a better understanding of your code
flow, collecting trace data by instruction count is most helpful.
The vertical axis in the PathAnalyzer's central pane represents call stack depth. As
function calls are made, the stack depth increases downward.
Each colored bar in the PathAnalyzer represents a single function call. The bar's
length is proportional to the length of time (or the number of instructions) it has
executed. By default, the PathAnalyzer colors function calls by hashing the name
of the function. However, you can also color functions by their filename or class
name. To change the method by which functions are colored, select PathAnalyzer
→ Color by Filename or PathAnalyzer → Color by Class.
You can display information about a function in any one of the following ways:
• Hover your mouse over a function to display a tool-tip with information about
the function.
• Click a function to view information about it in the status bar (located at the
bottom of the PathAnalyzer window).
• Click the button or press the number 1 on your keyboard to access the
Measure Tool. To measure the difference between two points, click a point
in the PathAnalyzer and drag your mouse right or left to create a selection. To
zoom in on your selection, click the Zoom to Selection button ( ).
The minimum call stack depth at a particular time is represented by the point where
the light blue color meets the dark blue line. The maximum call stack depth at a
particular time is represented by the point where the dark blue line meets the
background color. In the following graphic, the background color is white.
If you have not collected much trace data, the difference between the minimum and
the maximum values may not be very great, resulting in what appears to be a single
line.
You can zoom the PathAnalyzer in and out by clicking a point in the thumbnail
pane and dragging your mouse right or left. The wider your selection, the more
function calls are displayed in the central part of the window (equivalent to zooming
out). The narrower your selection, the fewer the function calls displayed in central
part of the window (equivalent to zooming in). After you have made your initial
selection, you can zoom in or out by dragging the right and left edges of your
selection.
The thumbnail pane also acts as the horizontal scroll bar for the PathAnalyzer. To
pan right or left from the thumbnail pane, do one of the following:
• Click the center of the thumbnail pane selection and drag it right or left.
• Click a new point in the thumbnail pane. If you click outside your current
thumbnail pane selection, the selection moves to your new location.
• Click the Pan Right or Pan Left button. These buttons are located at either
end of the thumbnail pane, as shown in the following graphic.
Bookmarks are displayed as short vertical lines in the thumbnail pane. Each
bookmark is colored according to the color set in the Trace Bookmarks window.
For more information about bookmarks, see “Viewing, Editing, and Adding
Bookmarks in the PathAnalyzer” on page 438.
If you do not want the cursor to be synchronized with the Debugger and the
Trace List, you can “unlink” the tools by clicking the pushed down Unlink
Selection button ( ).
• Bookmarks — When you find some interesting data in the PathAnalyzer, you
can bookmark it so that you can easily find it again later. You can assign each
bookmark a name and color. Bookmarks appear in the PathAnalyzer as colored
vertical lines. In addition to any bookmarks you might create yourself, MULTI
automatically selects and bookmarks the trigger packet when trace data is first
collected. The default name for the trigger bookmark is “Trigger,” and it is
colored red by default (see the graphic in “The PathAnalyzer Window”
on page 430). For more information about using bookmarks with the
PathAnalyzer, see “Viewing, Editing, and Adding Bookmarks in the
PathAnalyzer” on page 438.
• Smooth Scrolling — When the location of the PathAnalyzer cursor is
synchronized with other TimeMachine tools (see preceding bullet point), and
the cursor moves because of a location change in another window, the
adjustment can be disorienting. To make the transition less sudden, the
PathAnalyzer has a smooth-scrolling feature. When the location of the cursor
is updated to reflect a change in another window, the Path Analyzer gradually
scrolls you to the new destination.
Zoom in on a • Click the Zoom Tool button ( ). Then click a point in the
selection PathAnalyzer and drag your mouse right or left to create a selection.
• Press the number 2 on your keyboard. Then click a point in the
PathAnalyzer and drag your mouse right or left to create a selection.
Pan right • Click the Pan Right button located in the bottom-right corner of the
PathAnalyzer window. (See the second graphic in “The Thumbnail
Pane” on page 433.)
• Press Ctrl+RightArrow.
Pan left • Click the Pan Left button located in the bottom-left corner of the
PathAnalyzer window. (See the second graphic in “The Thumbnail
Pane” on page 433.)
• Press Ctrl+LeftArrow.
You may enter as many search strings as you want. All search strings are processed
through a logical AND. That is, a function turns gray unless it contains all of the
search strings.
To eliminate functions from your search, use the - (minus) operator. A function is
eliminated when its name matches the string following the minus sign.
Searches are case-insensitive unless you use capital letters in the search string.
Bookmarks appear in the PathAnalyzer as colored vertical lines. The color of the
line corresponds to the bookmark's color as set in the Trace Bookmarks window.
For more information, see “Bookmarking Trace Data” on page 451.
The easiest way to edit bookmarks is by using the Trace Bookmarks window.
Select Bookmarks → Edit Bookmarks. For more information, see “Bookmarking
Trace Data” on page 451.
These features automatically become available when you trace an operating system
that is supported by the trace tools.
The name of each task is displayed in the topmost portion of the EventAnalyzer
pane. The current task is displayed as a green horizontal line. To highlight a task,
hover your mouse over it. When a task is highlighted, its name is prominently
displayed in the top portion of the EventAnalyzer pane and its context switches turn
a brighter shade of green.
Small gray rectangles like the three pictured in the following closeup indicate events
that have not been drawn because they would overlap with other events.
Note
Certain architectures support AddressSpace tracing but not task tracing.
If this is the case, you are able to see context changes between different
AddressSpaces but not context switches within a single AddressSpace.
For more information, see “Dealing with Incomplete Trace Data”
on page 416.
• The tree pane, which appears on the left side of the window, displays the call
stack in a tree view. Each node in the tree represents a function call. Expanding
a node displays additional, chronologically ordered nodes for all the functions
called during the associated function call. When you are tracing an application
with multiple tasks or AddressSpaces, top-level function nodes also display
the name of the associated task or AddressSpace.
• The instruction pane, which appears on the right side of the window, displays
a list of executed instructions. This pane shows all the instructions in a single
list, regardless of what function or AddressSpace the instructions reside in.
• The thumbnail pane, which appears in the bottom of the window, displays the
call stack of your program over time. This pane provides an overview that
shows when your program was calling many functions and when it was
executing a relatively shallow call stack. The thumbnail pane also displays the
amount of time you spent gathering trace data, any bookmarks you may have
set, and your current location in the trace buffer.
To enable you to see what functions called what other functions, the tree pane's
Function Calls column displays executed functions in tree form. At each level,
you can expand a function to display the functions it called. To navigate to the trace
data corresponding to a function, select the function in the tree list.
The tree pane's Duration column displays the amount of time that the given function
took to execute. Depending upon your trace collection settings, the duration is
displayed in instruction counts, cycles, or elapsed time. The duration includes the
time taken by the given function as well as the time taken by functions it called.
The splitter between the tree pane and the instruction pane allows you to resize the
tree pane for the appropriate amount of detail.
When you are tracing a target with multiple tasks, context switches between tasks
appear as multiple top-level entries in the tree pane. If the target operating system
supports multiple AddressSpaces, top-level entries include the AddressSpace name.
If task-aware trace is supported, they also include the task name. Colons are used
as delimiters between the AddressSpace name, task name, and function name. When
all three are available, top-level nodes have names of the form
AddressSpace:Task:Function. Alternating colors ease readability and highlight
context switches.
If you want to focus only on certain columns of information in the instruction pane,
you can hide columns by right-clicking the column header. Then select the Hide
column menu option that corresponds to the column you want to hide. The menu
items corresponding to hidden columns appear ticked. To show the column again,
select the menu item and the column appears.
To rearrange the columns, click and drag the column header of the column you
want to move. Move it horizontally to the desired location and release the mouse
button. To resize a column, click and drag the right border of the column header.
To automatically resize a column so that all data in the column is shown, double-click
the right border of the column header. Column order and size are automatically
saved between sessions.
Each column and the information it contains is described in the following table.
Total Instructions, The name of this column depends upon whether you have
Total Cycles, or Total timestamps, cycle counts, or neither enabled. If you have timestamps,
Time the cumulative time to that line is displayed. If you have no
timestamps but you do have cycle counts, this column displays the
cumulative cycle count up to this line. If you have neither timestamps
nor cycle counts, this column displays the total number of instructions
to this point in the trace data.
All values displayed in this column are relative to one line—initially
the trigger—with negative numbers indicating that an instruction
was executed before the zero line.
If an instruction performed multiple data accesses, only the first data access is listed
on the same line as the instruction. The additional data accesses are shown on
separate lines that are initially hidden. To show the additional data accesses, click
the plus sign ( ) to the left of the instruction.
With the default color scheme, normal instructions and data accesses are displayed
with black text. On some targets, you may see blocks of instructions and data
accesses highlighted in blue. This indicates that those instructions and data accesses
were not present in the raw trace data because of an on-chip trace FIFO overflow,
but that MULTI was able to determine with a high degree of certainty that those
instructions and data accesses actually occurred. MULTI accomplishes this by
examining the trace data both before and after the overflow and simulating the code
in between. A line with red text reading FIFO Overflow indicates that MULTI was
unable to reconstruct all of the instructions lost as a result of a FIFO overflow. For
more information, see the option Attempt to reconstruct gaps in trace data in
“The Trace Options Window” on page 486. It is also possible to create filters that
color lines in the Trace List in any color. For more information, see “Filtering Trace
Data in the Trace List” on page 448.
You can print the contents of the instruction pane by selecting File → Print from
the Trace List menu bar. The instruction pane is formatted as it is currently displayed.
If a column is not wide enough to display the full contents of a cell, that cell's
contents are truncated in the printed output as well. If you would like to output the
trace data in a program readable format, select File → Export As CSV. This outputs
the trace data in Comma-Separated-Value format to a text file. You can control
which columns appear in the CSV file by showing and hiding them in the instruction
pane. Columns that are displayed in the instruction pane are exported to the CSV
file, columns that are hidden are not.
Both of the preceding menu options open the Choose a region dialog box, which
asks you to select a region of trace data to act upon.
By default, only the visible portion of the instruction pane is printed or exported,
but you can select the All radio button to print or export the entire contents of the
instruction pane. Alternatively, select the Custom Region radio button to print or
export a specific range of data. To identify a custom region, select bookmarks that
delimit the region or specify start and end times by manually typing them into the
Start and End fields or by clicking to the right of either field and then clicking
an instruction in the Trace List. If you selected File → Print, the dialog box indicates
the number of lines of text that will be printed when you click OK.
The thumbnail pane allows you to quickly navigate to any data point by clicking a
point in the pane. The thumbnail pane indicates the position of the selected
instruction with a vertical cursor.
Any bookmarks that you set are displayed as short vertical lines in the thumbnail
pane. Each bookmark is colored according to the color set in the Trace Bookmarks
window. To display a bookmark in the instruction pane, click the bookmark's vertical
line in the thumbnail pane. For more information about bookmarks, see
“Bookmarking Trace Data” on page 451.
Time Analysis
One of the major benefits of collecting trace data is that it allows you to
non-intrusively determine what the processor is doing while the processor is running
at full speed. Analyzing trace data allows you to determine the time between two
events. In this context, an event can be anything that appears in the Trace List,
including instructions, function calls, memory accesses, and even interrupts.
The Total column in the Trace List always displays the cumulative time before the
instruction on a line is executed. This column displays the following information
in each of these cases:
• When you have time tags enabled on your trace collection device, this column
is called Total Time and displays the total time before each instruction.
• When you have no time tags enabled, but you have cycle-accurate mode
enabled, this column is called Total Cycles and displays the total number of
cycles elapsed before each instruction is executed.
• When you have neither time tags nor cycle-accurate mode enabled, this column
is called Total Instructions and displays the total number of instructions
executed before each instruction is executed.
This information allows you to find two points in your trace data and determine the
total amount of time, number of cycles, or number of instructions elapsed, between
two points.
In addition, you can set the Total column to 0 at any line so that the Trace List can
do the required subtraction. This makes it easy, for example, to find what was
happening exactly 10 milliseconds after an interrupt. It also allows you to easily
find the time between 2 events of interest. For example, if you want to know exactly
how long the interrupt handler for a high-priority interrupt takes, you can set the
Total column to 0 when the interrupt occurs, then find the return from the interrupt
handler and see what the elapsed time is.
To set the Total column to 0 on a line, simply right-click the line and select Set
Total Time to 0 on this Line. When this option is selected, the Trace List will
refresh and the selected line will have its Total column set to 0. All other instructions
will now have their Total value relative to the selected line. Negative numbers
indicate that an instruction executed before the selected line and positive numbers
indicate that an instruction executed after the selected line.
select Go to Next Data Access. The Trace List selects the next instruction that
accessed the selected data address.
If no previous or next instance of an event exists, the Trace List prints an error
message in its status bar.
If you do not want the selection to be synchronized with the Debugger and the
PathAnalyzer, you can “unlink” the tools by clicking the pushed down Unlink
Selection button ( ).
Browse History
The and buttons allow you to move to the previous and next instructions that
have been selected in the Trace List. These buttons work just like similar buttons
on standard Web browsers. This allows you to easily move between various
instructions that you have examined in your trace data.
In addition, you can define more complex filters using the Trace Filters dialog. To
access this dialog, select Search → Filters from the menu bar or click on the
toolbar.
The Trace Filters dialog consists of a list of currently active filters as well as
controls to add new filters. To add a filter, select the action you would like the filter
to have and the type of event to filter. Then enter a function name, source line,
address, or variable name and an optional value for data accesses. When you select
the Color action, you can also specify the color for the matching lines. Then click
the Add button. You can add as many filters as you would like in this manner.
Note
On INTEGRITY, you may only use kernel space symbols when creating
filters. Also note that Trace List filters currently match virtual addresses
in all AddressSpaces. For example, if you create a filter on a Data Read
at Address 0x1000, MULTI triggers the filter when 0x1000 is read in
any AddressSpace.
Filters are applied in the order that they are added and once a line matches a single
filter, processing for that line stops. This means that if multiple filters match on a
given line, the action specified by the first one in the Active Filters list is performed.
For example, if two filters match on a line and the first is to Color and the second
is to Hide that line, the line is colored rather than hidden.
You can edit an existing filter by selecting it in the Active Filters list and changing
the values associated with it. Then click the Set button to confirm the new filter
settings. The Add button remains active, allowing you to add a new filter based on
the previous filter.
In addition, you can edit a filter to specify a complex event by selecting an existing
filter and clicking the Advanced Edit button. This opens the Advanced Event
Editor window, which allows you to define a complex event. When you click OK
in the Advanced Event Editor window, the changes are automatically applied to
the selected filter. For more information about using the Advanced Event Editor
window, see “Editing Complex Events” on page 503.
You can also manage your list of filters either by clearing all filters or by deleting
an individual filter.
• In the Trace List, right-click the instruction you would like to bookmark and
then select the Add Bookmark menu item.
• In the PathAnalyzer, right-click the function you would like to bookmark and
then select Add Bookmark at Entry, Add Bookmark at Exit, or Add
Bookmark at Cursor.
• In the Trace List or in any of the Trace Browsers, click the gray line that
appears to the left of the instruction.
Note
The right-click menu items are also available via the Bookmarks menu.
In windows such as the Trace Browsers and Trace List, a flag is drawn next to
bookmarked instructions. In the Trace List, the text of bookmarked instructions is
also colored. In windows such as the Trace List and PathAnalyzer, vertical lines
representing bookmarks are added to the thumbnail pane at the bottom of the
window.
In addition to the manually added bookmarks, when a trigger is found in the trace
data, a bookmark is automatically added to allow you to easily navigate to the trigger
position. The default name for trigger bookmarks is “Trigger,” and they are colored
red by default.
Once there are one or more bookmarks, you can view all of the defined bookmarks
through the Trace Bookmarks window. To open the Trace Bookmarks window,
do one of the following:
Each bookmark has a name and a color associated with it. By default, bookmarks
are named for the function they correspond to.
The Name column in the Trace Bookmarks window displays the bookmark's
name. The Delta column displays the difference (in instructions, time, or cycles)
between a bookmark and the previous bookmark. For a description of the remaining
data columns, see “The Instruction Pane” on page 442.
The simplest searching capability allows you to search through the data that currently
appears in either the tree or instruction pane of the Trace List. To perform a search
of this type, click in the pane you want to search, press Ctrl+F, and then enter a
string. Matching strings are highlighted as you type. To search again for the same
string, press Ctrl+F again. To search backward for a string, press Ctrl+B. To abort
the current search, press Esc.
In addition to this simple searching mechanism, you can use the Trace Search
dialog box to search for various events in your trace data. To open this dialog box,
do one of the following:
The Trace Search dialog, shown above, allows you to search your trace data for
the events listed in the following table.
Event Description
Address Searches for execution of a specific instruction. The address of the
Executed instruction may be specified by entering a function name and offset, function
name and line number, or the address.
Function Searches for execution of any instruction in a specific function.
Executing
Function Not Searches for execution of any instruction not in a specific function.
Executing
Data Searches for reads from or writes to a variable or address. You can also
Read/Written search only for accesses that read or wrote a specific value.
Data Read Searches for reads from a variable or address. You can also search only for
reads that read a specific value.
Data Written Searches for writes to a variable or address. You can also search only for
writes that wrote a specific value.
Event Searches for a specific type of trace event. The available events are described
in “Event Type Descriptions” on page 507.
Exception Searches for a specific type of exception. The Exception option is not
available on all targets.
Custom Event Searches for a complex event. You can specify the complex event with the
Advanced Edit button. See “Editing Complex Events” on page 503 for
details.
To search for an event, select the type of event to search for from the Find
drop-down list. Then enter the appropriate information for the event and click the
Find Next button to find the next occurrence, or click the Find Previous button to
find the previous occurrence.
If you have collected trace data from multiple AddressSpaces, you can limit your
event search to only one of the AddressSpaces by selecting one from the
AddressSpace drop-down list. Any symbols specified in the search are looked up
in the selected AddressSpace or, if All is selected, in the kernel AddressSpace.
You can also bookmark all matches to a search with the Bookmark All button.
Clicking this button adds bookmarks for all matches, indicating their locations in
the thumbnail pane and allowing you to view them in the Trace Bookmarks
window. When there are more than 100 search matches, you are offered the choice
of adding bookmarks for all search matches, for only the first 100 search matches,
or for none of the search matches.
In addition to the predefined events described above, you can find arbitrarily complex
events by using the Advanced Edit button. The interface to specify these complex
events is described in “Editing Complex Events” on page 503.
If you are concerned for intellectual property reasons about saving your ELF image
and/or debug information, you can optionally not include them in the trace session.
To save only the trace data, enter the command tracesave --data. To save the trace
data and ELF image but not the debug information, enter the command tracesave
--data_elf. (For more information about the tracesave command, see Chapter 19,
“TimeMachine Command Reference” in the MULTI: Debugging Command
Reference book.) Note that certain trace tools, such as the PathAnalyzer, require
debug information in order to display useful data.
Note
Large temporary files may be created during the process of saving a trace
session. By default, these files are created in the directory where the trace
session file is created. As a result, more space will be needed on that file
system than is needed to store just the trace session file. You can specify
an alternative location for the temporary files with the tracesave command
(see Chapter 19, “TimeMachine Command Reference” in the MULTI:
Debugging Command Reference book).
The information you save in the trace session file determines how your colleague
loads the file. For details, see the following table.
• Start the Debugger from the command line, and specify the
trace session file on the command line, as follows:
multi trace_session.trs
Only the trace data 1. If you are using INTEGRITY, locate and debug the kernel
executable.
If you are not using INTEGRITY, locate and debug the ELF
file that was used when you saved the trace data.
2. Load the trace session as described below.*
Note: If you have rebuilt the program since you collected the
trace data, loading and/or using the saved trace data may produce
unexpected behavior.
Trace data saved with 1. If you are using INTEGRITY, locate and debug the kernel
MULTI 4.x executable, and connect to a simulator that can run the
executable.
If you are not using INTEGRITY, locate and debug the ELF
file that was used when you saved the trace data, and connect
to a simulator that can run the ELF file.
2. Load the trace session as described below.*
Note: If you have rebuilt the program since you collected the
trace data, loading and/or using the saved trace data may produce
unexpected behavior.
• In the Debugger command pane, enter the traceload command. You may
optionally specify a file to load. For more information about the traceload
command, see Chapter 19, “TimeMachine Command Reference” in the MULTI:
Debugging Command Reference book.
Note
You cannot load a trace session into an earlier version of MULTI than
was used to save it. This is true of major versions only. For example, if
a trace session was saved in MULTI 7.x, you cannot use MULTI 6.x to
load it; you must use MULTI 7.x or later.
Because MULTI does not save source files when you save a trace session, you will
be unable to see source if MULTI cannot locate the original source files when you
load the trace session. If MULTI can locate the source files, but they have been
modified since originally being traced, they will not accurately match the saved
trace data. To load source files that you have saved, use the source or sourceroot
command. For information about these commands, see “General Configuration
Commands” in Chapter 6, “Configuration Command Reference” in the MULTI:
Debugging Command Reference book.
Tip
If a large number of tasks will be loaded from trace, it may be useful to
set the configuration option osaTaskAutoAttachLimit. For more
information, see the description of this configuration option in “Other
Debugger Configuration Options” in Chapter 8, “Configuration Options”
in the MULTI: Managing Projects and Configuring the IDE book.
• Trace Memory Browser (see “The Trace Memory Browser” on page 458)
• Trace Branch Browser (see “The Trace Branch Browser” on page 460)
• Trace Instruction Browser (see “The Trace Instruction Browser” on page 461)
• Trace Call Browser (see “The Trace Call Browser” on page 463)
The Trace Memory Browser contains a list of all the memory accesses to a specific
memory location. From left to right, this list displays the following information for
each memory access:
• Whether or not the instruction that caused the memory access is bookmarked.
In the narrow, left-most column, you can add or remove a bookmark by clicking
the vertical gray line or the flag, respectively.
• The PC and function in which the access occurred.
• The value that was read or written to this memory location.
• The type of access. This indicates whether the access was a read or a write.
• The cumulative time at which the access occurred. This column corresponds
to the Total Time, Total Cycles, or Total Instructions column of the Trace
List.
Initially, MULTI sorts the memory accesses by the cumulative time column. You
can sort by any column other than the first one.
For information about the Trace Memory Browser toolbar, see “Trace Browsers
Toolbar” on page 465.
To open a Trace Branch Browser, open the Trace Statistics window and
double-click one of the branches listed in the Branches tab.
From left to right, the Trace Branch Browser displays the following information
for each execution of the branch:
• The cumulative time at which the branch occurred. This column corresponds
to the Total Time, Total Cycles, or Total Instructions column of the Trace
List.
Initially, MULTI sorts the executions of the branch by the cumulative time column.
You can sort by any column other than the first one.
For information about the Trace Branch Browser toolbar, see “Trace Browsers
Toolbar” on page 465.
• In the Trace List, right-click the instruction you want to browse and select
Browse Executions.
• In the Debugger, right-click the instruction of interest and select Trace →
Browse Traced Executions.
• In the Debugger command pane, enter the tracebrowse -line command. For
information about the tracebrowse command, see Chapter 19, “TimeMachine
Command Reference” in the MULTI: Debugging Command Reference book.
From left to right, the Trace Instruction Browser displays the following information
for each execution of the instruction:
Initially, MULTI sorts the executions of the instruction by the cumulative time
column. You can sort by any column other than the first one.
For information about the Trace Instruction Browser toolbar, see “Trace Browsers
Toolbar” on page 465.
• In the Trace List, right-click a function node and select Browse Function Calls.
• In the PathAnalyzer, right-click a function and select Find Function
References.
• In the Functions tab of the Trace Statistics window, double-click a function,
or select a function and click the Details button ( ).
• In the Debugger, right-click a function name and select Trace → Browse
Traced Calls.
• In the Debugger command pane, enter the tracebrowse command. For
information about the tracebrowse command, see Chapter 19, “TimeMachine
Command Reference” in the MULTI: Debugging Command Reference book.
From left to right, the Trace Call Browser displays the following information for
each call of the function:
• Whether or not the call site of the function is bookmarked. In the narrow,
left-most column, you can add or remove a bookmark by clicking the vertical
gray line or the flag, respectively.
• The call site, which is the location that the function was called from. This will
include an address and, if available, the function and offset of that address.
• The duration, which is the total time that the function was on the stack. This
is counted from the time the function or its called functions were first observed
to the time the function or its called functions were last executed. If trace data
is available for the function's entire execution, this value is simply the time
elapsed between the function's call and its return.
• The cumulative time at the start of the function. If the start of the function is
not in the trace data, the time at which the function was first known to be on
the call stack is used instead. This column corresponds to the Total Time,
Total Cycles, or Total Instructions column of the Trace List.
Initially, MULTI sorts the calls of the function by the cumulative time column. You
can sort by any column other than the first one.
Note
The following situations can cause the function start time, duration, and
call site to be incorrect:
For information about the Trace Call Browser toolbar, see the next section.
The Trace Statistics window is broken up into five tabs: Summary, AddressSpaces,
Memory, Branches, and Functions. The AddressSpaces tab is only available if
you collected trace data from an INTEGRITY application. The Memory tab is only
available if your trace data includes the data addresses associated with memory
access instructions.
When you trace an INTEGRITY application, there will be one or two drop-down
lists at the bottom of the window. These drop-down lists allow you to select an
AddressSpace and a task that apply to all the tabs (except the AddressSpaces tab,
which displays summary information about all traced AddressSpaces and tasks).
Note
The trace data collected from some targets does not include sufficient
information to determine which INTEGRITY task was executing at any
particular time (see “Dealing with Incomplete Trace Data” on page 416).
With those targets, there will not be a task drop-down list.
To reset the trace statistics, you must clear your trace data. For more information,
see “Discarding Trace Data” on page 416.
Summary
The Summary tab of the Trace Statistics window contains summary statistics for
either the entire trace buffer or for traced instructions from the currently selected
task or AddressSpace.
The information that this tab contains is detailed in the following table.
Item Description
Instructions The total number of instructions found in the trace buffer.
16 bit The total number of 16-bit instructions that were executed as well as the
percentage of total instructions that were 16–bit instructions. This item only
appears when trace data was collected from a target that has both 32–bit and
16–bit instruction sets.
Cycles The total number of cycles elapsed as well as the average number of cycles
per instruction. This item only appears when cycle-accurate mode is enabled.
Item Description
Data Accesses The total number of data accesses.
Loads The total number of loads as well as the percentage of data accesses that were
loads.
Stores The total number of stores as well as the percentage of data accesses that were
stores.
Branches The total number of branch instructions.
Taken The total number of branch instructions that were taken, meaning that they
caused a change of flow in your process. The percentage of total branch
instructions that were taken is also printed.
Not Taken The total number of branch instructions that were not taken, meaning that their
conditions failed and execution continued on the next instruction. The
percentage of total branch instructions that were not taken is also printed.
AddressSpace Statistics
When tracing an INTEGRITY target, the AddressSpaces tab will display statistics
about each AddressSpace in which a task executed during the trace run.
The following information will be displayed for each AddressSpace and, if task
information is available, for each task:
Column Description
Instructions The total number of traced instructions from the task or AddressSpace.
16 bit The total number of 16-bit instructions that were traced from the task or
AddressSpace. This column only appears when trace data was collected from
a target that has both 32–bit and 16–bit instruction sets.
Cycles The total number of cycles spent executing instructions from the task or
AddressSpace. This item only appears when cycle-accurate mode is enabled.
Accesses The total number of data accesses performed by instructions from the task or
AddressSpace.
Loads The total number of loads performed by instructions from the task or
AddressSpace.
Stores The total number of stores performed by instructions from the task or
AddressSpace.
Branches The total number of branch instructions traced from the task or AddressSpace.
Taken The total number of branch instructions from the task or AddressSpace that
were taken, meaning that they caused a change of flow in your process.
Memory Statistics
The Memory tab of the Trace Statistics window contains a list of all the addresses
that were read or written during the trace run. This list displays the following
information for each memory location accessed:
• The number of loads from this address as well as the percentage of all loads
that were from this address. For addresses that were only loaded from, the text
of the row is green.
• The number of stores to this address as well as the percentage of all stores that
were to this address. For addresses that were only stored to, the text of the row
is red.
• The total number of accesses to this address as well as the percentage of all
accesses that were to this address.
A Trace Memory Browser opens for the selected memory location. See “The
Trace Memory Browser” on page 458.
Branch Statistics
The Branches tab of the Trace Statistics window contains a list of all of the
branches that were collected during the trace run. This list displays the following
information about each branch executed:
A Trace Branch Browser opens for the selected branch. See “The Trace Branch
Browser” on page 460.
Function Statistics
The Functions tab of the Trace Statistics window contains a list of all of the
functions that were called during the trace run. This list displays the following
information about each function called:
All run times are reported in the units available from the trace data.
Note
Function run times shown on this tab may be less than the actual function
run times in the following cases:
A Trace Call Browser opens for the selected function. See “The Trace Call
Browser” on page 463.
The TimeMachine API provides two interfaces that allow you to access your trace
data:
Both of these interfaces allow you to access the trace packet stream and then perform
custom analysis. In addition, the live interface enables you to look up symbol values
for your program, which provide useful trace analysis information. Applications
and scripts using the live interface are usually launched from the MULTI Debugger
with the trace api command. (For information about the trace command, see Chapter
19, “TimeMachine Command Reference” in the MULTI: Debugging Command
Reference book.) Applications and scripts using the file interface are usually launched
outside of MULTI because they do not require a connection to an active trace
session.
Note
If you want to access the TimeMachine API using Python, you must
install Python and the ctypes Python module. Some of the Python
examples also require that you install the Tkinter Python module and
Tcl/Tk.
To launch a Python script, enter the following command in the Debugger command
pane:
> trace api path_to_Python_application path_to_script
where:
The list below specifies the functions that your application or script must call to
establish a live TimeMachine connection. The functions must be called in the
specified order.
When the connection is established, you can call live interface functions to access
the number of trace packets, access an array of trace packets, and control the trace
collection process. In addition, you can query the Debugger for information about
symbols and addresses in your program, which enables you to easily correlate your
results back to your system's source code. You can find a comprehensive list of live
interface functions in the timemachine_api.h header file located at
ide_install_dir/timemachine_api. For information about data stored in the trace
stream, see ts_packet.h.
1. Collect some trace data in the MULTI Debugger. For information about
collecting trace data, see “Enabling and Disabling Trace Collection”
on page 411.
2. Save the trace data. For information about saving trace data, see “Saving and
Loading a Trace Session” on page 455.
3. You may optionally close the Debugger at this point.
The list below specifies the functions that your application or script must call to
open a file of saved trace data. The functions must be called in the specified order.
When the trace file is opened, you can call file interface functions to access the
number of trace packets and access an array of trace packets. For a comprehensive
list of file interface functions, see the timemachine_api.h header file located at
ide_install_dir/timemachine_api. For information about data stored in the trace
stream, see ts_packet.h.
The following list specifies the functions that your application or script must call
to create a file of saved trace data. The functions must be called in the specified
order.
• timemachine_api_test.py
• timemachine_api_test2.py
• timemachine_api_test3.py
• timemachine_api_file_test.py
ide_install_dir/timemachine_api/example_python
For information about how to launch a Python script, see “Accessing Trace Data
via the Live TimeMachine Interface” on page 473.
The following sections provide more detailed instructions about how to run these
examples and information about what each one demonstrates.
Before you can run these examples, you must first collect some trace data in the
MULTI Debugger. For information about collecting trace data, see “Enabling and
Disabling Trace Collection” on page 411. If you do not already have a program in
which to collect trace data, you can use the Project Manager to access the
TimeMachine Debugging demo project. For information about creating a project,
see Chapter 1, “Creating a Project” in the MULTI: Managing Projects and
Configuring the IDE book.
After you have collected trace data, you can launch the following example scripts:
For information about how to launch a Python script, see “Accessing Trace Data
via the Live TimeMachine Interface” on page 473.
1. Collect some trace data in the MULTI Debugger. For information about
collecting trace data, see “Enabling and Disabling Trace Collection”
on page 411.
2. Save the trace data as timemachine_api_file_test.trs. Save the file to the
ide_install_dir/timemachine_api/example_python directory. For information
about saving trace data, see “Saving and Loading a Trace Session” on page 455.
3. You may optionally close the Debugger at this point.
4. Launch the application or script in one of the following ways:
• Windows — From the command prompt, run the following command in
the ide_install_dir\timemachine_api\example_python directory:
ide_install_dir/timemachine_api/example_c/timemachine_api_test.cc.
You can use this example source code to build a native application that links against
the TimeMachine API library. To build a native application, you must use native
development tools for your host operating system, such as Green Hills MULTI for
x86 Linux Native, Microsoft Visual C++, or GNU GCC. After building the native
application, you can use MULTI to invoke it and to print basic statistics for any
trace data you have collected.
The C/C++ example provides you with a good starting point from which to create
a TimeMachine API application for your own custom analysis of trace data.
1. Use your native development tools to create a project. Then adapt the following
steps to your native tools:
• Add the timemachine_api_test.cc C++ source file to your project. This
file is located at ide_install_dir/timemachine_api/example_c.
• Add ide_install_dir/timemachine_api as an include directory. This is the
location of the timemachine_api.h and ts_packet.h header files, which
are included by timemachine_api_test.cc.
• Windows — Link against the timemachine_api.lib library file, which is
located at ide_install_dir.
• Linux/Solaris — Link against the timemachine_api.so library file, which
is located at ide_install_dir.
2. Build the native project you just created.
3. Set aside the native application you just built, and use the MULTI Debugger
to collect trace data from your target. For information about collecting trace
data, see “Enabling and Disabling Trace Collection” on page 411.
4. Retrieve the trace data. For more information, see “Retrieving Trace Data”
on page 413.
5. Enter the following command in the MULTI Debugger command pane to run
the application built in step 2:
> trace api application_name
Note
Generating EventAnalyzer information is only available when using an
operating system that supports the MULTI EventAnalyzer with trace.
Note
The EventAnalyzer requires that your trace data either include data
accesses or task switch markers. If neither is available, all events are
gathered in a common task denoted Unknown Context. Unknown
Context is also used to display events at the beginning of the trace before
the current task is known.
To generate EventAnalyzer information from the current trace data and open the
EventAnalyzer on that information, do one of the following:
MULTI will display a progress window while it converts the trace data. When the
conversion is complete, the MULTI EventAnalyzer will launch automatically. For
information about the MULTI EventAnalyzer, see the EventAnalyzer User's Guide
or the documentation about using the MULTI EventAnalyzer for ThreadX in the
MULTI: Developing for ThreadX book.
Note
The EventAnalyzer does not display relevant information in the More
Info field of the Event View window or in the tooltip that is displayed
when you click an event. All event parameters except for PC are displayed
as 0 (zero). To view these parameters, use the TimeMachine Debugger.
In addition, task statuses are not displayed. Tasks are either in a running
or non-running state.
The Reconstructed Registers window displays a list of all the registers that MULTI
can reconstruct from the trace data.
If a register's value prior to executing the selected instruction can be inferred, the
value will be displayed. If not, ? will be displayed to indicate that the register value
is unknown.
In the Reconstructed Registers window, you can navigate to the previous or next
write to the selected register:
Caveats
• Changing the default rounding mode for floating-point operations may result
in differences in rounding in TimeMachine and live mode.
Advanced Trace
Configuration
Contents
The Trace Options Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
Configuring Target-Specific Trace Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493
Viewing Target-Specific Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
Configuring Trace Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
Chapter 20. Advanced Trace Configuration
For descriptions of the options available in this window, see the following sections.
Unless otherwise stated, all descriptions of toggle options explain the behavior of
the option when enabled.
Collection Description
Option
Automatically Automatically enables trace collection when you establish a connection
enable trace to a target that supports trace. By default, this option is selected.
collection
Disable trace Disables additional trace collection when trace is automatically retrieved
when trace due to a trigger event. Disabling this option causes MULTI to automatically
retrieved due to re-enable trace collection after trace is retrieved due to a trigger. This can
trigger be useful for collecting a large amount of trace data consisting of
independent trace buffers each centered around a trigger.
By default, this option is selected.
Retrieve trace Automatically downloads collected trace data when the target halts. This
when target halts means that when your target halts, trace data is immediately available for
use with TimeMachine.
Note that trace data is available for downloading only if trace collection
is enabled.
By default, this option is cleared.
Retrieve trace Automatically downloads collected trace data when the target's trace buffer
when buffer fills fills. Generally speaking, enabling this option results in trace data
periodically being downloaded when the target is running and when trace
collection is enabled. This is not the case, however, if you are using Green
Hills Probe firmware version 4.6 or later, and the option Disable trace
when trace retrieved due to trigger is enabled (the default). In this case,
trace collection is disabled as soon as the first full buffer is retrieved. To
get periodic updates, you must disable the option Disable trace when
trace retrieved due to trigger.
By default, this option is cleared.
Collection Description
Option
Target buffer size With SuperTrace Probe v3 targets:
Specifies the number of bytes of trace data to retrieve from the end of the
SuperTrace Probe's trace buffer. The SuperTrace Probe v3 always uses
all of its trace RAM as a large circular buffer. However, since it takes a
long time to retrieve all of the data, MULTI can be configured to initially
retrieve only a portion of the data from the end of the buffer. For more
information, see “Retrieving Trace Data from a SuperTrace Probe v3”
on page 414.
Note: Triggering on the SuperTrace Probe v3 uses the configured Target
buffer size rather than all available trace RAM. For example, if the Target
buffer size is set to 16 MB and the trigger position is set to 50%, trace
collection stops when 8 MB of data has been collected after the trigger
has occurred. For more information, see “Configuring Trace Collection”
on page 494.
With other targets:
Specifies the number of bytes to use for collecting trace data on the target
or probe. The most recent trace data of the quantity specified here is
buffered while trace collection is enabled.
When you need a large, contiguous capture of trace data, select a large
value. Large captures may take longer to download and analyze, and they
require more disk space to cache, so choosing the largest possible buffer
size is rarely preferable.
For all targets:
The target memory field displays the value of the target buffer size that
is currently specified. Moving the Target buffer size slider left and right
decreases and increases this value, respectively.
Collection Description
Option
Assume static Retrieves/synchronizes OSA data only for the first trace data retrieval after
OSA each time the program is loaded. When disabled [default], OSA data is
retrieved every time trace data is retrieved.
This option should be enabled only if the set of tasks and AddressSpaces
in a system is static. Enabling this option is preferable on hardware
configurations for which retrieving OSA data from the target takes a
prohibitively long time. When new trace data is retrieved and analyzed
without new OSA data, the trace data may be decoded using the wrong
opcodes. For more information, see “Collecting Operating System Trace
Data” on page 412.
You can manually retrieve OSA data by executing the trace updateosa
command. For more information about this command, see Chapter 19,
“TimeMachine Command Reference” in the MULTI: Debugging Command
Reference book.
Changes you make to this option take effect the next time trace data is
retrieved.
For information about OSA data, see Chapter 22, “Freeze-Mode Debugging
and OS-Awareness” on page 547.
Target Specific Opens a configuration window that contains target-specific options. This
Options button does not appear if the Trace Options window contains a
target-specific tab.
For more information, see the documentation about target-specific trace
options in the Green Hills Debug Probes User's Guide or, if you are using
a V850 target, the documentation about V850 trace options in the MULTI:
Configuring Connections book.
Host buffer size Specifies the percentage of free disk space to use for storing collected trace
data on your computer. When this space has been filled, older trace data
is deleted to make space for newly collected trace data. A heuristic, which
considers triggers, bookmarks, and the currently selected instruction, selects
which previous downloads are deleted first.
The host disk space field displays the host buffer size that is currently
specified. Moving the slider left and right decreases and increases this
value, respectively. The value in this field turns red if the host buffer size
is estimated to be too small. The size is estimated to be too small when a
full buffer from the target would likely be larger than the specified size.
The host buffer is only temporary storage and is not saved across sessions.
However, you may choose to save the trace data that has been collected.
For more information, see “Saving and Loading a Trace Session”
on page 455.
Collection Description
Option
Directory used Displays the location on your computer of the temporary files that store
for trace data downloaded trace buffers. The environment variable that specifies this
buffers path is shown above the text box.
To change the directory of the temporary trace files, change the value of
the environment variable TMP (Windows) or TMPDIR (Linux/Solaris),
and restart MULTI. To collect a large amount of trace data, the specified
directory must be on a drive with several gigabytes of free space.
Note
If the TimeMachine Debugger is running (as opposed to
stepping), it will not stop when it encounters instruction trace
that is missing due to a FIFO overflow.
Probes User's Guide or, if you are using a V850 target, in the documentation about
V850 trace options in the MULTI: Configuring Connections book.
To set an option on this tab, select the option from the list on the left, and modify
its value in the upper-right corner of the window.
Tip
You can quickly set toggle options (On/Off) by double-clicking them.
Action Buttons
If the Save configuration as default option is selected when you click OK or
Apply, your current settings in the Trace Options and Set Triggers windows,
along with your current target-specific settings, are applied to your current trace
session and are saved and automatically loaded each time you use the trace tools.
Click the Save button to save these settings to a file so that you can load them later
by clicking the Load button.
• Click the button labeled Target Specific Options on the Collection tab of the
Trace Options window
or
Click the target-specific tab (the fourth tab) in the Trace Options window.
For example, when you are connected to an ARM ETM target, this window displays
information about triggering resources available, the maximum width of the trace
port, and the size of the trace buffer.
For example, when a trigger is configured to occur in the center of the trace buffer,
the trace collection system continues to collect data until 50 percent of the buffer
has been filled after the trigger occurs. In this way, the trigger is always present in
the trace buffer after it is encountered. When trace collection stops as a result of a
trigger event, trace is automatically retrieved. (For information about other ways
to control trace collection and retrieval, see “Managing Trace Data” on page 410.)
On most architectures, the bookmarked instruction is not the exact instruction that
caused the trigger. The trigger bookmark could be as many as several thousand
instructions before or after the instruction that caused the trigger. This is due to the
fact that most trace architectures output trace data in such a way that it is impossible
to determine the exact instruction that caused the trigger.
You can use Debugger shortcut menus or the Set Triggers window to set the trigger
for your trace run. For more information, see “The Set Triggers Window”
on page 499.
Note
On INTEGRITY, it is not possible to configure trigger and trace events
in a specific AddressSpace. The Debugger shortcut menus, commands,
and the Set Triggers window only allow you to configure triggers and
trace events for the kernel AddressSpace. However, most trace hardware
and the Green Hills simulators respond to triggers and trace events when
the associated virtual addresses are executed or accessed in any
AddressSpace. For example, most trace hardware configured to trigger
upon execution of address 0x1000 will trigger upon execution of 0x1000
in any AddressSpace. Refer to your processor's documentation for details
about how triggers interact with virtual AddressSpaces.
Note
It may be necessary to halt certain targets before changes to trace triggers
will take effect.
Note
These options are not available with all targets.
These options overwrite any events and states in the current trace configuration. To
view or modify the current trace configuration, use the Set Triggers window. See
“The Set Triggers Window” on page 499 for more information.
To define a trace function interval, right-click a function in the source pane and
select Trace → Trace Function Interval from the shortcut menu. This opens a
Configure Trace Interval window.
When tracing using the Trace Function Interval option, trace begins in the disabled
state. Once the start condition is met, trace begins to be recorded. To set the start
condition, select the option that corresponds to the desired behavior from the Start
trace drop-down box. To set the stop condition, select the desired behavior from
the Stop trace drop-down box. The following table describes the options available
from these drop-down boxes.
Lists of all the functions in the program are displayed below the Start trace and
Stop trace drop-down boxes. By default, the function that was highlighted when
you selected Trace Function Interval will be the selected function, but you can
click another function to change the selection.
To confirm your settings, click OK. This will replace your existing trace
configuration with the trace function interval configuration you selected. To view
or modify the current trace configuration, use the Set Triggers window. See “The
Set Triggers Window” on page 499 for more information.
The Set Triggers window allows you to modify triggers as well as other trace
events.
Note
The Set Triggers window settings are saved on a per executable basis
because they often reference function and variable names that are specific
to the current project.
The events available in this window are target dependent. The most common events
are described below.
Event Description
Trigger Stops trace collection when the data you are interested in has been
collected. For more information, see “Configuring Trace Collection”
on page 494.
Trace Filters out unwanted trace data at the hardware level. Trace data is
generated only while this event is active.
Data Trace Filters out unwanted data trace. Memory accesses will only be traced
while both this event and the Trace event are active.
External Output Asserts an output signal of the trace hardware when active.
External Output is a hardware-specific feature that uses hardware
trace resources to cause implementation-defined behavior on the
target. This feature is similarly named, but unrelated to, the external
trigger feature of the SuperTrace Probe. If you would like to use the
TRIGGER IN and TRIGGER OUT ports on your SuperTrace
Probe, see the documentation about using external trace triggers in
the Green Hills Debug Probes User's Guide.
Some targets have very limited triggering hardware while others provide extensive
triggering and filtering capabilities. Even if your target has extensive triggering
hardware, there is always a limit to the number of each type of resource that can be
used when defining events in the Set Triggers window. If you exceed this limit,
the trigger will fail to be set and an error message will be displayed in the status
area at the bottom of the window.
The Set Triggers window displays each event supported by your current trace
architecture in the Events list. You can select an event to see the current setting for
that event. In addition, you can modify the current value and click Set to apply the
new setting to the selected event. When you click the Set button, the new values
are transferred to the trace target in anticipation of the next trace run.
Condition Description
Always or Trigger Always active. This condition is displayed as Trigger
Immediately Immediately with trigger events. When Trigger Immediately
is selected, the first instruction executed after trace is started
will cause trace collection to trigger. This results in trace
collection stopping automatically as soon as the trace buffer
fills.
Note that the trigger position is ignored if Trigger
Immediately is applied.
Never or Don't Trigger Never active. This condition is displayed as Don't Trigger
with trigger events.
Address Executed Active when the instruction at the specified address is
executing.
Function Executing Active when any instruction in the specified function is
executing.
Function Not Executing Active when any instruction not in the specified function is
executing.
Function and Callees Active when a function and the functions it calls are executing.
Executing This condition is activated when the first instruction of the
specified function executes, and it is deactivated when the
first instruction of the epilogue of the same function executes.
If the location of the function epilogue is unknown, the
condition deactivates when the last instruction of the same
function executes. As a result of this behavior, this condition
is not activated during a call to the specified function if the
trace starts in the middle of the call. Functions with multiple
return points at the instruction level are not supported. This
condition is not available for all events.
Function and Callees Not Active when any instruction not in the specified function or
Executing in a function called by the specified function is executing.
This condition is the inverse of Function and Callees
Executing and is affected by the same limitations. This
condition is not available for all events.
Function Interval Executing Activates when the start condition is true and deactivates when
the end condition is true. This condition is not available for
all events. For more information about function interval
tracing, see “Specifying a Trace Function Interval”
on page 497.
Condition Description
Data Read/Written Active when a variable or address is read from or written to,
when a specific value is read from or written to a variable or
address, or when a specific value is read from or written to
any address.
Data Read Active when a variable or address is read from, when a
specific value is read from a variable or address, or when a
specific value is read from any address.
Data Written Active when a variable or address is written to, when a
specific value is written to a variable or address, or when a
specific value is written to any address.
Exception Active when the specified exception is taken. This condition
is only available on some targets.
Custom Event Active when a complex event is enabled. You can specify the
complex event with the Advanced Edit button. For details,
see “Editing Complex Events” on page 503.
For the function and address executing conditions, you can enter a function name,
a function and line number, a function plus offset or an address in the Address
field.
For the various data conditions, you can enter a global or static variable or an address
in the Address field. You can also optionally enter a data value, and the event will
only occur when that value is read from or written to the specified address or, if the
Address field is left empty, to any address. If a data value is specified, the event
will only activate if a single data access reads or writes the specified value. For
example, these simple data conditions cannot be used to detect a write of a specific
64-bit value to a 64-bit variable if the 64-bit write is broken up into two 32-bit stores
by the compiler.
• If a trigger occurs shortly after trace collection is enabled, the actual location
of the trigger may be before the desired trigger position.
• If a trigger occurs and then trace is manually or automatically retrieved before
enough trace data is collected, the actual location of the trigger will be after
the desired trigger position.
In all other cases, the trigger will be at the desired position in the trace buffer. For
example, if you set the trigger position to 15 percent, 15 percent of the trace buffer
will contain trace data from before the trigger, and 85 percent of the buffer will
contain trace data from after the trigger.
The Advanced Event Editor window allows you to specify an event by defining
Resources and combining them in various ways. The top of the window displays
the current event and allows you to modify it while the bottom pane displays the
currently defined Resources.
The first step of defining an event is to create the Resources that you will use to
build the event. Resources can be defined to activate when:
In addition, you can create state machines that allow you to specify events that occur
in a specific order. Finally, two Resources, on and off, are predefined; these events
are always true and always false, respectively.
Creating Resources
To create a new resource, either click the New Resource button or right-click in
the Resource List and select the New Resource menu option. This will open the
Resource Editor dialog, which allows you to define the attributes for this resource.
Attribute Description
Address Defines the address or address range that the target must execute or access
in order for this resource to activate.
The radio buttons allow you to select between 4 different ways of specifying
the Address attribute.
• In Single mode, the resource will only activate when one specific address
is matched.
• In Range mode, both a start and end address are specified.
• In Array mode, a start address and an offset are specified. The offset
may be specified using the sizeof operator on a symbol name. For
example, to specify an event that is true when any element of an array
is accessed, you can set the Offset field to sizeof(array_name).
• In Symbol mode, the start and end addresses associated with the given
symbol define the address range which is used.
For those modes in which a range or offset is used (the Range, Array, and
Symbol modes), the end address is exclusive.
In both Single and Range modes, the exit operator can be used on a function
name to give the address of the first instruction of the epilogue of the function.
If the location of the function epilogue is unknown, the address of the last
instruction in the function is used. For example, to create a resource that
evaluates to true when a function called increment returns, set the address
field to exit(increment). Functions with multiple return points at the
instruction level are not supported by the exit operator.
The Bitmask is ANDed with the accessed address before any comparisons
are made. This required attribute applies to Read/Write, Read, Write, and
Execute resources.
The Access Size specifies a memory access size that must be matched by a
read or write in order for this resource to activate. This optional attribute
applies to Read/Write, Read, and Write resources and is only available with
some targets.
Value Allows a data pattern to be specified that must be matched by the read or
write in order for this resource to activate. The Bitmask is ANDed with the
data value transferred by the target before it is compared with the specified
data value.
The resource only activates if a single data access reads or writes the specified
value. For example, a single Write resource cannot be used to detect a write
of a specific 64-bit value to a 64-bit variable if the 64-bit write is broken up
into two 32-bit stores by the compiler.
This optional attribute applies to Read/Write, Read, and Write resources.
Attribute Description
External Input Specifies which external input signal to your target's triggering hardware will
activate this Resource. This required attribute only applies to External
resources.
Event Type Specifies which type of event will activate this Resource. The available types
are described in the next section. This required attribute only applies to Event
resources.
Exception Specifies which type of exception will activate this Resource. This required
attribute only applies to Exception resources, which are only available on
some targets.
MMD Index Specifies which memory map decode will activate this Resource. For more
information, see the documentation for your processor. This required attribute
only applies to Memory Map Decode resources, which are only available
on ARM ETM targets.
Note
Support for state machines and the number of supported states depends
on your trace architecture. For more information, see the specification
for your trace architecture.
To add a state machine, click the New State Machine button. This opens the state
machine editor, which allows you to create a state machine by adding states and
defining state transition events.
• Click the New State button. Then click the state and move it to a location on
the canvas.
• Right-click the background canvas and select Add State. Then click the state
and move it to a location on the canvas.
To rename a state, double-click it and enter a new name in the Set State Name
dialog.
To delete a state, select it and click the Delete button or press the Delete key.
A state transition defines the events on which the state machine changes state. Once
you have added all of the states you want, you can create transitions by right-clicking
the source state and selecting Add Link. Then click the destination state to create
the link. Alternatively, you can right-click and drag to the destination state to define
a new state transition.
Once you have defined a transition's start and destination states, the Advanced
Event Editor window will open so that you can define an event on which this
transition will occur. The transition will occur when the event evaluates to true.
To edit the event of an existing link, either double-click it or right-click and select
Edit.
The state machine starts in the start state, which is denoted by (S) after the state
name. To mark a state as the start state, right-click it and select the Set as Start
State menu option.
To clear your event, you can click the Clear button. When you clear the event field,
the Event Progress Indicator will display “Event not complete,” which indicates
that you must enter more text to define a valid event.
To insert a new resource, select it in the Resource List and either click the Insert
Resource button or right-click and select Insert Resource. The selected resource
name will appear in the event field.
To create a Boolean combination of two resources, insert a resource and then click
one of the Boolean operator buttons (AND or OR). The corresponding Boolean
operation will appear in the event field. You can now insert another resource to
combine with the first one.
are not properly matched, the Event Progress Indicator will display “Unmatched
parentheses,” which means that you do not have valid matching parentheses.
Count Expression
Sometimes you may want an event to be active when an event has occurred a certain
number of times. For example, if you have a bug that occurs after a function has
been executed 10,000 times, then you may want to trigger after the function has
been called 10,000 times. Count expressions allow you to define events of this form.
Any time that a resource can appear in the event field, you can also specify the
count of a resource. To insert a resource with a count, click the count() button. This
will open the Count dialog, shown below.
This dialog allows you to specify the event to count as well as a comparison operator
and a number. A count expression is true whenever the number of times the Count
Event has occurred during trace collection is such that comparing the count to the
specified number with the specified comparison operator evaluates to true.
To set the Count Event, click the Edit Count Event button. This opens another
Advanced Event Editor window that allows you to specify the event to count. It
is impossible to create nested count statements, so the count() button is disabled in
this new window. Once you have selected the Count Event, use the six operator
buttons to select the Count Operation. Finally, either type or use the keypad to
enter a number in the count field. The expression that will be entered into your event
is displayed at the top of this window so that you can tell exactly what will be
inserted. To accept this string, click the OK button and the string will be inserted
into the event field.
Note
When using hardware counters to control trace collection, the counter
may count each cycle, rather than each instruction, when the count
expression evaluates to true. This may inflate the count. Please refer to
the manual for your trace hardware.
Note
For ETM trace, if you are counting accesses to or execution of a single
address with a count, the count is exact. It counts the number of times
the address was accessed or executed. If you are counting accesses to or
execution within an address range or a symbol, the count is sticky. It
counts the number of cycles between access or execution of an address
in the range and access or execution of an address outside the range. For
practical purposes, this means that using a count with an address range
is unlikely to yield the desired results.
To create a state expression, select the State Machine to insert. Then select whether
you want the event to be active when you are in a given state or when you are not
in a given state by selecting == or !=. Finally, select the desired state from the
States list. The State Expression Generator displays the string that will be inserted
into the event field in the State Condition field.
Advanced Debugging in
Specific Environments
Chapter 21
Run-Mode Debugging
Contents
Establishing Run-Mode Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
Loading a Run-Mode Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
The Task Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
Working with AddressSpaces and Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522
Working with Task Groups in the Task Manager . . . . . . . . . . . . . . . . . . . . . . . 525
Working with Run-Mode Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528
Task Manager GUI Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533
Task Group Configuration File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541
OS-Awareness in Run Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543
Profiling All Tasks in Your System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
Chapter 21. Run-Mode Debugging
When you debug a multitasking application, MULTI interacts with the target's
operating system in run mode, in freeze mode, or in both run and freeze mode
simultaneously. In run mode, the operating system kernel continues to run as you
halt and examine individual tasks. In freeze mode, the entire target system stops
when you examine tasks. For information about freeze-mode debugging, see
Chapter 22, “Freeze-Mode Debugging and OS-Awareness” on page 547. For
information about debugging in run mode and freeze mode, see “Automatically
Establishing Run-Mode Connections” on page 69.
Note
In this chapter, task is used as a general term to describe the real-time
operating system's unit of execution. Specific terminology varies
according to the target's operating system (for example, a task may also
be called a process or a thread).
After you have connected to your target, the connection appears in the target list.
It's usually denoted by an entry labeled Run mode target. For information about
the way in which run-mode AddressSpaces and tasks appear in the target list, see
“Debugging Target List Items” on page 16.
Note
If you want to simultaneously debug multiple targets in run mode, use
one instance of MULTI to establish all of the corresponding run-mode
connections. Distinct targets and applications are accessible for debugging
via the Debugger's target list (see “The Target List” on page 15). If you
launch multiple instances of MULTI (for example, by double-clicking
the MULTI shortcut twice or by launching MULTI from the command
line twice), the result of operations between MULTI IDE tools is
undefined.
The exact requirements for loading a module depend on your target operating system.
Loading a module onto an INTEGRITY system requires interaction with the
INTEGRITY loader, which typically runs in the LoaderTask and (for INTEGRITY
version 10 and later) the MULTILoadAgent task in KernelSpace. If one or both of
these tasks are halted, either individually or as part of a Halt System operation, you
will not be able to load modules. For more information, see “Dynamic Downloading”
in the INTEGRITY Development Guide. For general information about debugging
dynamically downloaded INTEGRITY applications, see “Run-Mode Debugging”
in the INTEGRITY Development Guide and “Troubleshooting” in the INTEGRITY
Development Guide.
Note
Depending on your configuration, MULTI may attempt to restore
breakpoints saved from previous debugging sessions when you download
a program. (See the description of the rememberBreakpoints option in
“Session Configuration Options” in Chapter 8, “Configuration Options”
in the MULTI: Managing Projects and Configuring the IDE book.)
Each tab of the Task Manager corresponds to a task group (see “Working with Task
Groups in the Task Manager” on page 525).
Under the All tab, the Task Manager generally shows the same tasks and address
spaces that are shown in the target list for a run mode connection.
Or under:
Note
If you are using INTEGRITY version 10 or later, and the
MULTILoadAgent task is halted, you will not be able to obtain
information about currently loaded INTEGRITY applications on the
target outside of the boot image in the target list.
If you select a run-mode AddressSpace in the target list and you are using
INTEGRITY version 10 or later, the AddressSpace's source code appears in the
source pane. In general, the following operations are available:
• Source browsing
• Breakpoint manipulation (All breakpoints set here are any-task breakpoints.
For more information, see “Any-Task Breakpoints” on page 528.)
If you are not using INTEGRITY version 10 or later, and you select a run-mode
AddressSpace in the target list, the source pane is empty and the preceding operations
are unavailable.
Attaching to Tasks
Attaching to a task allows MULTI to obtain debugging access to that task. When
you attach to a task, MULTI automatically displays the task in a Debugger window.
Some operating systems require that you attach to a task before halting, killing, or
running it, while other operating systems allow you to perform these actions on
unattached tasks.
Note
Most debugging operations are only available if the Debugger has access
to the executable file of the AddressSpace containing the task. If the
Debugger is not able to locate this file, it prompts you for the filename.
If you do not specify a file, the Debugger attaches to the task without an
executable. In this case, you are only able to perform basic debugging
operations that do not require an executable or debugging information,
such as halting and resuming the task and reading and writing registers
and memory. High-level source code is not available, so the Debugger
displays raw disassembly of target memory (see “Source Pane Display
Modes” on page 24). Call stacks cannot be viewed in this mode.
Note
When you have attached to a task that is listed as Halted in the target
list's Status column, you should avoid using programmatic means (for
example, INTEGRITY's RunTask() kernel call) to cause that task to
run. MULTI is not guaranteed to detect such target-initiated status
changes. To work around this problem, issue the detach command to
detach from the task, preferably before the target causes it to run. For
information about the detach command, see Chapter 2, “General
Debugger Command Reference” in the MULTI: Debugging Command
Reference book.
Note
The Halt on Attach option is not available when MULTI is in passive
mode (see “Debugging in Passive Mode” on page 636).
If you open a new Debugger window to debug each new task (see “Opening Multiple
Debugger Windows” on page 14), MULTI color-codes each task according to its
corresponding Debugger window. Any window that relates to debugging a particular
task is shaded in the same color as the task is shaded in the Task Manager. For
example, suppose you attach to a task that is shaded blue in the Task Manager. The
Debugger window that shows the task's code is also shaded blue. If you use a Browse
window to look at the functions of the task, the Browse window is also shaded blue.
Once a task is open in a Debugger window, you can halt or run the task from the
Debugger window itself or from the Task Manager. If a breakpoint is hit in a task
other than the one currently selected in the target list, the Debugger switches to that
task by default (provided that no other Debugger window is open on it and that the
currently selected task is not halted). For information about the configuration option
that allows you to control this behavior, see targetWindowSwitchViewOnBpHit
in “Other Debugger Configuration Options” in Chapter 8, “Configuration Options”
in the MULTI: Managing Projects and Configuring the IDE book.
Tip
To change the rate at which MULTI refreshes the tasks in an unfrozen
Task Manager:
Note
The Task Manager must be open in order to guarantee the availability of
all task group features.
A task group can contain any task in the system, including tasks running on different
processors or in different address spaces. As you create task groups, they are
displayed as new tabs in the Task Manager. The name of the task group must consist
of one or more characters and cannot contain square brackets ([ and ]). In addition,
you cannot name a task group with one of the default task group names created by
MULTI (see next section).
To quickly create a task group that contains the appropriate tasks, select the tasks
in the Task Manager and click .
You can attach to, halt, kill, and run all the tasks in a task group with a single action.
The Group menu contains several options that act on all of the tasks in the current
task group.
MULTI supports task groups whether or not the underlying debug server and debug
agent on the target support task groups. The ability of the underlying debug server
and target debug agent to support task groups affects the latency of synchronous
operations. For more information, see “Legacy Method of Group Execution and
Control” on page 530.
• All — Contains all tasks that the operating system is using to run the application.
There are some internal RTOS tasks, however, that the operating system may
not include in the All group.
• System — Contains all tasks running on the target system, including the internal
RTOS tasks that the operating system excludes from the All group. For some
operating system/debug server combinations, the set of tasks contained in the
System group is identical to the set of tasks contained in the All group.
In general, task group names are case-sensitive, but MULTI treats the two default
groups as being case-insensitive. As a result, you cannot create a group named All
or System, no matter what the case combination. The All group has a tab in the
Task Manager, but the System group does not.
You cannot add tasks into or delete tasks from the All or System default groups.
Tip
When both the operating system and the debug server support task groups
and distinguish between the System and All default groups, halting the
group System freezes the target board and all application tasks. In this
environment, you can execute operations such as reliably dumping the
event log section, browsing kernel objects with the OSA Explorer, etc.
To halt the System task group, select Group → Halt System, or issue
the groupaction -h @system command (see Chapter 18, “Task Group
Command Reference” in MULTI: Debugging Command Reference).
MULTI reserves the following task group names. They are not shown as tabs in
the Task Manager, but you should not use them for groups you create:
• Current Task – A label used to represent the special task group containing
only the corresponding task in the Software Breakpoint Editor (see “Creating
and Editing Software Breakpoints” on page 131).
• Group N/A – A label used to indicate that task group is not available in the
Software Breakpoint Editor (see “Creating and Editing Software Breakpoints”
on page 131).
• __multi_tmp_op_grp_* – A temporary group name created by MULTI to
perform synchronous operations on the selected task if the underlying debug
server supports task groups. Whenever MULTI sends the synchronous operation
to the underlying debug server, the temporary group is automatically destroyed.
For more information, see “Legacy Method of Group Execution and Control”
on page 530.
• __multi_tmp_bp_grp_* – A temporary group name created by MULTI to set
a group breakpoint on one task. The group only contains the corresponding
task. When the corresponding group breakpoint is deleted, the temporary group
is automatically destroyed.
• All AddressSpace names for INTEGRITY — On INTEGRITY versions 5
and later, AddressSpace names can be used as groups when using group
breakpoints. However, on INTEGRITY version 5 only, AddressSpace names
cannot be used as groups when using the groupaction command. (For
information about the groupaction command, see Chapter 18, “Task Group
Command Reference” in the MULTI: Debugging Command Reference book.)
You cannot add tasks into or delete tasks from any AddressSpace group via
the Task Manager.
Any-Task Breakpoints
An any-task breakpoint is a breakpoint that every task in the AddressSpace can hit
(except system tasks, which cannot be debugged in run mode). An any-task
breakpoint is indicated by a breakpoint icon with the letters AT inside of it ( ).
You can set an any-task breakpoint in a run-mode AddressSpace (if the target RTOS
is supported) or in a task: select the AddressSpace or task in the target list and then
click a breakdot in the Debugger window.
If you are setting the any-task breakpoint from a task, and you disabled the
configuration option clickToSetAnyTaskBp, you must hold the Shift key as you
click the breakdot. For information about clickToSetAnyTaskBp, see “Other
Debugger Configuration Options” in Chapter 8, “Configuration Options” in MULTI:
Managing Projects and Configuring the IDE.
To set an any-task breakpoint from the command pane, use the sb at command.
For example:
sb at function#5
sets an any-task breakpoint at line 5 of the function function. For more information
about the sb command, see Chapter 3, “Breakpoint Command Reference” in the
MULTI: Debugging Command Reference book.
When a task hits an any-task breakpoint, all other running tasks continue to execute.
Task-Specific Breakpoints
A task-specific breakpoint is a breakpoint that only a single task can hit. To set a
task-specific breakpoint, perform the following steps:
Group Breakpoints
A group breakpoint is a breakpoint set on a group of tasks such that any task in the
group can hit the breakpoint. When a task hits the breakpoint, the task, the whole
group, or another group of tasks stops. In addition to saving time, applying a halt
operation to an entire task group allows you to perform synchronous halts on multiple
tasks (see “Legacy Method of Group Execution and Control” on page 530). A group
breakpoint is indicated by a breakpoint icon with the letters GT inside it ( ).
You can set a group breakpoint via the Software Breakpoint Editor (see “Creating
and Editing Software Breakpoints” on page 131) or via the b command. For
information about the b command, see Chapter 3, “Breakpoint Command Reference”
in the MULTI: Debugging Command Reference book.
Group breakpoints are not available in all environments. If you cannot set a group
breakpoint but want to make use of a similar behavior, you can use the b command
to set one or more individual breakpoints that invoke the groupaction command.
The groupaction command allows you to halt all tasks belonging to the specified
task group(s). For an example, see “Setting Breakpoints for Task Groups”
on page 531. For more information about the b command, see Chapter 3, “Breakpoint
Command Reference” in the MULTI: Debugging Command Reference book. For
more information about the groupaction command, see Chapter 18, “Task Group
Command Reference” in the MULTI: Debugging Command Reference book.
Note
The Debugger may not be able to restore saved group breakpoints.
Note
The following method for manually executing group-based operations
is deprecated.
Group-based operations run and/or halt a group of tasks. Whether the operations
are synchronous depends on your debugging environment. If the debug server and
the corresponding RTOS debug agent support task groups (as is the case with
INTEGRITY), synchronous operations are supported. If the debug server and the
corresponding RTOS debug agent do not support task groups, MULTI sends a
separate command to each task. In this case, the latency time for the operations on
different tasks is unpredictable (depending on various factors such as network traffic,
the RTOS debug agent's status, the target's speed, etc.), but it may be milliseconds
to hundreds of milliseconds long.
Manipulating a group may change its status. For example, if you are using a debug
server that does not support tasks from different CPUs in the same group, and you
try to add tasks from different CPUs into an existing fine group, the group's status
becomes not fine.
When performing operations on multiple tasks selected in the Task Manager, MULTI
attempts to take advantage of task group support in the debug server and in the
corresponding RTOS debug agent. For example, when you halt selected tasks,
MULTI attempts to create a temporary task group for the selected tasks. If such a
fine group can be created on the debug server, MULTI sends one command to the
debug server for the entire group, thus guaranteeing synchronization accuracy by
the debug server and the RTOS debug agent. When performing operations on
multiple tasks selected in the target list, however, MULTI does not attempt to
construct a group. Instead, MULTI sends separate commands for each task selected,
performing run control operations one at a time.
Task groups are very powerful when setting breakpoints. By using task groups, you
can:
• Set a group breakpoint such that any task in the group can hit the breakpoint.
When any task that belongs to the Tasks in App1 task group hits the breakpoint,
that task is stopped.
• Stop an entire task group when a group breakpoint is hit.
For example, suppose you want to halt all tasks in the Callers task group
whenever a task in the Tasks in App1 task group hits a breakpoint. You would
enter:
b /type_gt @"Tasks in App1" /trigger @"Callers" 0x1423
When any task that belongs to the Tasks in App1 task group hits the breakpoint,
that task, along with all tasks in the Callers task group, is stopped. (The
/trigger @task_group argument simultaneously stops multiple tasks when
a breakpoint is hit.)
If you want to create a group breakpoint only on the current task to stop all
tasks in another group, it is not necessary for you to explicitly create a task
group only containing the current task. MULTI does so automatically, and
For example, suppose you want to halt all tasks in the Callers task group
whenever the current task hits a breakpoint. You would enter:
b /type_gt /trigger @"Callers" 0x1423
The groupaction command also supports running tasks (-r) and, for some
operating systems, stepping tasks (-s). For more information about this
command, see Chapter 18, “Task Group Command Reference” in the MULTI:
Debugging Command Reference book.
As long as the target operating system supports task groups, these actions are
performed on individual tasks synchronously. If an operating system does not
support task groups, MULTI sends out separate commands to each task in the
task group. In this case, the latency time for the operations on different tasks
is unpredictable, depending on various factors such as network traffic, the
RTOS debug agent's status, and the target's speed.
Note
When synchronous group operations are specified in a breakpoint
command list (as in the preceding example), the amount of time that
elapses between hitting the breakpoint and executing the synchronous
group operations is not predictable.
Note
If a debugging environment does not support a certain option, that option
is not displayed in the Task Manager.
Menu Bar
The Task Manager contains the following menus:
Options Menu
The Task Manager Options menu contains the following menu items.
Note
MULTI remembers the settings of the toggle menu items across debugging
sessions.
Item Meaning
Stop on Task Specifies whether you want the target's operating system to halt each
Creation task as soon as it is created by the application.
Item Meaning
Attach on Task Specifies whether you want to debug the newly created task. If enabled,
Creation each newly created task is halted and opened in the Debugger window.
This option is applicable only when the Stop on Task Creation menu
item is selected.
Halt on Attach Specifies whether you want MULTI to automatically halt tasks when
you attach to them. You cannot use this option when MULTI is in passive
mode (see “Debugging in Passive Mode” on page 636).
Run on Detach Specifies whether you want MULTI to automatically run tasks when
you detach from them. You cannot use this option when MULTI is in
passive mode (see “Debugging in Passive Mode” on page 636).
Print Prints the tasks currently listed in the Task Manager.
Close Closes the Task Manager.
View Menu
The Task Manager View menu contains the following menu items.
Item Meaning
Expand Selected Recursively expands all selected entries in the task list hierarchy.
Entries
Expand All Entries Recursively expands all entries in the task list hierarchy.
Collapse Selected Collapses all selected entries in the task list hierarchy.
Entries
Collapse All Entries Collapses all entries in the task list hierarchy.
Freeze Task List Freezes or unfreezes the task list display. For more information, see
“Freezing the Task Manager's Task List Display” on page 525.
Flat View Changes how tasks are displayed. When Flat View is selected, the tasks
are combined together in a single list, regardless of whether they belong
to the same processor or high-level RTOS object. When Flat View is
cleared, tasks are organized according to processor or high-level object.
For more information, see “Task List Pane” on page 537.
Visualize Fine Toggles the display of an asterisk (*) on Task Manager tabs that
Groups correspond to fine task groups. For more information, see “Legacy
Method of Group Execution and Control” on page 530.
Show AddressSpace Toggles the display of Address Space IDs in the second column of the
IDs Task Manager.
Item Meaning
OSA Explorer Opens the OSA Explorer for the RTOS running on the target. For more
information, see “The OSA Explorer” on page 543.
This menu item is only available for some RTOSes.
Group Breakpoints Opens the Breakpoints window for group breakpoints set on the current
connection. For reference information about the Breakpoints window,
see “The Breakpoints Window” on page 147.
Group Menu
The Task Manager Group menu contains the following menu items.
Item Meaning
Create New Group Creates a new task group.
Delete Existing Deletes an existing task group.
Group
Add Selected Tasks Adds the selected tasks in the current task group into another task group.
into Another Group
Delete Selected Removes the selected tasks from the current task group. You cannot
Tasks delete tasks from the default task group All.
Continue Selected Resumes the selected tasks in the current task group.
Tasks
Halt Selected Tasks Halts the selected tasks in the current task group.
Single Step (into Single-steps the selected tasks in the current task group, stepping into
function) Selected functions.
Tasks
Single Step (over Single-steps the selected tasks in the current task group, stepping over
function) Selected functions.
Tasks
Kill Selected Tasks Kills the selected tasks in the current task group.
Attach to Selected Attaches to the selected tasks in the current task group.
Tasks
Detach from Detaches from the selected tasks in the current task group.
Selected Tasks
Continue Tasks in Resumes all tasks in the current task group.
Current Group
Item Meaning
Halt Tasks in Halts all tasks in the current task group.
Current Group
Kill Tasks in Kills all tasks in the current task group.
Current Group
Attach to Tasks in Attaches to all tasks in the current task group.
Current Group
Detach from Tasks Detaches from all tasks in the current task group.
in Current Group
Halt System Halts all tasks on the target system, thereby freezing the target. This
option is not supported on all operating systems.
Run System Restores the tasks on the target to the status they held before the system
was halted.
For commands corresponding to these menu items, see Chapter 18, “Task Group
Command Reference” in MULTI: Debugging Command Reference. For more
information about task groups, see “Working with Task Groups in the Task Manager”
on page 525.
Toolbar
The Task Manager toolbar contains the following buttons.
Button Meaning
Single-steps the selected tasks in the current task group, stepping into
functions.
Single-steps the selected tasks in the current task group, stepping over
functions.
Resumes the selected tasks in the current task group.
Button Meaning
Adds the selected tasks in the current task group into another task group.
Removes the selected tasks from the current task group. You cannot
delete tasks from the default task group All.
Freezes or unfreezes the display of the Task Manager window. When
the display is frozen (the button is down), a message appears in the
status bar at the bottom of the window. For more information, see
“Freezing the Task Manager's Task List Display” on page 525.
Disconnects from the target.
By default, tasks are listed in a hierarchical structure. The leaf nodes in the
hierarchies are the tasks; the non-leaf nodes represent more general concepts in the
corresponding RTOS (for example, CPUs and AddressSpaces on INTEGRITY).
Non-leaf nodes cannot be sorted. To flatten the hierarchy and list all tasks in one
list, choose View → Flat View. (This menu item is not available for customized
task groups.)
Non-leaf nodes are color-coded according to MULTI's color settings. They are
displayed as follows:
• First-level nodes (from the top of the hierarchy) are displayed in the color
specified for strings.
• Second-level nodes are displayed in the color specified for characters.
• Third-level nodes are displayed in the color specified for integers.
Debugging-related statuses in the Status column are colored so that you can easily
identify them. RTOS statuses are not colored. Many of the statuses that appear in
the Task Manager also appear in the Debugger target list. For more information,
see “The Status Column” on page 20.
Each time the Task Manager is opened, MULTI automatically displays tasks with
the hierarchies expanded. After that, you control how the hierarchies are displayed.
Whenever the Task Manager window is refreshed, MULTI automatically resizes
the columns so that all text is visible. However, once you manually change a
column's width, MULTI no longer resizes the columns when it refreshes the display.
MULTI maintains changes that you make to the Task Manager window (such as
modifications to its position) across debugging sessions.
Information Pane
The area below the task list pane is the information pane, in which the MULTI
command pane, target pane, I/O pane, serial terminal pane, Python pane, or traffic
pane can be displayed.
By default, the MULTI command pane is shown in the information pane area, but
you can switch to another pane by clicking the corresponding tab at the bottom of
the Task Manager window.
Tab Meaning
Cmd or Cmd* Shows the MULTI command pane in the information pane area. The
MULTI command pane located in the Task Manager supports a subset
of the commands that the command pane located in the Debugger does.
If you issue a command in the Task Manager, and the output reports
that it does not work in the current context, run it from the Debugger
instead.
Trg or Trg* Shows the target pane in the information pane area.
I/O or I/O* Shows the I/O pane in the information pane area.
Srl or Srl* Shows the serial terminal pane in the information pane area.
Py or Py* Shows the Python pane in the information pane area.
Tfc or Tfc* Shows the traffic pane in the information pane area.
As in the MULTI Debugger window, an asterisk (*) at the end of a tab name
indicates that new messages have arrived in the corresponding pane.
You can change the height of the information pane by dragging the bar that separates
it from the task list pane. To automatically resize the panes so that they share the
vertical window space evenly, double-click the separator bar.
Item Meaning
Stop on Task Specifies whether you want the target's operating system to halt each
Creation task as soon as it is created by the application.
Debug on Task Specifies whether you want to debug newly created tasks. If selected,
Creation each newly created task is halted and displayed in a Debugger window.
This option is applicable only when Stop on Task Creation is also
selected.
Halt on Attach Specifies whether you want MULTI to automatically halt tasks when
you attach to them. You cannot use this option when MULTI is in
passive mode (see “Debugging in Passive Mode” on page 636).
Item Meaning
Run on Detach Specifies whether you want MULTI to automatically run tasks when
you detach from them. You cannot use this option when MULTI is in
passive mode (see “Debugging in Passive Mode” on page 636).
Freeze Task List Freezes or unfreezes the task list display. For more information, see
“Freezing the Task Manager's Task List Display” on page 525.
Flat View Changes how tasks are displayed. When Flat View is selected, the tasks
are combined together in a single list, regardless of whether they belong
to the same processor or high-level RTOS object. When Flat View is
cleared, tasks are organized according to processor or high-level object.
This menu item is not available for customized task groups.
For more information, see “Task List Pane” on page 537.
Expand Selected Expands the entire sub-tree for all selected entries. This has no effect
Entries on the task entries because they have no sub-trees.
Attach to Selected Attaches to the selected tasks. This has no effect on non-task entries.
Tasks
Detach from Detaches from the selected tasks.
Selected Tasks
Halt Selected Tasks Halts the selected tasks.
Continue Selected Resumes the selected tasks.
Tasks
Step Selected Tasks Single-steps the selected tasks.
Detach from Tasks Detaches from all attached tasks in the current task group.
in Current Group
Halt Tasks in Halts all tasks in the current task group.
Current Group
Continue Tasks in Resumes all tasks in the current task group.
Current Group
Step Tasks in Single-steps through all tasks in the current task group.
Current Group
Halt System Halts all tasks on the target system, thereby freezing the target. This
option is not supported on all operating systems.
This option corresponds to the groupaction -h @system command
(see Chapter 18, “Task Group Command Reference” in the MULTI:
Debugging Command Reference book).
Item Meaning
Run System Restores the tasks on the target to the status they held before the system
was halted.
This option corresponds to the groupaction -r @system command (see
Chapter 18, “Task Group Command Reference” in the MULTI:
Debugging Command Reference book).
Add Selected Tasks Adds the selected tasks into another task group.
into Group
Delete Selected Removes the selected tasks from the current task group.
Tasks from Group
Show AddressSpace Displays Address Space IDs in the second column of the Task Manager.
IDs
Other entries Displays or hides the corresponding column.
Note
In the shortcut menu, the word Task is replaced with the corresponding
terminology used by the underlying RTOS (such as Process or Thread).
-tv mytaskview.tvc
If no file extension is given in the task view configuration filename, .tvc is appended
to the filename. If no configuration file is specified from the command line,
taskview.tvc from your local configuration directory is used.
For each group, MULTI keeps a task fingerprint for each task in the group. Whenever
the group is to be displayed (when you select the corresponding tab in the Task
Manager), MULTI uses this task fingerprint to determine which tasks to display.
Considering different debugging environments, MULTI provides the following
three criteria to match a task against a task fingerprint.
Note
The configuration file contains the information about group definitions
and synchronous operations on tasks.
For more information about the OSA Explorer, see Chapter 22, “Freeze-Mode
Debugging and OS-Awareness” on page 547 and “Object Structure Aware
Debugging” in the INTEGRITY Development Guide.
Note
The OSA Object Viewer is only available if you are debugging a
run-mode connection and using INTEGRITY version 10 or later.
• In the Debugger target list, select an object and click the OSA Viewer button
( ).
• In the Debugger command pane, enter the osaview command. For information
about the osaview command, see “Object Structure Awareness (OSA)
Commands” in Chapter 15, “Scripting Command Reference” in the MULTI:
Debugging Command Reference book.
• In the Debugger source pane, double-click an INTEGRITY object variable
while the task is halted.
The OSA Object Viewer opens on an object summary, a list of attributes (under
the Attributes tab), and a list of operations you can perform (under the Operations
tab). Objects that are underlined in the OSA Object Viewer are linked to more
detailed information. To view this information, click the underlined object. Similarly,
clicking an underlined operation performs the operation.
By default, the OSA Object Viewer window is reused. However, if you freeze the
window or click the Reuse button ( ) so that it no longer appears to be pushed
down, a new window appears the next time you open an OSA Object Viewer or the
next time you click a linked (that is, underlined) object in the OSA Object Viewer.
For more information about the OSA Viewer, see “Object Structure Aware
Debugging” in the INTEGRITY Development Guide.
To begin profiling all tasks in your system, perform the following steps:
1. In the Debugger's target list, select the run-mode connection to your target.
2. Open the Profile window by selecting View → Profile or by entering the
profile command. For information about the Profile window, see “Viewing
Profiling Data in the Profile Window” on page 373. For information about the
profile command, see Chapter 12, “Profiling Command Reference” in the
MULTI: Debugging Command Reference book.
3. Click Start in the Profile window.
• Right-click any column header in the target list, and select CPU %.
The resulting CPU % target list column displays the percentage of the CPU that
each task and AddressSpace is currently using. The AddressSpace CPU % is simply
the sum of the CPU percentages for all the tasks in that AddressSpace.
Tip
You can use the ServerPollinterval configuration option to control the
interval between updates to displayed data. For more information about
this option, see “The More Debugger Options Dialog” in Chapter 8,
“Configuration Options” in the MULTI: Managing Projects and
Configuring the IDE book.
To disable profiling:
Contents
Starting MULTI for Freeze-Mode Debugging and OS-Awareness . . . . . . . . . 549
The OSA Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551
Debugging in Freeze Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
Freeze-Mode and OSA Configuration File . . . . . . . . . . . . . . . . . . . . . . . . . . . . 588
Chapter 22. Freeze-Mode Debugging and OS-Awareness
When you debug a multitasking application, MULTI interacts with the target's
operating system in freeze mode, in run mode, or in both freeze and run mode
simultaneously. In freeze mode, the entire target system stops when a breakpoint
is hit or a task is halted. In run mode, the operating system kernel continues to run
as you halt and examine individual tasks. For information about run-mode debugging,
see Chapter 21, “Run-Mode Debugging” on page 517. For information about
debugging in run mode and freeze mode, see “Automatically Establishing Run-Mode
Connections” on page 69.
• Display an OSA Explorer showing operating system tasks and other objects
on the target (if any).
• Display an entry in the target list for each task, even if that task is suspended
or otherwise not running.
• Set task-specific breakpoints that will stop the running process only when the
chosen task is currently executing.
• Display call stacks and stack (local) variables for any task that can be debugged.
• Perform task-specific single-stepping.
• INTEGRITY
• velOSity
• u-velOSity
• ThreadX
If your operating system is not on the list, contact your Green Hills sales
representative.
Note
In this chapter, task is used as a general term to describe the target
operating system's unit of program execution. Specific terminology varies
according to the target's operating system (for example, a task may also
be called a thread). When the term process is used in this chapter, it
usually refers to the master process. For more information, see “Master
Debugger Mode” on page 556.
You can manually enable freeze-mode OS-aware debugging for another operating
system by specifying the location of an OSA integration package. To do so, start
MULTI with the following command line option:
-osa osa_name[#cfg=configuration_file][#lib=library_name][#log=log_file]
where:
and then looks for it in the MULTI IDE installation directory. If you do not
specify a configuration file, osa_name.osa is used by default.
• library_name is the library containing the OSA integration package (see
“The OSA Integration Module Name” on page 591). The library may be a DLL
file (Windows) or an SO shared library (Linux/Solaris). If you do not specify
You can place the integration module in any location, and use an absolute or
relative path to locate it from the Debugger's command line or from the
configuration file. If the integration module is specified with only a base name,
MULTI first searches for it in the MULTI IDE installation directory, and then
in a way defined by the host machine.
• log_file is the name of the file in which you want to log the interaction
between MULTI and the OSA integration package.
If you are debugging multiple programs and you want to use OS-aware debugging
features for some of the programs, but not for others, set the configuration option
RequestOsaPackage to On. With this option, you do not have to specify the -osa
option on the command line. Instead, MULTI prompts you for the OS-awareness
package name when you are debugging in freeze mode. MULTI resolves the name
of the configuration file and of the library as described above. See also “The More
Debugger Options Dialog” in Chapter 8, “Configuration Options” in the MULTI:
Managing Projects and Configuring the IDE book.
Tip
You can also use the osasetup command to specify an OSA integration
package. For information about this command, see “Object Structure
Awareness (OSA) Commands” in Chapter 15, “Scripting Command
Reference” in the MULTI: Debugging Command Reference book.
If the View → OSA Explorer menu item is dimmed out or the osaexplorer
command prints an error such as:
osaexplorer: not supported in the current environment
then MULTI does not recognize the target operating system as one for which MULTI
can perform freeze-mode OS-aware debugging. For more information, see “Starting
MULTI for Freeze-Mode Debugging and OS-Awareness” on page 549.
The following is an OSA Explorer showing a list of tasks in all AddressSpaces for
the INTEGRITY operating system.
Each type of object that can be explored is represented as a tab in the OSA Explorer.
If an object type has no reference object, the OSA Explorer contains one object
list pane to show the instances of this type of object. If an object type has a reference
object, two object list panes are displayed:
Whenever an object is selected in the master pane, the instances of the corresponding
reference object are shown in the reference pane.
Because the object shown in the master pane could have references to more than
one type of object, the drop-down list at the top of the reference pane indicates the
object type being shown in the reference pane. If you select an object type to be
shown in the reference pane, your change is persistent for the duration of the
debugging session.
For information about INTEGRITY objects available in the OSA Explorer, see
the INTEGRITY Development Guide.
• To sort a list based on a column's contents, click that column's header. The
sorting toggles between ascending and descending order.
• To move a column, drag that column's header left or right.
• To change the width of a column, drag the column boundary.
• To show or hide a column, right-click the pane to open a shortcut menu, and
select or clear the corresponding menu items.
Changes that you make to the OSA Explorer itself (such as its size and position)
and to each object are maintained across debugging sessions.
Task information is displayed in the (foreground) text color. Entries in the object
list pane have the same background color as the corresponding Debugger window
(only applicable if you have opened multiple Debugger windows).
The following table describes the menu items that may appear in the OSA Explorer
shortcut menu. The actual menu contents vary depending on the RTOS and object
type.
Menu Item Meaning
Column Name Toggles between showing or hiding the indicated column.
Freeze Object List Freezes or unfreezes the automatic refreshing of the OSA Explorer.
When the OSA Explorer is frozen, a message appears in the status bar
at the bottom of the window, and the contents of the window are
preserved. The window is not updated again until it is unfrozen.
To print the contents of the object list pane, select Options → Print.
If the currently executing task resides in the kernel address space, you can either
use Master Debugger mode or Task Debugger mode to view information specific
to the task. If you want to debug a task that is not currently executing or does not
reside in the kernel address space, you must use Task Debugger mode to view
task-specific information.
Note
The configuration option osaSwitchToUserTaskAutomatically controls
whether the Debugger automatically displays the currently executing
user-mode task when the target is stopped while executing user-mode
tasks. For more information about this configuration option, see “Other
Debugger Configuration Options” in Chapter 8, “Configuration Options”
in the MULTI: Managing Projects and Configuring the IDE book.
Note
The configuration option osaTaskAutoAttachLimit allows you to specify
the maximum number of OSA tasks loaded from trace data that are
automatically displayed in the target list (the default is 32). The
osaTaskAutoAttachLimit option does not limit the number of OSA
tasks that can be added to the target list by your request. For example,
the configured number may be exceeded if:
The status of the master process (displayed in the Status column) corresponds to
the status of a normal process or provides specific information about the mode in
which the CPU may be stopped. For example, the status may be Running, Stopped,
Stopped in Kernel Mode, or Stopped in User Mode. All operations, such as
memory access, register access, etc., are performed in the target's current status. If
the master process is selected in the target list while the target is stopped in user
mode (that is, in a non-kernel task), the PC pointer becomes gray.
When you reload or restart the program or detach from or kill the process, MULTI
removes all OSA task entries from the target list and closes the OSA Explorer and
any Debugger windows that you have opened on an OSA task.
To open a separate Debugger window on a task, double-click the task in the target
list. MULTI does not open multiple Debugger windows for the same task.
The following list describes behavior that is specific to Task Debugger mode:
• Call stacks, local variables, and register displays are specific to the task.
• The title bar displays the task ID (a number that uniquely identifies the task)
and the task name, if the OS maintains a name for that task (see “The Object
Attribute Definition” on page 593).
• When the RTOS's master process is halted, the target list's Status column
displays the status of tasks in the RTOS. When the RTOS's master process is
running, the Status column displays <OS Running>.
• Except for the and buttons, buttons related to execution (such as ,
, ) and their corresponding commands are only available when the master
process is halted and the task displayed is the currently executing task.
• Single-stepping and breakpoints behave in a manner that is more appropriate
to task-aware debugging. For more information, see “Task-Specific
Single-Stepping” on page 558 and “Working with Freeze-Mode Breakpoints”
on page 560.
• Some of the MULTI commands that affect the global debugging state are not
available in Task Debugger mode. If you try to run one of these commands,
MULTI displays the following error message:
This command cannot be run with an OSA Task selected.
Select the target list entry corresponding to the connection
or executable first.
Task-Specific Single-Stepping
When you single-step a process in Task Debugger mode, MULTI avoids stopping
the process when another task is running. This makes debugging shared code more
straightforward by allowing you to step through one task at a time.
This feature operates transparently, and no special action is required, aside from
performing all task-specific single-steps in Task Debugger mode. In Master
Debugger mode, single-stepping may occasionally step over context switches.
In this process, two tasks are running at the same priority without time slicing. Both
tasks loop, calling shared_func(). The first task, task_1, has task_1_entry()
as its entry point. The second task, task_2, has task_2_entry() as its entry
point. Within shared_func(), each task calls gh_task_yield(), a GH-API call
that allows other tasks at the same priority to run. In this case, task_1 yields to
task_2 and then task_2 yields to task_1. So in the steady state, one task is
always suspended within a call to gh_task_yield() while the other task is running.
At the moment the process is stopped, task_1 is the current task and is stopped on
line 337, where it is just about to call gh_task_yield(). If you now press the
button from within task_1's Debugger window, the following happens:
1. MULTI sets a temporary breakpoint on line 338 and resumes the process.
To set a task-specific breakpoint, select a task in the target list and hold the
Ctrl key as you click a breakdot in the Debugger window. See also the
configuration option clickToSetAnyTaskBp in “Other Debugger Configuration
Options” in Chapter 8, “Configuration Options” in MULTI: Managing Projects
and Configuring the IDE.
To set a task-specific breakpoint from the command pane, use the b /tt
command. For example:
b /tt myFunction#5
Breakpoint icon colors signal which task the breakpoint can be hit by. If the
icon is red, the breakpoint can only be hit by the task currently selected in the
target list (that is, the breakpoint was set on the current task). If the breakpoint
icon is gray, the breakpoint can only be hit by a task other than the one currently
selected in the target list (that is, the breakpoint was not set on the current task).
Task-specific breakpoints from kernel address space tasks are gray in the OSA
master process.
To set an any-task breakpoint, select a task in the target list and click a breakdot
in the Debugger window.
To set an any-task breakpoint from the command pane, use the sb at or b /at
command. For example:
sb at myFunction#5
and
b /at myFunction#5
These breakpoints are similar to any-task breakpoints set in OSA tasks, but
they are not the same. You cannot set an any-task breakpoint in the OSA master
process or on a core. The freeze-mode debug server has no knowledge of RTOS
concepts such as any-task breakpoints; it treats the program you are debugging
as a stand-alone program. MULTI uses the OSA package to simulate an RTOS
scenario (RTOS concepts are only available to MULTI). MULTI translates the
semantics of RTOS operations into the normal operations supported by the
debug server.
Note
The icon is overloaded on multi-core targets for which synchronous
debugging and OSA support is enabled. It represents an any-task
breakpoint in an OSA task, and an any-core breakpoint on a core.
Any-core breakpoints can be hit by any core in the system.
Note
Only one breakpoint can be set at a particular address. For example, if a
task-specific breakpoint is set at the location shared_func#2(), the
breakpoint must be removed before another breakpoint (of any type) can
be set at the same address. If you do not remove the breakpoint, MULTI
does so for you. On INTEGRITY, this limitation applies to each
AddressSpace (that is, multiple breakpoints can be set at the same address
as long as each breakpoint is set in a different AddressSpace).
For information about breakpoints set in OSA tasks or the OSA master process
while TimeMachine is enabled, see “OSA Breakpoints in TimeMachine” on page 426.
Program I/O
In a freeze-mode environment, program I/O is usually redirected to the MULTI
Debugger and immediately displayed in its I/O and Cmd panes. Operating systems
such as INTEGRITY, however, capture and independently handle program I/O. In
this case, I/O may not be immediately visible.
When you single-step on a task in freeze mode, you cannot immediately see the
output of I/O functions because the kernel is halted. The output is displayed in the
console only after you resume the target and the kernel has a chance to flush out
queued console operations.
Multi-Core Debugging
A multi-core target contains multiple cores that can each run code independently.
This section describes techniques and limitations specific to debugging multi-core
targets, including:
• How trace and TimeMachine function on a multi-core target (see “Using Trace
Tools on a Multi-Core Target” on page 579)
Notes on Terminology
In this chapter, we use the term SMP to mean a single executable running on multiple
homogeneous cores of a multi-core hardware target.
For simplicity, we use the term core to refer to a hardware resource that executes
instructions for a given context. Your hardware documentation may use a different
term, such as CPU or hardware thread.
If you are using Green Hills Probe firmware version 5.2 or later, the
debug-server-specific option you should pass is -synccores.
For information about the connect command, see “connect” in Chapter 17, “Target
Connection Command Reference” in MULTI: Debugging Command Reference.
For information about how synchronous debugging affects the running and halting
of your system, see “Synchronous Debugging on a Multi-Core Target” on page 577.
• INTEGRITY will run on all cores of your target — No action is necessary; the
Debugger handles this environment automatically.
• One executable will run on multiple cores of your target, and you will not use
INTEGRITY — Build the executable with -ghsmc_core_count=range to
specify the number of cores the executable can run on. SMP debugging features
become available if the number of cores on the target hardware is within the
specified range.
In these simple cases, choosing to download the executable to the target causes the
Debugger to run the target setup script (if any) and load the executable on the first
core of your multi-core target. Whether you download the executable or verify that
it is already present on the target (see “Preparing Your Target” on page 110), symbol
information is associated with all cores.
For more complex cases than those described above, do one of the following:
• If your target has more cores than you specified with -ghsmc_core_count=,
and you want to use SMP debugging features, pass the debug server option
-force_coreid to the connect command when establishing your freeze-mode
connection. This option allows you to limit Debugger actions to only those
cores that are to be used by your executable. Note that -force_coreid is not
supported with all debug servers. For more information about -force_coreid,
see the documentation about options for custom connection methods in the
Green Hills Debug Probes User's Guide. For more information about the
connect command, see “connect” in Chapter 17, “Target Connection Command
Reference” in MULTI: Debugging Command Reference.
• Create a .ghsmc configuration file, described next.
The system for which the following configuration file was written contains a piece
of code that is shared among different applications. Additionally, the system has
been configured such that the Debugger is responsible for loading the different
applications independently (in contrast to the previous example in which code for
the secondary cores was built into the primary executable).
The configuration file tells the MULTI Debugger to download core-0-specific code
to core 0, but also to download to core 0 code that is shared across all cores. Because
the shared code is downloaded to core 0 into memory banks shared by all cores,
only code that is specific to core 1 needs to be downloaded to that core. Core 1
references the symbols of the shared code, which are visible when you look at core
1 in the Debugger.
version = 1
title = "Shared Code System"
core {
0 {
download = {"core0_code", "shared_code"}
}
1 {
download = {"core1_code"}
symbol = {"shared_code"}
}
}
If your build configurations build into unique output directories (as is recommended),
use one or both of these variables in place of executables in the download and
symbol fields of the multi-core configuration file. Precede the variables with a $
sign, and use curly braces as delimiters if the variable cannot otherwise be
distinguished from what precedes or follows it. For example:
version = 1
title = "My Application"
core {
1 {
download = {"$_GHSMC_PROGRAM"}
}
"2-4" {
symbol = {"$_GHSMC_PROGRAM"}
}
}
After creating your portable multi-core configuration file, you must follow the
instructions in “Associating a Multi-Core Configuration File with an Executable”
on page 575. If you do not, the use of _GHSMC_PROGRAM and _GHSMC_PROGRAM_DIR
is not supported.
To load a multi-core configuration file containing these variables, open the Project
Manager or the Debugger on the executable. Do not attempt to operate on the
configuration file directly. This means that you cannot:
• Pass the name of the multi-core configuration file as an argument to the debug
command or the new command.
• Follow the instructions in “Starting the Debugger on a Multi-Core Configuration
File” on page 574.
If you do operate on the configuration file directly, MULTI will not be able to
resolve _GHSMC_PROGRAM or _GHSMC_PROGRAM_DIR.
version = 1
title = "$_GHSMC_BASENAME for My Target"
core {
0 {
download = {"${_GHSMC_BASENAME}.out"}
}
"1-3" {
symbol = {"${_GHSMC_BASENAME}.out"}
}
}
To create a multi-core configuration file for an executable myapp2.out that has the
same setup requirements, you need only copy myapp.ghsmc to myapp2.ghsmc in
the same directory as myapp2.out. For example:
cp ./myapp.ghsmc ../myapp2_dir/myapp2.ghsmc
Given the following example multi-core configuration file, in which the core_ID
specifies a range, _GHSMC_CORE_ID resolves to 1 for the core with core_ID 1, to
2 for the core with core_ID 2, and to 3 for the core with core_ID 3:
version = 1
title = "My Application"
core {
"1-3" {
download = {"a${_GHSMC_CORE_ID}.out"}
}
4 {
symbol = {"b.out"}
}
}
When the above multi-core configuration file is loaded in the Debugger, a1.out is
downloaded to core 1, a2.out is downloaded to core 2, and a3.out is downloaded
to core 3.
across different targets, as long as the applications have the same setup, automation,
or testing requirements.
Consider the following example. The first multi-core configuration file, titled My
Application on My Simulated Target creates the alias core.0 for the core
with core_ID 0:
version = 1
title = "My Application on My Simulated Target"
core {
0 {
alias = "core.0"
download = {"my_program"}
}
"1-3" {
symbol = {"my_symbols"}
}
}
The second multi-core configuration file is the same as the first except for the title
(here My Application on My Hardware Target) and the specified core_IDs.
This configuration file creates the alias core.0 for the core with core_ID 4:
version = 1
title = "My Application on My Hardware Target"
core {
4 {
alias = "core.0"
download = {"my_program"}
}
"5-7" {
symbol = {"my_symbols"}
}
}
Given these two multi-core configuration files, a single .rc script can set a breakpoint
on my_program whether it's loaded on My Simulated Target or My Hardware
Target. The script can simply route the breakpoint command to the core with alias
core.0. For example:
For more information, see “components” in Chapter 8, “Display and Print Command
Reference” in MULTI: Debugging Command Reference, and see “route” in
Chapter 15, “Scripting Command Reference” in MULTI: Debugging Command
Reference.
For examples that demonstrate the use of pre-defined variables in the alias field,
see “Creating Flexible Multi-Core Configuration Files” on page 571.
If you save a multi-core configuration file with a change to a core's alias, the
applicable Debugger window is updated to reflect the change.
If the Debugger is already open, select File → Debug Program, and browse to a
.ghsmc file.
The Debugger generally treats executables on different cores as a unit. For more
information, see “Collective Treatment of Executables Specified in a Multi-Core
Configuration File” on page 575.
Note
Multi-core configuration files that include _GHSMC_PROGRAM or
_GHSMC_PROGRAM_DIR should not be accessed in the manner described
in this section. For more information, see “Creating a Portable Multi-Core
Configuration File for Use with Different Build Configurations”
on page 568.
1. Ensure that the multi-core configuration file has a .ghsmc file extension.
2. Specify the following option in the executable's project file:
-ghsmc_file=path_to_multicore_configuration_file
The Debugger stores the path of the multi-core configuration file in the executable's
symbol file. When attempting to locate the multi-core configuration file, the
Debugger first checks the path stored in the symbol file. A relative path is resolved
against the directory where the executable is located (for example, bin/ or
bin/debug/). If the multi-core configuration file does not exist at the specified
location, the Debugger searches for its base name in the directory where the
executable is located.
• change_binding
• connect
• prepare_target
• k
• quit entry
• debug
• new
• detach
Download hooks added using the -board argument to addhook will be run only
once each time you load a multi-core application onto your board. This is true even
if you are using a multi-core configuration file (*.ghsmc) that specifies multiple
executables to be downloaded. The -before download -board hook will be run
before any of the executables are downloaded, and the -after download -board
hook will be run after all of the executables are downloaded.
For more information, see “Hook Commands” in Chapter 15, “Scripting Command
Reference” in MULTI: Debugging Command Reference.
For example, if one core hits a breakpoint, all cores in the system are halted. Halting
all cores means that you can debug one core without worrying that operations
running on another core will affect shared memory.
When synchronous debugging is enabled, a synchronous halt will result from any
of the following:
The status of the core that was halted by the user, that hit the breakpoint, etc. is
listed in the Debugger as Stopped. Other cores on the multi-core target are listed
as Paused to indicate that they were not the cause of the system halt.
How quickly all cores in the system are halted (or run) together depends on the
capability of your hardware, but most new devices synchronize all cores within a
few instructions.
Though software breakpoints are set on all cores of your multi-core target by default,
you can optionally configure any of these breakpoints to apply only to a specific
core. To do so, specify the core's process ID, or _PID value, in the Condition field
of the Software Breakpoint Editor. For example, the following Condition specifies
that the breakpoint applies only to the core with process ID 2:
_PID==2
Entering $_PID in the Debugger command pane returns the process ID of the
selected core (see “System Variables” on page 323).
It is also possible to set core-specific hardware breakpoints, but only when you are
not using OSA.
• RtosStatus (on Core X) — The task was assigned to core X by the RTOS
scheduler, but the core was executing kernel code when the target halted.
• RtosStatus — The task was not assigned to any core when the target halted.
• Any-core hardware breakpoints are only permitted if the debug server supports
hardware breakpoints and if it limits them to supervisor (kernel) mode.
• When synchronous debugging is enabled on a multi-core target, you can only
single-step one OSA task at a time. If the target is halted by a breakpoint on
another task, the current single step is aborted.
For information about the limitations of debugging with run-mode and freeze-mode
connections to the same target, see “Automatically Establishing Run-Mode
Connections” on page 69.
When you trace a multi-core target, the trace controls for all of the cores are tied
together. However, MULTI demultiplexes the trace data and provides a separate
instance of each trace tool for each core. For example, you can open a separate
PathAnalyzer window for each core, but the Enable Trace ( ) and Retrieve Trace
( ) buttons in all the windows are tied together. Clicking the Enable Trace button
( ) in any of the windows enables trace collection from the target and causes the
Enable Trace button ( ) to toggle in the other windows as well.
By default, MULTI synchronizes selections in the trace tools across cores if the
trace data is timestamped. MULTI uses the timestamps to select instructions that
were executing at approximately the same time on all traced cores each time an
instruction is selected in a trace tool for any of the cores. If the trace data does not
When you use TimeMachine on a multi-core trace target, the TimeMachine instances
are independent, but they are synchronized if multi-core trace synchronization is
enabled. For example, if you have a breakpoint set in the TimeMachine Debugger
for core 0 and you run backwards in the TimeMachine Debugger for core 1, the
breakpoint on core 0 is not hit. However, when the TimeMachine Debugger for
core 1 stops, the TimeMachine Debugger for core 0 is synchronized to approximately
the same point in time where core 1 stopped. It is possible to simultaneously run
the TimeMachine Debugger for each core, but the result is unpredictable.
Note
The compact trace encodings required to trace multiple cores in the
available trace bandwidth typically do not allow for timestamps on each
instruction. In some cases, there may be as few as one timestamp every
few thousand instructions. Therefore, it is not possible for MULTI to
pinpoint exactly which instruction was executing on each core at a specific
time, so an approximation is made.
Multi-core trace requires much more trace bandwidth than single-core trace. On
some targets, it is not possible to capture complete trace of multiple cores. If you
attempt to trace too many cores at once, on-chip trace buffers overflow and gaps
occur in the trace data (see “Dealing with Incomplete Trace Data” on page 416). To
avoid this, you may want to trace a subset of cores. With most targets, you can
control which cores are traced via the Trace Options window. Click the Target
Specific Options button located on the Collection tab, or click the target-specific
tab (only one or the other will appear). For more information, see the documentation
about target-specific trace options in the Green Hills Debug Probes User's Guide
or, if you are using a V850 target, the documentation about V850 trace options in
the MULTI: Configuring Connections book.
• Synchronous debugging is very important when you are tracing multiple cores.
If one core hits a breakpoint and the other cores continue running, they quickly
fill up the trace buffer and push the data leading up to the breakpoint out of the
buffer. Therefore if you think that you may want to look at the trace data leading
up to a point where a core halted, you must halt all cores simultaneously or
nearly simultaneously. For more information, see “Synchronous Debugging
on a Multi-Core Target” on page 577.
• Clearing trace data applies to all cores. This is true for both unretrieved trace
data on the target or trace probe and for trace data that has already been
retrieved. Loading a new executable into the Debugger or onto the target clears
trace data from all cores.
When you perform trace-related operations from a core, the Trace List, PathAnalyzer,
and TimeMachine Debugger you launch use trace data of that core (if the core is
in TimeMachine mode or if no core is in TimeMachine mode).
When you use the MULTI Debugger to switch an OSA task into TimeMachine
mode (for example, by stepping or running backward or by clicking ):
• If the OSA task is executing on a core, that core is switched into TimeMachine
mode, and the task enters TimeMachine mode on that core. If another core is
already in TimeMachine mode, it is switched out of TimeMachine mode first.
• Otherwise:
○ If a core is already in TimeMachine mode, the task is switched into
TimeMachine mode on that core.
○ If no core is in TimeMachine mode, the first core is switched into
TimeMachine mode, and the task enters TimeMachine mode on the first
core.
When you perform other trace-related operations from an OSA task context, such
as opening the Trace List or PathAnalyzer:
Limitations
• If one core holds another core in a reset state on your target, your debugging
interface (for example, Green Hills Probe) may not be able to manipulate the
latter core until the former brings it out of reset. In this case, the Debugger may
show the core held in reset as Not Accessible. You may not be able to halt a
core that is being held in reset.
• Source-level stepping uses software breakpoints that may be hit by cores other
than the one being stepped. The Debugger detects this when it occurs and runs
until the correct core completes the step. However, this can result in a large
performance penalty. In a worst case, where other cores are frequently executing
code that you are stepping through, your system can become unusably slow.
Note
The following methods for manually loading executables onto a multi-core
target are deprecated. We recommend that you use one of the methods
described in “Providing Configuration Details to the Debugger”
on page 565.
target, you must associate the executable with every core. One method for doing
so follows:
1. Select the executable in the target list, and click the Connect button ( ).
2. Using the Connection Chooser that appears, connect to your multi-core target.
3. In the Use Which Connection/CPU? dialog box that appears, select any one
of the cores, and click OK.
4. In the Debugger command pane, issue the new command with no arguments.
For information about the new command, see Chapter 2, “General Debugger
Command Reference” in the MULTI: Debugging Command Reference book.
5. If the Use Which Connection/CPU? dialog box appears again, select any
core. If the dialog box does not appear, MULTI automatically associated the
executable with the only remaining core.
6. Repeat steps 4 and 5 until the executable has been associated with every core
on the target.
For information about the Use Which Connection/CPU? dialog box, see
“Associating Your Executable with a Connection” on page 107.
After associating the executable with every core on the target, you can load the
executable onto the target:
1. In the target list, select the executable listed after the core that is supposed to
run first.
2. In the Debugger command pane, issue the prepare_target -load command.
For information about this command, see “General Target Connection
Commands” in Chapter 17, “Target Connection Command Reference” in the
MULTI: Debugging Command Reference book.
3. For each remaining core, select the executable listed after the core, and enter
prepare_target -verify=none in the Debugger command pane.
1. Select one of the executables in the target list, and click the Connect button
( ).
2. Using the Connection Chooser that appears, connect to your multi-core target.
3. In the Use Which Connection/CPU? dialog box that appears, select the core
that you want to run the selected executable, and click OK.
4. In the Debugger command pane, enter new program_name, where
program_name is the name of another executable. For information about the
new command, see Chapter 2, “General Debugger Command Reference” in
the MULTI: Debugging Command Reference book.
5. If the Use Which Connection/CPU? dialog box appears again, select the core
that you want to run the second executable. If the dialog box does not appear,
MULTI automatically associated the executable with the only remaining core.
6. Repeat steps 4 and 5 until an executable has been associated with every core
on the target.
For information about the Use Which Connection/CPU? dialog box, see
“Associating Your Executable with a Connection” on page 107.
After associating each executable with the core that is supposed to run it, you must
separately load each executable onto the corresponding core:
3. Select each remaining executable in the target list, and load it by doing one of
the following:
• If your board setup script only affects the current core when it is run, and
if it does not reinitialize any shared components on the board (such as
memory) — Issue the prepare_target -load command again.
• If your board setup script affects multiple cores when it is run, or if it
reinitializes shared components on the board (such as memory) — Issue
the load -nosetup command. For information about this command, see
“General Target Connection Commands” in Chapter 17, “Target
Connection Command Reference” in the MULTI: Debugging Command
Reference book.
Note
Support for the Task Manager in freeze mode is deprecated. This feature
has been superseded by the target list.
When you connect to a multi-core target, the Task Manager displays two separate
panes:
• Master pane — Shows each core on the target and basic information about the
tasks on each core (Object Id and Name).
• Reference pane — Shows more information about the object selected in the
master pane:
○ If a debug server is selected — Shows detailed information about the cores
being controlled by the debug server.
○ If a core is selected — Shows additional information about the tasks
running on the core.
○ If a task is selected — Shows all of the tasks belonging to the same core
as the selected task, and briefly highlights the selected task.
The following Task Manager shows an SMP application that is connected via the
mpserv debug server to a multi-core target running the INTEGRITY operating
system on each QorIQ core.
Note
If your debug server and hardware probe support it, we recommend that
you use the synchronous debugging feature described in “Synchronous
Debugging on a Multi-Core Target” on page 577. On a multi-core target
that does not support synchronous debugging, you can perform
synchronous operations by using the deprecated Group menu and
groupaction command, documented here.
• Use the options in the Task Manager's Group menu (for example, Continue
Tasks in Current Group).
• Open the Task Manager, and then issue the groupaction command with
appropriate arguments:
In freeze mode, both of these operations operate on cores, not on the tasks running
on the cores.
If you are using a Green Hills Debug Probe, see the Green Hills Debug Probes
User's Guide for any additional configuration settings that apply to your target.
Unlike the Group menu options and groupaction command, the following will
not initiate synchronous group-based operations:
Note
If you are not using synchronous debugging, and if multiple cores on
your target share memory and a single executable, then breakpoints,
command line function calls, and host I/O system calls are only supported
on the core that you initially loaded the executable onto. Many advanced
debugging features such as coverage, call count, and call graph profiling
make use of breakpoints, command line function calls, and host I/O and
are therefore also only supported on that core.
The name of the configuration file consists of the lowercase name of the
corresponding operating system or of your OS-awareness package. The filename
ends with an .osa extension. It is stored in your personal configuration directory:
• Windows — rtos_install_dir\multi\os_aware
• Linux/Solaris — rtos_install_dir/multi/os_aware
• Windows — ide_install_dir\defaults\os_aware
• Linux/Solaris — ide_install_dir/defaults/os_aware
MULTI searches for the configuration file in your personal configuration directory
first, then in the RTOS installation directory, and finally in the MULTI IDE
installation directory.
To make the configuration file more readable, comment lines are supported. If the
first two non-space characters of a line are forward slashes (“//”), the line is
considered to be a comment.
Note
Two consecutive forward slashes (“//”) in the middle of a line is not
considered to be a comment indicator as it would be in C++ code.
Each line in the configuration file can be a comment line, an empty line, or a line
representing a configuration element. A backslash ('\') at the end of a line combines
the next line with it, so multiple lines can be combined together to represent a single
configuration element.
All syntax elements of the configuration file are separated by a colon (':'). If a string
provided by the OSA integration provider contains a colon (':'), the string should
be enclosed in double quotes.
The design of MULTI's OSA integration mechanism totally separates the GUI
representation from program logic. Each object, attribute of an object and reference
of an object is assigned a unique non-negative number. Negative numbers are
reserved for special purposes. In the interaction between MULTI and the OSA
integration module, only the identifier numbers are used. This makes it very easy
for you to customize the strings displayed in an OSA Explorer, including
internationalization.
The following subsections specify the syntax of the elements in a configuration file.
General Settings
OSA_CONFIG:OSA_VERSION:version_number
OSA_CONFIG:OSA_TASK_ALIAS:terminology_for_task
When a task name needs to be used in other places of the configuration file, use
OSA_TASK instead of terminology_for_task.
OSA_CONFIG:OSA_EXPLORER_TITLE:osa_explorer_title
The osa_explorer_title argument specifies the title for the OSA Explorer. It
is a string that can contain a number replacement (for target ID used by MULTI)
in the syntax of printf() in the C library (%d or 0x%x).
OSA_CONFIG:OSA_INIT_COMMAND:initial_osa_commands
OSA_CONFIG:OSA_POLL_INTERVAL:interval_in_milliseconds
OSA_CONFIG:OSA_MODULE_NAME:osa_integration_module_name
With the exception of the built-in integrations, most of the OSA integration modules
are stored in a DLL file (Windows) or shared library (Linux/Solaris). This setting
tells MULTI the integration module's name and location. If no file extension is
specified in osa_integration_module_name, MULTI appends .dll (Windows)
or .so (Linux/Solaris) to it automatically.
If the option is absent and the OSA integration is not built into MULTI, the default
name (the lowercase name for the OSA integration) will be used.
You can set the OSA integration module's name and location with this option. If
the integration module is specified with only a base name, MULTI first searches
for it in the MULTI IDE installation directory, and then in a way defined by the
host machine.
You can override the setting here by using the -osa MULTI command line option
(see “Starting MULTI for Freeze-Mode Debugging and OS-Awareness” on page 549).
Alternatively, use the osasetup command (see “Object Structure Awareness (OSA)
Commands” in Chapter 15, “Scripting Command Reference” in the MULTI:
Debugging Command Reference book).
OSA_CONFIG:OSA_MEMORY_ACCESS_BLOCK_SIZE:number_in_bytes
This option allows you to customize the memory access blocks size between MULTI
and the target to improve the performance of OSA Explorer.
Log Interaction
Format:
OSA_CONFIG:OSA_DEBUGGING_LOGFILE:log_file
This option allows you to see the interaction between MULTI and the OSA
integration module. All interactions will be saved in the file fm_log_file.
In addition to the communication between MULTI and the OSA integration module,
MULTI will also print some diagnostic information for the OSA integration module
into the log file.
OSA_OBJECT_TYPE:object_name:unique_identifier
:OSA_GLOBAL|OSA_NOT_GLOBAL
Before you specify the detailed information about an object, it must be assigned a
unique identifier.
master_object_name:OSA_REFERENCE_LIST:reference_object_name
:reference_id:reference_name
An object (the master object) can have more than one reference object, and each
reference object is defined by a statement using this syntax.
The string reference_name will be displayed in the drop-down list above the
reference pane in the OSA Explorer.
An object must have an identifier attribute. If one is not defined for an object, the
configuration file is invalid.
Format:
object_name:OSA_ATTRIBUTE_COLUMN:
[OSA_ID=|OSA_NAME=|OSA_STATUS=|OSA_EXEC=]attribute_name
:attribute_id:OSA_SHOW|OSA_NO_SHOW:sorting_type
task identifier and task name are shown in the title of the Debugger window,
and task status is shown in the target list's Status column. If these attributes are
not specified, MULTI uses default values in these places.
OSA_SHOW and OSA_NO_SHOW tell MULTI which attribute columns are to be initially
shown in the OSA Explorer.
sorting_type tells MULTI how to sort each column when it is clicked. The
following are the valid sorting types:
If no sorting type is defined for an attribute, its column will be sorted by string.
Format:
object_name:OSA_MENU:menu_entry_string:multi_commands
// Define Object Type IDs and configure them for global display
// Format: OSA_OBJECT_TYPE:object name:object type id:global_display
OSA_OBJECT_TYPE:"Address Space":0:OSA_GLOBAL
OSA_OBJECT_TYPE:OSA_TASK:1:OSA_GLOBAL
OSA_OBJECT_TYPE:Connection:2:OSA_GLOBAL
OSA_OBJECT_TYPE:Activity:3:OSA_GLOBAL
OSA_OBJECT_TYPE:Semaphore:4:OSA_GLOBAL
OSA_OBJECT_TYPE:"Memory Region":5:OSA_GLOBAL
OSA_OBJECT_TYPE:Link:6:OSA_GLOBAL
OSA_OBJECT_TYPE:Clock:7:OSA_GLOBAL
OSA_OBJECT_TYPE:"I/O Device":8:OSA_GLOBAL
OSA_OBJECT_TYPE:Object:9:OSA_GLOBAL
"Memory Region":OSA_ATTRIBUTE_COLUMN:End:3:OSA_SHOW:OSA_ADDRESS
"Memory Region":OSA_ATTRIBUTE_COLUMN:"Object Index":4:OSA_SHOW:OSA_STRING
"Memory Region":OSA_MENU:"View Memory Region Internals":if ($_OSA_OBJ_ID) \
{substitute view (struct MemoryRegionStruct *)%EVAL{print /x $_OSA_OBJ_ID}; \
} else {print "Memory Region ID is invalid.\n";}
Contents
The MULTI Fast Flash Programmer Window . . . . . . . . . . . . . . . . . . . . . . . . . . 600
Prerequisites to Working with Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
Using the MULTI Fast Flash Programmer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
The MULTI Fast Flash Programmer GUI Reference . . . . . . . . . . . . . . . . . . . . 606
Flash Configuration File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
Troubleshooting Flash Memory Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
Chapter 23. Programming Flash Memory
MULTI provides a graphical interface that makes it easy to write a memory image
from the host to flash memory on the target. Because flash memory is non-volatile,
writing your program to flash memory allows it to run when the target is reset. This
chapter describes how to erase, program, and verify flash memory using the MULTI
Fast Flash Programmer.
• In the Debugger command pane, enter the flash gui command. For information
about this command, see “General Memory Commands” in Chapter 10,
“Memory Command Reference” in the MULTI: Debugging Command Reference
book.
• The setup script initializes the board so that flash memory is accessible and
not cached.
• The setup script disables any external interrupts or watchdog timers that may
interfere with flash programming.
• The setup script executes flash configuration commands if the target
configuration is different for flash programming than for running programs
out of RAM. See “Flash-Specific System Variables for Use in Setup Scripts”
on page 602.
• The setup script specifies whether or not to allow VLE instructions. See
“Flash-Specific System Variables for Use in Setup Scripts” on page 602.
• Your project's link map is linked for ROM and not RAM.
Flash programming speed is greatly enhanced by allocating more RAM for use by
target agents. Choose the largest segment of RAM that can be accessed over the
debug connection.
If the flash device has protected blocks that you need to overwrite, select the Unlock
blocks option in the MULTI Fast Flash Programmer. Protected blocks may
contain vital initialization code, so verify that the program image will not overwrite
important data before setting this option. (This option is only available if you have
selected Erase or Program in the top-right corner of the MULTI Fast Flash
Programmer.)
Suppose your board has a CPU internal flash memory device and an external
CFI-compatible flash memory device. You would need to specify two flash banks.
To do so, you could:
2. Change the value in the Base address of bank field to be the base address of
the internal device.
3. Click the Apply button.
4. Enter the address of the external flash device in the Base address of bank
field.
5. Click the Add New button.
Performing these steps results in a list of two flash banks. The flash utility programs
both of them as needed.
• ELF, S-Record, or MULTI internal format — If the file you are writing to flash
memory is in one of these formats, the offset is added to each address location
specified in the file memory map. If the map correctly specifies where the
program should be written, enter an offset of 0.
Note
To write a program linked for RAM to flash memory, you must edit
the linker directives file (see the documentation about linker
directives files in the MULTI: Building Applications book). A
program linked for RAM will not run if the offset is used to move
the program to the flash area of the memory map.
• Raw image — If the file you are writing to flash memory is an unformatted
memory image, the offset value specifies the location where the image will be
written, relative to the first address in the flash base address list. If you erase
flash memory, the erase begins at the base address plus the offset.
The status of the flash operation is listed in the output pane of the window. You
can cancel the operation at any time by clicking the Cancel button, which is enabled
while the operation is in progress. Some flash operations may not respond
immediately to the cancel request, and the MULTI Fast Flash Programmer may
also wait for certain operations to complete before returning control to you.
Tip
If you experience problems, see “Troubleshooting Flash Memory
Operations” on page 608.
For information about programming flash from a script, see the flash burn command
in “General Memory Commands” in Chapter 10, “Memory Command Reference”
in the MULTI: Debugging Command Reference book.
When you click Erase Flash, the target agent erases a region of flash memory the
same size as the chosen image. For example, if you select an ELF file with 1 MB
of data at the start of flash memory, this feature erases only the first 1 MB of flash.
You can cancel the operation at any time by clicking the Cancel button. The window
indicates the status of the erase in the output pane.
Tip
If you experience problems, see “Troubleshooting Flash Memory
Operations” on page 608.
When you click Verify, the MULTI Fast Flash Programmer compares the
executable with the data on the target and stops when a difference is found.
Enter the name of the appropriate file or click to open a file chooser
and browse to the appropriate file. See also “Choosing a File for Flash
Operations” on page 603.
Program offset Specifies a program offset value. For ELF, S-Record, and MULTI internal
format executables, this value is added to the addresses encoded in the
file. For unformatted memory images, the first base address is added to
this value to determine where in memory the file should be programmed.
For more information, see “Setting a Write Offset” on page 603.
Use size of target Allows you to specify the size and location of RAM to be used by the flash
RAM at location utility. If the memory at the beginning of RAM is unusable, you should
enter the first usable address, and leave the RAM size control set to the
size of the full memory block. The RAM location field is only available
if the RAM size selection is more than 0 KB.
Target setup Allows you to specify the .mbs format script that is run before accessing
script flash memory. If this field is empty, the MULTI Fast Flash Programmer
will run the default setup script for the debug connection.
Verbose output Prints warning and status messages that may be helpful for troubleshooting
purposes.
Erase Flash Begins the flash operation according to the specifications you have entered
in the window.
Program Flash
Note: Because programming flash memory involves downloading target
Verify Flash
agents and running them, you should kill any processes running on the
target before clicking the Erase Flash, Program Flash, or Verify Flash
button. If the flash operation begins while other processes are running, the
running processes terminate.
Close Closes the MULTI Fast Flash Programmer window.
The flash.cfg file contains an entry for each target type. Entries are updated after
successful flash programming sessions. When the MULTI Fast Flash Programmer
opens, these saved configuration settings replace any defaults read from the ELF
file or debug information. Because the settings are indexed by target and not by
project, a new project for a target that has been successfully programmed will use
the target's most recent settings rather than the default settings for a new project.
To restore all MULTI Fast Flash Programmer settings to the default values,
remove or rename the flash.cfg file.
If the MULTI Fast Flash Programmer does not detect any flash memory after
you click the Program Flash or Erase Flash button:
1. Check that the setup script initializes the board so that flash memory is
accessible for both reads and writes.
2. Verify that the base addresses entered in the MULTI Fast Flash Programmer
are the starting addresses of the flash chips.
3. Your flash chip may not be supported. For information about adding support
for new flash memory chips, see the flash_chips.odb file located at
compiler_install_dir/defaults/flash.
If the MULTI Fast Flash Programmer prints messages indicating that writing
the program sections was successful, but then fails to verify the image, the flash
memory may have protected blocks that the flash driver cannot unlock. To fix this:
1. Refer to your flash chip documentation about procedures to unlock the protected
blocks.
2. Following the procedure given in your flash chip datasheet, unlock the flash
blocks in the setup script.
If the MULTI Fast Flash Programmer prints an error about a protected section
of memory, set the Unlock blocks option. For more information about this option,
see “The MULTI Fast Flash Programmer GUI Reference” on page 606.
Contents
Building an Executable for ROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612
Executing a ROM Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614
Debugging a ROM Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
Building an Executable for ROM-to-RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616
Executing a ROM-to-RAM Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
Debugging a ROM-to-RAM Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619
Chapter 24. Working with ROM
• Build a project that can be transferred to the target's nonvolatile memory (ROM)
• Transfer a project's executable image to a target's flash memory
• Run and debug an executable that is located in ROM
• Run and debug an executable that is copied from ROM to RAM at startup
1. The linker directives file used to create the executable specifies that all of the
compiled sections are in ROM.
2. Any necessary target board initialization may need to be done as part of the
program's initialization instead of in a MULTI target setup script.
1. If you do not already have one, create a MULTI project for your target
configuration. For information about how to do this, see Chapter 1, “Creating
a Project” in the MULTI: Managing Projects and Configuring the IDE book.
2. If you just created a MULTI project, you are automatically prompted to add
items to it. Otherwise, select the Top Project and click the Add Items button
( ) in the Project Manager.
3. On the Project Manager: Select Item to Add screen that appears, select a
demo or example. If you want a framework to which you can add your own
source code, select Program. Click Next.
4. Change the next screen's information as desired. Click Next.
5. Select Link to and Execute out of ROM from the Program Layout
drop-down list, and make other selections as appropriate. Click Finish.
Your new program uses a Green-Hills-provided linker directives file that links all
of the sections into ROM.
For more information about adding to projects, see “Managing Your Project” in
Chapter 2, “Managing and Building Projects with the Project Manager” in the
MULTI: Managing Projects and Configuring the IDE book.
For more information, see the documentation about linker directives files in the
MULTI: Building Applications book.
If your program does not use a Green Hills linker directives file, modify it so that
all sections will be placed into ROM instead of RAM. You must also define several
special linker symbols in your linker directives file. This ensures that all MULTI
ROM debugging features work properly. The special linker symbols you should
define are:
Symbol Value
__ghs_ramstart The beginning of RAM.
__ghs_ramend The end of RAM.
__ghs_romstart The beginning of ROM.
__ghs_romend The end of ROM.
__ghs_rambootcodestart The beginning of the sections located in RAM. Should
be 0 for ROM programs.
__ghs_rambootcodeend The end of the sections located in RAM. Should be 0
for ROM programs.
Symbol Value
__ghs_rombootcodestart The beginning of the sections located in ROM.
__ghs_rombootcodeend The end of the sections located in ROM.
Note
All target initialization must be done as part of the program's
initialization instead of in a target setup script.
Note
MULTI uses hardware breakpoints to implement source-line (s
command) and function (n command) stepping in ROM. If a
hardware breakpoint is unavailable, the target may start running
instead of stopping after executing the source line or function.
Instruction stepping (si command) is unaffected.
• ROM programs built with run-time error checking enabled handle run-time
errors as if the Debugger is not connected. For more information, see the
documentation about run-time error checks in the MULTI: Building Applications
book.
1. The linker directives file used to create the executable specifies the locations
of uncompressed boot code sections in ROM, compressed code sections in
ROM, and uncompressed code sections in RAM. The RAM code sections are
not actually part of the executable image, instead they are copied from ROM
at run time by the boot code.
2. Any necessary target board initialization may need to be done as part of the
program's initialization instead of in a MULTI target setup script.
Your new program contains a Green-Hills-provided linker directives file that links
all of the sections into ROM and specifies which sections will be copied into RAM.
If your program does not use a Green Hills linker directives file, modify it so that
it meets the requirements specified at the beginning of this section. Additionally,
you must define several special linker symbols in your linker directives file. This
ensures that all MULTI ROM-to-RAM debugging features work properly. The
special linker symbols you should define are:
Symbol Value
__ghs_ramstart The beginning of RAM.
__ghs_ramend The end of RAM.
Symbol Value
__ghs_romstart The beginning of ROM.
__ghs_romend The end of ROM.
__ghs_rambootcodestart The beginning of the sections located in RAM. All of
the destination sections should be included.
__ghs_rambootcodeend The end of the sections located in RAM. All of the
destination sections should be included.
__ghs_rombootcodestart The beginning of boot code sections located in ROM.
Do not include any of the compressed sections.
__ghs_rombootcodeend The end of boot code sections located in ROM. Do not
include any of the compressed sections.
__ghs_after_romcopy The first address executed after the ROM-to-RAM copy
is complete.
For rules governing the use of __ghs_*start and __ghs_*end, see “Configuring
an Existing Program” on page 613.
Note
Your ROM-to-RAM program must be copied into RAM before software
breakpoints can be set on the target and before system calls can be routed
through the MULTI Debugger.
By default, MULTI adheres to the rules explained next when determining whether
ROM-to-RAM copy initialization has occurred. You can use the rominithbp
command to manually signal to MULTI when the ROM-to-RAM copy initialization
is complete. For information about the rominithbp command, see Chapter 3,
“Breakpoint Command Reference” in the MULTI: Debugging Command Reference
book.
After you prepare your target with the Program already present on target option,
MULTI determines the location of the program counter (PC) the first time the target
halts. If the PC indicates that the next instruction is in RAM, MULTI assumes that
the program has been copied to RAM and lifts ROM debugging restrictions. If,
however, the PC indicates that the next instruction is in ROM, MULTI assumes
that the program has not yet been copied to RAM. In this case, MULTI automatically
sets a hardware breakpoint, called the post-initialization hardware breakpoint, at
__ghs_after_romcopy, which defaults to one of the first instructions in RAM.
When this hardware breakpoint is hit, MULTI is signalled that ROM initialization
is complete and that the program has been copied into RAM.
After MULTI has determined that the program has been copied to RAM, it performs
all post-initialization actions (such as setting software breakpoints and triggering
Debugger hooks). If the target was halted by the post-initialization hardware
breakpoint, MULTI resumes it.
Non-Intrusive Debugging
with Tracepoints
Contents
About Tracepoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
Working with Tracepoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623
Collecting Debugging Information Non-Intrusively: Example . . . . . . . . . . . . 629
The Tracepoints Tab of the Breakpoints Window . . . . . . . . . . . . . . . . . . . . . . . 633
Debugging in Passive Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636
Chapter 25. Non-Intrusive Debugging with Tracepoints
About Tracepoints
The MULTI Debugger allows you to perform non-intrusive debugging using
tracepoints. A tracepoint is set at a particular instruction and collects the values of
one or more variables each time the tracepoint is hit. Unlike the processing for
standard breakpoints, all tracepoint processing is performed by the target. Thus, a
tracepoint can be hit and collect data even when the Debugger is not connected to
the target. Additionally, since MULTI does not have to stop the target to perform
processing, using tracepoints should not significantly impede the normal functioning
of the target.
Data collected by tracepoints accumulates in the tracepoint buffer for later retrieval.
If the tracepoint buffer becomes full, then tracepoints will stop collecting data until
more buffer space is made available by a purge operation (see “Purging the
Tracepoint Buffer” on page 629). If a tracepoint is being hit more frequently than
the threshold specified by the user when the tracepoint was created, then that
particular tracepoint will be disabled and will no longer collect data.
Note
Not all targets and operating systems support tracepoints. You must be
connected to a target and operating system that support tracepoints in
order to perform the actions described in this chapter.
The following sections describe how to perform the most common tracepoint tasks.
Note
Tracepoints, which are are stored on the target, can collect information
about the target even when MULTI is not connected to it.
Setting a Tracepoint
A tracepoint can be set in any of the following ways:
Note
It may not be possible to set tracepoints on some variables. For more
information, see “Limitations: Information You Cannot Collect with
Tracepoints” on page 632.
The table below lists the properties of a tracepoint that can be edited from this
dialog.
Property Meaning
Active Indicates whether the tracepoint is active. When the tracepoint is active,
a check appears in this box and the tracepoint records the values of its
variables (see below) whenever the process reaches the tracepoint's
location. When the tracepoint is inactive, it will not record any data
when it is hit.
Property Meaning
Count Specifies a maximum number of times the tracepoint can be hit in a
timeout period before being disabled. If the tracepoint is hit more than
Count times in a period of Timeout time units, the tracepoint will
automatically be disabled to prevent excessive performance degradation.
If this field is set to 0, the tracepoint will never be automatically
disabled.
Timeout Specifies the length of a timeout period as a multiple of time units. The
exact length and definition of the time units used by tracepoints is
implementation-specific. If the tracepoint is hit more than Count times
in a period of Timeout units, the tracepoint will automatically be
disabled to prevent excessive performance degradation. If this field is
set to 0, the tracepoint will never be automatically disabled.
Location Specifies an address expression representing where this tracepoint will
be set.
Variables Specifies a comma-delimited list of symbols whose values should be
stored when the tracepoint is hit. The symbols will be evaluated in the
context of the tracepoint's source line.
Condition Specifies an optional condition. For many targets, this condition is
ignored, but in some cases it can be used by the operating system
integration to determine if the tracepoint should collect data when it is
hit. The format and interpretation of this field is implementation-specific.
(For more information, consult the documentation for your specific
operating system integration.)
Editing a Tracepoint
Once a tracepoint is set, you can use the Tracepoint Editor dialog to modify its
settings. To open this dialog, do one of the following:
• In the source pane, right-click the tracepoint icon ( ) and choose Edit
Tracepoint from the shortcut menu that appears.
• In the Tracepoints tab of the Breakpoints window, double-click the tracepoint.
• In the Tracepoints tab of the Breakpoints window, select a tracepoint and
click the Edit button.
• In the Tracepoints tab of the Breakpoints window, right-click a tracepoint
and choose Edit Selected Tracepoint from the shortcut menu that appears.
• In the Debugger command pane, enter the edittp command. (For information
about this command, see Chapter 20, “Tracepoint Command Reference” in the
MULTI: Debugging Command Reference book.)
See “Tracepoint Editor Dialog” on page 624 for a description of tracepoint properties
you can edit from this dialog.
Listing Tracepoints
To view the list of active tracepoints, do one of the following:
• From the Breakpoints window, choose the Tracepoints tab, which displays
all of the currently set tracepoints, both active and inactive (see “The Tracepoints
Tab of the Breakpoints Window” on page 633 for more information).
• From the Debugger command pane, issue the tplist command. For information
about this command, see Chapter 20, “Tracepoint Command Reference” in the
MULTI: Debugging Command Reference book.
Note
The Debugger caches the list of tracepoints to improve performance. To
update the cache to reflect any tracepoints that have been automatically
disabled, click the Refresh button on the Tracepoints tab in the
Breakpoints window, or use the command tplist refresh.
Deleting a Tracepoint
To delete a tracepoint, do one of the following:
• From the Debugger source pane, right-click the tracepoint icon ( ), and select
Enable Tracepoint or Disable Tracepoint.
• From the Breakpoints window:
1. Choose the Tracepoints tab.
2. In the list of tracepoints, click in the Active column next to the line for
the tracepoint to be enabled or disabled.
• From the Debugger command pane, use the tpenable true or tpenable false
command, using an address expression or an ID to indicate which tracepoint
to enable or disable, respectively.
For example:
> tpenable false %0
0 main#2: 0x101f4 200/400 <disabled> (argc,argv)
> tpenable true main#2
0 main#2: 0x101f4 200/400 (argc,argv)
For more information, see the tpenable command in Chapter 20, “Tracepoint
Command Reference” in the MULTI: Debugging Command Reference book.
Resetting a Tracepoint
The tpreset command resets the hit count for a tracepoint to 0 (zero). You can use
an address expression or an ID to specify which tracepoint to reset. For example,
tpreset %0 or tpreset main#2 would reset the tracepoint. For more information,
see the tpreset command in Chapter 20, “Tracepoint Command Reference” in the
MULTI: Debugging Command Reference book.
For example, the tracepoint used in the previous examples might yield the
following data:
> tpprint
-------------TRACEPOINT BUFFER CONTENTS---------------------
Tracepoint buffer contains 78 bytes.
In this example, three events are logged in the tracepoint buffer. First, a
tracepoint is set at main#2. Then the tracepoint is hit at timestamp 0x0000058c
and logs the value 0x00000001 for argc and the value 0x00195010 for argv.
Finally, at timestamp 0x0000058d, the task is resumed after hitting the
tracepoint. The amount of space used in the buffer is 78 bytes.
For more information, see the tpprint command in Chapter 20, “Tracepoint
Command Reference” in the MULTI: Debugging Command Reference book.
For more information, see the tppurge command in Chapter 20, “Tracepoint
Command Reference” in the MULTI: Debugging Command Reference book.
class UT2
{
private:
static int Mstaticint;
int Mint;
public:
UT2(int);
};
int Gint = 5;
int Garray[5] = {10, 11, 5, 7, 3};
my_struct Gstruct;
my_struct Garraystruct[1] = { Gstruct };
my_struct * Gstructptr = &Gstruct;
UT2* Gut2ptr;
int UT2::Mstaticint = 1;
UT2::UT2(int param)
{
this->Mint = param;
}
dialog (see “Tracepoint Editor Dialog” on page 624). For a full description of the
tpset command and other tracepoint commands, see Chapter 20, “Tracepoint
Command Reference” in the MULTI: Debugging Command Reference book.
• To collect the value of an expression where the resulting value's location can
be statically calculated, enter:
tpset 0/0 (Garraystruct[1].Mint) main##LABEL
• To collect a string (note that the char* type is treated specially when gathering
data), enter:
tpset 0/0 (Lcharptr) main##LABEL
• To use a cast operation to change the kind of information collected (for example,
to gather the integer value at the beginning of the string pointed to by
Lcharptr), enter:
• You cannot collect a variable that requires multiple dereferences. For example,
the following command is invalid:
tpset 0/0 (**argv) main##LABEL
• You cannot collect an array element indexed dynamically. For example, the
following command is invalid:
tpset 0/0 (Garray[Lint]) main##LABEL
• You cannot collect a struct member from a struct pointer. For example, the
following command is invalid:
tpset 0/0 (Gstructptr->Mint) main##LABEL
• You cannot collect the value of an expression where one or more portions
cannot be determined statically (for example, the value of Lstruct.Mintptr
is dynamic). For example, the following command is invalid:
tpset 0/0 (*Lstruct.Mintptr) main##LABEL
• You cannot collect the value of an expression that includes a function call or
that would require execution of the application's target code. For example, the
following command is invalid:
tpset 0/0 (foo(5)) main##LABEL
• You cannot collect a C++ class member when the this pointer does not exist.
In some cases, when a member function makes no reference to the class
members, the this pointer will be optimized away by the compiler.
Consequently, the tracepoint processing has no way of statically determining
where the class's members are at run time.
To access the currently set tracepoints, open the Breakpoints window and choose
the Tracepoints tab. To open the Breakpoints window, do one of the following:
Button Effect
Refresh Reloads the list of tracepoints from the target. The target may deactivate
tracepoints during your program's execution if their Count per Timeout
limit is reached, so you may want to refresh the list of tracepoints
periodically to see if any of them have been deactivated. In order to
conserve target connection bandwidth, this is not done automatically.
Dump Recorded Downloads any data that the tracepoints have recorded from the target
Data and prints it to the command pane. In order to conserve target connection
bandwidth, this is not done automatically.
Delete Deletes the selected tracepoints. Once a tracepoint is deleted from its
source line, your program will not record data there anymore until you
set another tracepoint on the same line.
If you only want to remove a tracepoint temporarily, you can disable
it by clicking in the Active column.
Edit Opens the Tracepoint Editor dialog (see “Tracepoint Editor Dialog”
on page 624).
New Tracepoint Opens a dialog box that allows you to create a new tracepoint.
For information about the MULTI commands corresponding to these buttons, see
Chapter 20, “Tracepoint Command Reference” in the MULTI: Debugging Command
Reference book.
The mouse and keyboard actions listed next are available from the Tracepoints
tab.
Action Effect
Click a tracepoint Displays the tracepoint's location in the Debugger.
Double-click a Opens the Tracepoint Editor dialog (see “Tracepoint Editor Dialog”
tracepoint on page 624).
or
Press Enter
Click the Active cell Toggles the tracepoint to active or inactive.
of a tracepoint
Press Delete Deletes the selected tracepoint(s).
Right-click a Opens a shortcut menu of common actions. See the following table for
tracepoint a description of the menu items.
In the Tracepoints tab, you can use a context-sensitive menu to perform actions
on selected tracepoints. To open this menu, select one or more tracepoints from the
list and right-click. The shortcuts available from this menu are listed in the following
table.
Item Action
Show In Debugger Displays the tracepoint's location in the Debugger.
Enable Selected Makes all of the selected tracepoints active, so that the target will record
Tracepoints their associated data when they are hit.
Disable Selected Makes all of the selected tracepoints inactive, so that the target will not
Tracepoints record their associated data when they are hit.
Edit Selected Opens the Tracepoint Editor dialog on the selected tracepoint (see
Tracepoint “Tracepoint Editor Dialog” on page 624).
Delete Selected Deletes the selected tracepoints.
Tracepoints
New Tracepoint Opens the Tracepoint Editor dialog, which allows you to create a new
tracepoint (see “Tracepoint Editor Dialog” on page 624).
Note
Passive mode is not available with all targets. Additionally, passive mode
is not supported for programs compiled with run-time error checking
information. (The MULTI Debugger sets a breakpoint in these programs
to help it determine when a run-time error has occurred. This can result
in your target halting while the Debugger is still in passive mode.)
For those operating system integrations that support passive mode, it is possible to
enable or disable passive mode from the MULTI command pane. However, some
operating system integrations require a password to enter or exit passive mode.
Please refer to the documentation for your specific operating system integration to
determine whether a password is necessary, and if so, what the default value of the
password is.
> halt
halting process...done.
The passive on opensesame line causes MULTI to enter passive mode (if the
current operating system integration did not require a password, then the first line
would have been passive on). In this mode, intrusive debugging commands (such
as the halt command issued in line three of the example) are rejected. The passive
off opensesame line causes MULTI to exit passive mode. Thus, the halt
command issued in the next line succeeds.
For more information about the passive command, see Chapter 20, “Tracepoint
Command Reference” in the MULTI: Debugging Command Reference book.
Note
Entering passive mode disables all active software and hardware
breakpoints in the program you are debugging. These breakpoints must
be re-enabled manually after exiting passive mode (that is, they are not
automatically re-enabled).
The current state of passive mode is saved on the target for as long as the target is
running. MULTI queries the target upon connection to determine whether the target
is currently in passive mode. For example, if you connect to a target, enter passive
mode, disconnect from the target (but leave the target running), and then reconnect
to it, MULTI will still be in passive mode when you reconnect.
can be used to change the passive mode password. Again, suppose the current
password for passive mode is opensesame:
> passive password opensesame albatross
Passive mode state successfully changed.
This command changes the password for entering and exiting passive mode from
opensesame to albatross. This use of the passive command has no meaning
for operating system integrations that do not support passive mode passwords.
For more information about the passive command, see Chapter 20, “Tracepoint
Command Reference” in the MULTI: Debugging Command Reference book.
Note
For those operating system integrations that do support passive mode
passwords, the default password is implementation specific. For more
information, consult the documentation for your operating system
integration.
Contents
Quick Memory Testing: Using the Memory Test Wizard . . . . . . . . . . . . . . . . . 640
Advanced Memory Testing: Using the Perform Memory Test Window . . . . 643
Viewing Memory Test Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651
Continuous Memory Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652
Memory Testing with a Target Agent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652
Types of Memory Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653
Efficient Testing Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663
Running Memory Tests from the Command Line . . . . . . . . . . . . . . . . . . . . . . . 663
Detecting Coherency Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664
Chapter 26. Testing Target Memory
Additionally, MULTI offers manual and optional automatic methods for checking
coherency between target memory and an original executable program file. These
tools and available types of memory testing are described in this chapter.
Note
You can perform all memory tests by issuing the memtest command in
the Debugger command pane. However, the Perform Memory Test
window provides a simpler way to control all of the same behaviors and
parameters that you can configure with the more complicated memtest
command. For the complete syntax of the memtest command, see
“General Memory Commands” in Chapter 10, “Memory Command
Reference” in the MULTI: Debugging Command Reference book.
Note
We recommend that you run your target's setup script before testing
memory. Memory testing generally requires that your target be in a good
state; for example, your target's memory controller should be initialized.
If accessing memory via your target connection (for example, Green Hills
Probe) does not work, memory testing via the Debugger will not work.
In order to test memory using a target agent, you must also be able to
download a program (the target agent) onto your target and run it.
To launch the Memory Test Wizard, connect to your target, and select Target →
Memory Test from the Debugger.
This window allows you to set the basic parameters for your memory test (i.e., the
start address and end address of the area of memory to be tested, and the access size
to be used while performing the test) and quickly launch one of three common test
combinations.
To configure your memory test from the Memory Test Wizard, first use the fields
described next to define the memory area and access size for the test.
Note
Valid values that you enter in the Start address, End address, and Access
size fields are carried over to the Perform Memory Test window if you
select Advanced.
The Test choice section of the Memory Test Wizard allows you to select one of
the tests or test combinations listed in the following table.
Quick (using Performs the address bus walking test and data bus walking test, with
Debugger) both walking ones and zeros. When launched with this button, these
tests are performed by the Debugger.
See “Address Bus Walking Test” on page 653 and “Data Bus Walking
Test” on page 655 for a full description of these tests.
Exhaustive (using Performs the address bus walking test and data bus walking test, with
target agent) both walking ones and zeros, as well as the data pattern test. The
pattern test uses the pseudorandom pattern and the maximize address
bus transition options (see “Data Pattern Test” on page 657 for details).
When launched with this button, these tests are performed using a
target agent. The target agent is not available for all targets. If no
target agent is available for your target environment, this button will
be dimmed. For more information about target agents, see “Memory
Testing with a Target Agent” on page 652. This test uses the target
agent positioned at the start of the test range.
See “Address Bus Walking Test” on page 653, “Data Bus Walking
Test” on page 655, and “Data Pattern Test” on page 657 for a full
description of these tests.
Memory read Performs the memory read test. When launched with this button, this
(nondestructive) test is performed by the Debugger.
See “Memory Read Test” on page 660 for a full description of this
test.
Clicking one of the preceding buttons launches the corresponding memory test(s)
on the target that was selected in the target list when you opened the Memory Test
Wizard. A Memory Test Results window opens (see “Viewing Memory Test
Results” on page 651) and remains open after the test completes or is aborted.
Note
To abort memory testing, press the Esc key.
A sample Perform Memory Test window is pictured below. Valid values specified
in the Memory Test Wizard are carried over to the Perform Memory Test window.
This window allows you to specify the area of memory to be tested, the type of
memory tests to be performed, and various options about how those tests are
performed. The following sections explain how to configure all of these settings.
Note
Three of these fields are identical to fields in the Memory Test Wizard.
Any valid values you may have input in these fields in the wizard are
carried over to the Perform Memory Test window.
Size (bytes) Displays the total size of the area of memory to be tested. This field
is provided for your information; the memory test itself uses the
specified Start address and End address values.
Click the Size (bytes) button if you want to calculate or recalculate
the size after changing the Start address or End address.
Access size Specifies the access size, in bytes, to be used while performing the
memory test. Select 1, 2, or 4.
This setting defaults to 4, or to the choice entered in the Memory
Test Wizard, if any.
The test choices include both destructive and nondestructive tests. Destructive tests
overwrite the contents of memory in the test region. You can run more than one
type of destructive test simultaneously, but nondestructive tests must be run
individually. The following table briefly describes the test choices. Each test is
described in more detail in “Types of Memory Tests” on page 653.
CRC compare Selects the CRC compare test, which repeatedly computes CRC
(nondestructive) checksums for a range of memory, in order to verify that memory can
be read reliably.
For more details about this test, see “CRC Compare” on page 661.
This test cannot be run at the same time as any other memory tests.
Find start/end ranges Selects the find start/end ranges test, which locates possibly unused
(nondestructive) memory at the start and end of the range being tested.
For more details about this test, see “Find Start/End Ranges”
on page 661.
This test cannot be run at the same time as any other memory tests.
The available options and their effects are listed in the following table. Not all
options are available with all tests.
Maximize address Uses a sequence of addresses in the data pattern test or memory read
bus transitions test that maximizes the address line transitions between accesses.
If this option is not selected, the default behavior accesses memory
sequentially from low addresses to high addresses.
When this option is selected, the sequence of memory accesses would
begin start, end, start+1, end-1, and so on; assuming that start
and end define a power of two sized and aligned region and the access
size is one byte. If start and end do not define a power of two sized
and aligned range, the range is split into sequential power of two sized
and aligned ranges for the purposes of this test.
Reset pattern value Executes the selected tests on every iteration rather than attempting
between iterations to use different starting pattern values on successive test iterations.
This option is only valid if the Repeat test value is greater than one
or if the Run test continuously option is used. For pattern tests, this
option has no effect if the Pattern option is Static.
Repeat test Repeats memory test(s) the indicated number of times. If unspecified,
the test(s) will be performed only once.
Run test continuously Repeats memory test(s) continuously.
Max. errors Aborts memory test(s) after detecting the specified number of errors.
This value must be between 1 and 1000. If unspecified, MULTI will
abort the test after 10 errors.
Write-only test (no Skips the reading phase of the address bus walking, data bus walking,
errors) and/or data pattern tests. Since no reading is performed, no errors can
be reported.
The options available in this section and their effects are described in the table
below.
Debugger Specifies that the Debugger should perform the test or tests directly.
Target agent Specifies that a target agent should be used to perform the test or tests.
For more information, see “Memory Testing with a Target Agent”
on page 652.
Agent location Specifies where the target agent is downloaded. Select Start of test
range or End of test range, or specify another location by entering it
in the field, replacing the <specify location> choice. The default is to
download the target agent at the start of the address range being tested.
For more details, see “Memory Testing with a Target Agent”
on page 652.
A Memory Test Results window is displayed and shows the test progress and
results. For more information, see “Viewing Memory Test Results” on page 651.
This window remains open after the test completes or is aborted.
Note
To abort memory testing, press the Esc key.
The Memory Test Results window will contain the following information:
• A memtest command that is equivalent to the various tests and options selected
in the Memory Test Wizard or Perform Memory Test window. (This is
provided to make it easier to write MULTI Debugger scripts that can
automatically perform memory tests.) For information about the memtest
command, see “General Memory Commands” in Chapter 10, “Memory
Command Reference” in the MULTI: Debugging Command Reference book.
• The printed output of the command, including any memory test errors. (This
appears below the line of dashes.)
• A test progress indicator.
• A status bar, which displays messages about the success or failure of the test(s).
When using a target agent, you must specify where MULTI should load the target
agent code. To do this, use the Agent location field of the Perform Memory Test
window to select one of the following locations for target agent placement:
Note
Keep the following restrictions and conditions in mind when specifying
the location of your target agent:
• If you select the start or end of the test range, the test range must be
at least twice as large as the target agent. This allows the complete
range to be tested, by first placing the target agent at the start of the
range, and then placing the target agent at the end of the range. (The
target agent requires an estimated 10–20 KB of memory for its code
and data. However this varies by target CPU architecture and is
subject to change.)
• The target agent should not be located at the start or end of the test
range for nondestructive tests, or else the target agent will overwrite
that memory.
• If you specify a target agent location other than the start or end of
the test range, it must not overlap the test range.
If you are running memory tests using the memtest command, use the -tgtagent
option to specify that memory testing be performed with a target agent. To specify
the location of the target agent code, use one of the following options:
For more information about the memtest command, see “General Memory
Commands” in Chapter 10, “Memory Command Reference” in the MULTI:
Debugging Command Reference book.
necessary to use a target agent (see “Specifying Test Methods” on page 649 for
information about these two test methods).
In this test, the range of memory is divided into sequential regions that are sized
and aligned to a power of two. For example, if memory from 0xa00 to 0xffffff
is to be tested, the actual ranges that will be tested are as follows:
0xa00 to 0xbff 0b1010 0000 0000
(512 B) 0b1011 1111 1111
This test can be performed as a walking one test or a walking zero test, or you can
set it to run twice, testing once for ones and once for zeros. Depending on the
walking value selected (one or zero), a pattern value is written to an address in the
range with a single address bit set to 1 (walking one test) or to 0 (walking zero test).
All other address bits that reference that region are set to the opposite value. The
low bits are cleared, as appropriate for the access size used. The pattern's complement
is written to locations in the test range with a different address bit set (walking one
test) or cleared (walking zero test). The pattern's complement is also written to the
location at the start of the range (walking one test) or the end of the range (walking
zero test). After the complement values are written, the original pattern value that
was written is verified to make sure it has not changed. This is repeated for every
address bit that references the range of memory to be tested.
For example, using the range 0x0000 to 0xffff, a walking one test with an access
size of 4 produces a sequence that begins as follows.
Write 0x55555555 to address 0x0004
Write 0xaaaaaaaa to address 0x0008
Write 0xaaaaaaaa to address 0x0010
...
Write 0xaaaaaaaa to address 0x8000
To run this test from the Perform Memory Test window, select the Address
walking radio button, then select a Walking value (One, Zero, or Both). See
“Advanced Memory Testing: Using the Perform Memory Test Window” on page 643.
This test is also run twice, once with walking ones and once with walking zeros, if
you select the Quick or Exhaustive buttons on the Memory Test Wizard. See
“Quick Memory Testing: Using the Memory Test Wizard” on page 640.
To run this test using the memtest command, use the -test=a0 option (for a walking
zero test) and/or the -test=a1 options (for a walking one test). See the description
of the memtest command in “General Memory Commands” in Chapter 10, “Memory
Command Reference” in the MULTI: Debugging Command Reference book.
This test can be performed as a walking one test or a walking zero test, or you can
set it to run twice, testing once for ones and once for zeros. Depending on the
walking value selected (one or zero), successive values containing either a single
one bit (walking one test) or a single zero bit (walking zero test) are written to
successive memory locations and then read back. Only the first 8, 32, or 128 bytes
of memory in the range are modified by this test, depending on the access size
specified.
For example, using the range 0x0000 to 0xffff, a data walking one test with an
access size of 4 produces a sequence that begins as follows:
Write 0x00000001 to address 0x0000
Write 0x00000002 to address 0x0004
Write 0x00000004 to address 0x0008
...
Write 0x80000000 to address 0x007c
Read from address 0x0000 and verify that the data value
is 0x00000001
Read from all other addresses written and verify that the
value is as expected.
You can specify a repeat count, which will rotate the initial data pattern at the start
of each test. Using the same options utilized in the previous example, a repeat count
will produce a sequence that begins with the following:
Iteration 1:
Write 0x00000001 to address 0x0000
...
Iteration 2:
Write 0x00000002 to address 0x0000
...
Iteration 3:
Write 0x00000004 to address 0x0000
...
If the memory range is not large enough to write all distinct values, the test will
write some of the walking data values, read them back to verify that the value is
what is expected, then start from the beginning of the memory range and write more
of the walking data values.
To run this test from the Perform Memory Test window, select the Data walking
radio button, then select a Walking value (One, Zero, or Both). See “Advanced
Memory Testing: Using the Perform Memory Test Window” on page 643.
This test is also run twice, once with walking ones and once with walking zeros, if
you select the Quick or Exhaustive buttons on the Memory Test Wizard. See
“Quick Memory Testing: Using the Memory Test Wizard” on page 640.
To run this test using the memtest command, use the -test=d0 option (for a walking
zero test) and/or the -test=d1 options (for a walking one test). See the description
of the memtest command in “General Memory Commands” in Chapter 10, “Memory
Command Reference” in the MULTI: Debugging Command Reference book.
The data pattern test writes a specified pattern to successive memory locations. The
same pattern value can be written to all locations, or you can specify that certain
modifications be made between iterations. The options for how the pattern is handled
are listed in the table below.
Pseudorandom The specified value is fed through a linear feedback shift register
(LFSR) that generates a sequence of 2^n-1 values.
If this method is selected, the next value in a sequence is generated
as follows (bit positions are indicated with bit 0 as the least
significant bit):
The data pattern consisting of all zeros is not permitted, since the
LFSR will always generate a zero in that case.
Note
You can use the Maximize address bus transitions option in the
Perform Memory Test window or the -maxtransitions option with the
memtest command to cause MULTI to use a sequence of addresses for
this test that maximizes the address line transitions between accesses. If
To run this test from the Perform Memory Test window, select the Data pattern
radio button, then select a Pattern option (Static, Complement, Rotate, Rotate
and Complement, or Pseudorandom) and specify a Pattern value. See “Advanced
Memory Testing: Using the Perform Memory Test Window” on page 643.
This test is also run, using a target agent, the pseudorandom pattern option, and the
Maximize address bus transitions option, if you select the Exhaustive button on
the Memory Test Wizard. See “Quick Memory Testing: Using the Memory Test
Wizard” on page 640.
To run this test using the memtest command, use the -test=p option and specify
the pattern with the -pattern=value option. To specify the pattern behavior, use the
following options:
You can pass the -complement and -rotate options together. See “General Memory
Commands” in Chapter 10, “Memory Command Reference” in the MULTI:
Debugging Command Reference book.
This test reads memory from successive memory locations. After reading each
address for the first time, the test reads back the value from the prior address and
verifies that the values are identical.
This test does not destroy the memory in the range. For example, to test the range
0x0000 to 0xffff with an access size of 4, the test sequence begins:
To run this test from the Perform Memory Test window, select the Memory read
(nondestructive) radio button. See “Advanced Memory Testing: Using the Perform
Memory Test Window” on page 643.
This test is also run if you select the Memory read (nondestructive) buttons on
the Memory Test Wizard. See “Quick Memory Testing: Using the Memory Test
Wizard” on page 640.
To run this test using the memtest command, use the -test=r option. See “General
Memory Commands” in Chapter 10, “Memory Command Reference” in the MULTI:
Debugging Command Reference book.
CRC Compute
CRC compute provides a way to compute a CRC checksum on a range of memory.
This nondestructive test reads bytes from successive memory locations and computes
a CRC checksum from the result. The algorithm used is a standard 32-bit CRC and
matches the algorithm used by default in the Green Hills Software linker's
-checksum option.
To run this test from the Perform Memory Test window, select the CRC
computation (nondestructive) radio button. See “Advanced Memory Testing:
Using the Perform Memory Test Window” on page 643.
To run this test using the memtest command, use the -test=cr option. See “General
Memory Commands” in Chapter 10, “Memory Command Reference” in the MULTI:
Debugging Command Reference book.
CRC Compare
CRC compare provides a way to repeatedly compute a CRC checksum for a range
of memory, in order to verify that memory can be read reliably. This nondestructive
test reads bytes from successive memory locations and computes a CRC checksum
from the result. It then recomputes the CRC checksum and verifies that the
recomputed checksum matches the original computed value. You can specify how
many times the test should be repeated. If the checksum does not match, an error
is printed and the most recent checksum value is used from that point on for any
further verify iterations.
The algorithm used is a standard 32-bit CRC and matches the algorithm used by
default in the Green Hills Software linker's -checksum option.
To run this test from the Perform Memory Test window, select the CRC compare
(nondestructive) radio button. To run the test repeatedly, also select the Repeat
test radio button and specify the number of times the test should run. See “Advanced
Memory Testing: Using the Perform Memory Test Window” on page 643.
To run this test using the memtest command, use the -test=cc option. To cause the
CRC compare to run more than once, use -repeat=number_of_tests to specify the
number of times the operation will be performed. See “General Memory Commands”
in Chapter 10, “Memory Command Reference” in the MULTI: Debugging Command
Reference book.
Note
The term range is used in different ways in this test. The specified range
represents the entire area of memory to be examined and is an input to
this test. The start range and end range, if present, are subranges of the
specified range and are the outputs of this test.
This test consists of two parts. First, the test reads memory locations sequentially
from the start of the specified range. If multiple consecutive memory locations
contain the same value, those consecutive, identical memory locations are reported
as a potentially unused memory range. When the test reads the first memory location
that contains a value different from all the earlier values, the first part of the test
stops. The second part of the test is similar to the first part of the test, except that
memory locations are read sequentially from the end of the specified range toward
the start of the specified range. The output indicates the extent of identical memory
values at the start and end of the provided range. (If the entire specified range
contains the same value, the test will only report a single range equal to the specified
range.)
For example, if the range 0x0000 to 0xffff is tested with an access size of 4, the
test output might be something like:
Start range: 0x00000000
to: 0x000000ff
value: 0x00000000
This output indicates that the first 0x100 bytes of the range contain the 4-byte value
0x00000000. This output also implies that the next memory location contains a
value other than 0x00000000. The final 0x45b4 bytes of the specified range
(0xba4c-0xffff) contain the 4-byte value 0xffffffff. This output also implies
that the location 0xba48 contains a value other than 0xffffffff.
To run this test from the Perform Memory Test window, select the Find start/end
ranges (nondestructive) radio button. See “Advanced Memory Testing: Using the
Perform Memory Test Window” on page 643.
To run this test using the memtest command, use the -test=fr option. See “General
Memory Commands” in Chapter 10, “Memory Command Reference” in the MULTI:
Debugging Command Reference book.
1. Perform one or more address and/or data walking tests from the Debugger.
2. Perform one or more pattern tests over a small area of memory from the
Debugger.
3. Perform one or more of the other tests using the target agent across the entire
range of memory.
Note
If you want to write scripts that contain memory testing commands, you
can still use the Memory Test Wizard or the Perform Memory Test
window to help you determine the exact command syntax for the specific
test and testing options you want to use. To do this, first use one of these
graphical tools to configure the test you want to run, and then run the
test. When the test completes, the Memory Test Results window will
display the exact command syntax that corresponds to the testing options
you specified in the GUI. You can use the command syntax given there
in the Debugger command pane or in customized scripts.
For information about the memtest command, see “General Memory Commands”
in Chapter 10, “Memory Command Reference” in the MULTI: Debugging Command
Reference book.
In the worst case scenario, code in memory is only slightly different from code in
the executable program file, making it difficult to detect the discrepancy. MULTI
offers two complementary ways of detecting this problem: manual coherency
checking via the verify command and automatic coherency checking via a debugging
setting. The next two sections describe each of these coherency checking methods.
where:
The Debugger compares the bytes in the specified range of target memory against
the bytes in the content of the executable program file, and prints a list of addresses
where they differ. The Debugger also highlights the lines in the source pane
corresponding to those addresses to warn you that their contents differ.
To manually check the coherency of all downloaded non-data sections that cannot
be written to, enter the verify -all command in the command pane. The .text
section is one example of a section that you cannot write to. Because certain sections
of memory, such as .data, may be written to during program execution, you can
expect them to differ from the executable program file. When you specify the -all
option, the verify command does not check these sections. However, you can verify
them manually if their contents exist in the executable file. To do so, enter verify
-section section_name in the command pane.
For comprehensive information about the verify command, see Chapter 10, “Memory
Command Reference” in the MULTI: Debugging Command Reference book.
Note
MULTI supports coherency checking with most debug servers.
However, if the Debug → Debug Settings → Auto Check
Coherency menu item is dimmed, most automatic coherency
checking is not available in your current environment.
MULTI attempts to check an equal number of addresses before and after the current
program counter; however, it does not cross function boundaries. For example, if
MULTI is stopped at the first instruction of a function, automatic checking inspects
addresses only after the program counter. It continues for the specified number of
addresses.
Note
Because extra memory is read on every stop, use care when setting the
number of addresses to be read. Setting a large number of addresses may
slow normal run control.
Establishing Serial
Connections
Contents
Starting the Serial Terminal Emulator (MTerminal) . . . . . . . . . . . . . . . . . . . . . 668
Using Quick Connect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
Creating and Configuring Serial Connections . . . . . . . . . . . . . . . . . . . . . . . . . . 670
The MTerminal Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674
Running the Serial Terminal Emulator in Console Mode . . . . . . . . . . . . . . . . . 677
mterminal Syntax and Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678
Chapter 27. Establishing Serial Connections
• From the MULTI Launcher, click and then select Open Terminal from the
drop-down menu that appears. Alternatively, select Components → Open
Serial Terminal from the menu bar. These actions start the Serial Connection
Chooser, which allows you to create or edit a Serial Connection Method and
then connect to the serial port.
• From the MULTI Launcher, click and then select the name of a previously
created Serial Connection Method from the drop-down menu that appears. This
starts the MTerminal window with a terminal connected to the specified serial
port. If the connection is unsuccessful, an error message appears.
• From the command line, execute mterminal (for command usage, see
“mterminal Syntax and Arguments” on page 678). This opens the serial terminal
emulator as a stand-alone program. The emulator usually opens in GUI mode,
displaying either the MTerminal window or the Serial Connection Chooser,
depending on the arguments specified. On Linux/Solaris hosts, you can also
open the emulator in console mode. For more information, see “Running the
Serial Terminal Emulator in Console Mode” on page 677.
• From the MULTI Debugger, select Tools → Serial Terminal → Make Serial
Connection. Alternatively, issue the serialconnect command with no arguments
in the command pane. (For information about the serialconnect command, see
1. Select an available baud rate from the Baud Rate drop-down list.
2. Select one of the commonly used ports from the Port drop-down list, or type
the name of a port in the Port field.
3. Click the Quick Connect button.
For information about serial connections that you can configure and save, see the
next section.
To create a new standard Serial Connection Method from the Serial Connection
Chooser, click . To edit an existing Serial Connection Method, select the Method
from the drop-down list and click . Both of these actions open a Serial Connection
Settings dialog, which allows you to configure your new or existing Serial
Connection Method. For more information, see “Using the Serial Connection Settings
Dialog” on page 671.
After you have created at least one Serial Connection Method, you can establish a
connection by selecting your desired method from the drop-down list and then
clicking Connect.
You can also create a Custom Serial Connection Method by entering a command
in the Serial Connection Chooser, rather than using the graphical Serial
Connection Settings dialog. To do this, click the Custom button in the Serial
Connection Chooser and use the syntax given below to describe the connection
in the Make Serial Connection text field of the Chooser.
This command accepts the same arguments as the mterminal command, which is
used to launch MTerminal as a stand-alone application. For a description of the
arguments that can be used to set the parameters of your connection, see “mterminal
Syntax and Arguments” on page 678.
1. Open the Serial Connection Chooser (see “Starting the Serial Terminal
Emulator (MTerminal)” on page 668).
2. Click to create a new connection or to edit an existing connection. This
will open a Serial Connection Settings dialog.
Name
Specifies the name of the connection. If no name is entered, the method you create will be a
Temporary Serial Connection Method and will exist only for the duration of the current
MTerminal session.
Log Connection to file
Logs the output from the serial port to the specified file. By default, this option is cleared (i.e.,
logging is disabled).
Serial Port
Identifies the name of the serial port to connect to. The default values in the list are determined
by the local host. If none of the values are applicable, you can type in the appropriate name.
(Serial port names can be prepended with /dev.)
Baud Rate
Specifies the baud rate for your connection. This setting defaults to 9600.
Data Bits
Specifies the data bits for your connection. This setting defaults to 8.
Parity
Specifies the parity for your connection. This setting defaults to none.
Stop Bits
Specifies the stop bits for your connection. This setting defaults to 1.
Flow Control
Specifies the flow control for your connection. This setting defaults to none.
You can use the main terminal window to interact with a serial port to which you
have connected. This window provides full VT100 support.
Item Meaning
About Shows basic information about MTerminal, including the
version number and revision date.
Item Meaning
Clear Clears text from the terminal window.
Note
Console mode does not have VT100 support.
where port_name specifies what serial port is being used (for example, ttya,
ttyS0, or COM1), and mterminal_parameters can be one or more of the options
listed in the following table. (Parameters that are not specified use default values.)
Note
The following arguments can also be used with the serialconnect
command or entered into the Make Serial Connection text field of the
Serial Connection Chooser. For more information, see “Using the Serial
Connection Chooser” on page 670.
-baud baudrate Specifies the baud rate, where baudrate can be any one of the
following: 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400,
4800, 9600, 19200, 38400, 57600, 115200, or 230400. The default
is 9600.
-databits DB Specifies the data bits, where DB can be 5, 6, 7, or 8. The default is 8.
-flowcontrol FC Specifies flow control, where FC can be none or xonxoff. The default
is none.
-help Prints help information. This option is only valid in console mode and
does not work on Windows hosts.
-log_file filename Enables logging and specifies the name of the file to which data is
written. By default, logging is disabled.
-nodisplay Runs mterminal in console mode. This option causes all output to be
printed to standard output and all input to be received from standard
input. In console mode, no graphical windows appear and the serial
port must be specified. This option does not work on Windows hosts.
-parity P Specifies parity, where P can be none, even, or odd. The default is
none.
-stopbits SB Specifies stop bits, where SB can be either 1 or 2. The default is 1.
The following example starts the GUI version of MTerminal on the serial port
ttyS0. The baud rate is 38400.
Appendices
Appendix A
Contents
Debugger Window Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684
The Debugger Window Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715
The Target List Shortcut Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726
Source Pane Shortcut Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
The Command Pane Shortcut Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 736
The Source Pane Search Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737
The File Chooser Dialog Box (Linux/Solaris) . . . . . . . . . . . . . . . . . . . . . . . . . . 737
Appendix A. Debugger GUI Reference
This appendix contains detailed descriptions of the menus and toolbar buttons
available in the main Debugger window, as well as descriptions of some of the
dialog boxes you can open via these menus and buttons. Most of these items are
mentioned in the main text of this book in the context in which they are used. They
are listed here together to provide a comprehensive reference.
For information about other GUI elements of the Debugger window, including
descriptions of the target list, source pane, navigation bar, and information panes,
see Chapter 2, “The Main Debugger Window” on page 11.
Note
Some menu items, shortcuts, commands, and dialog box buttons open a
file chooser that allows you to browse to and specify a file for a particular
operation. For information about how to use a Windows file chooser, see
your Windows documentation. For information about the Linux/Solaris
file chooser, see “The File Chooser Dialog Box (Linux/Solaris)”
on page 737.
Context-sensitive menu items are dimmed if they are unavailable in your current
environment. For example, if you are debugging a running process, the Go on
Selected Items item in the Debug menu is dimmed.
The menus on the main Debugger window, from left to right, are:
On Linux/Solaris systems, selecting a printing operation from the File menu opens
the Print Setup dialog box. The settings of this dialog box are described in the
following table.
Item Meaning
Print To Specifies where to send the print output. Select either Printer (the
default) or File (to write to a PostScript file).
Print Command Specifies the print command that will be run when you click Print. Enter
the appropriate command and options for printing a file on your specific
system (for example, lpr).
You can also set the print command with the configure printCommand
command. For more information, see “The General Options Tab” in
Chapter 8, “Configuration Options” in MULTI: Managing Projects and
Configuring the IDE.
This field is only available if you have chosen the Printer radio button.
Item Meaning
Filename Specifies the output PostScript file for Print To File operations. This
field is only available if you have selected the File radio button. Enter
the name of the file to write to, or click Browse to open a dialog box
that allows you to specify the name of the file. If the file already exists,
you are prompted to confirm that it should be overwritten. (See “The
File Chooser Dialog Box (Linux/Solaris)” on page 737 for a description
of the dialog box.)
Font Name Specifies the PostScript font for your printing operations. Select your
desired font from the drop-down list, which contains a list of available
fonts on your system. You can also type a font name into this field if it
is not in the list.
Font Size Specifies the font size used for printing. Select your desired size from
the drop-down list. The default font size is 8 point.
Paper Size Specifies your paper size. Select Letter, Legal, Executive, or A4. The
default setting is Letter.
Orientation Specifies the layout for your printed document. Select Portrait or
Landscape. The default setting is Portrait.
Columns Specifies whether to print the output in one or two columns. The default
setting is 1.
Print Executes the print request.
Cancel Cancels the print request and discards any settings you have changed.
To expand the dialog box to see the I/O setting fields, click the small plus sign icon
( ) on the bottom right corner of the contracted dialog box. The expanded dialog
box is shown next.
To hide the three I/O fields, click the minus sign ( ) to the right of the line dividing
the top and bottom sections of the dialog box.
The following table describes the items in the expanded Arguments dialog box.
Item Meaning
Arguments Specifies the arguments to be passed to the current program the next
time you run it without specifying any arguments (for example, by
clicking or , or by executing the r command).
If you specify any arguments in the next execution (with the r command,
for example) the existing arguments in the Arguments field are replaced
by the ones specified. These new arguments are displayed the next time
the Arguments dialog box is opened.
Support for passing program arguments to applications started from
MULTI is target and operating system specific.
Item Meaning
The button Runs the program with the arguments specified in the Arguments text
field.
The button Restarts the process with the arguments specified in the Arguments text
field.
This button is not supported for ROM programs.
The button Closes the Arguments dialog box.
Whether this button appears on your toolbar depends on the setting of
the option Display close (x) buttons. To access this option, select Config
→ Options → General Tab.
stdin (<) Specifies a file on the host system that will be used as input to your
process. Enter a filename, or click to open a file chooser to browse
to an existing file. If this field is not specified, the input comes from the
I/O pane (stand-alone applications) or the console (native applications).
stdout (>) Specifies a file on the host system that will capture output from your
process. Enter a filename, or click to open a file chooser to browse
to an existing file. If this field is not specified, the output goes to the I/O
pane (stand-alone applications) or the console (native applications).
Start in Specifies the directory in which the process runs or, for embedded
processes that use host I/O, specifies the directory that MULTI uses to
perform host I/O operations.
Enter a directory, or click to open a directory chooser to browse to
an existing directory.
For information about the command equivalent of this field, see the
rundir command in “Run Commands” in Chapter 13, “Program
Execution Command Reference” in the MULTI: Debugging Command
Reference book.
Unless otherwise noted, see also the l (lowercase L) command in Chapter 8, “Display
and Print Command Reference” in the MULTI: Debugging Command Reference
book.
Menu Item Meaning
Files Lists the names of all source files.
Functions Lists the names and addresses of all functions.
Mangled Functions Lists the mangled names and addresses of all functions.
Globals Lists the names and addresses of all global variables, as well as static
variables that are in scope for the current file.
Statics Lists the names and addresses of all static variables.
Locals Lists the names and values of all local variables for the function you are
viewing (that is, the function at the current line pointer) if the function
is on the stack. If the function is a C++ instance method, this menu item
lists information about the this pointer as well.
Local Addresses Lists the names and addresses of the local variables specified above.
Registers Lists the names and values of all registers.
Register Synonyms Lists the register synonyms.
Variables In Opens a dialog box that allows you to specify a function, then lists all
Function the parameters and local variables of the specified function if it is on the
stack. If the function is a C++ instance method, this lists the this pointer
as well.
Defines Lists all the defined preprocessor macros.
Corresponds to: the showdef command (see “General View Commands”
in Chapter 21, “View Command Reference” in the MULTI: Debugging
Command Reference book).
MULTI Variables Lists the values of all MULTI special variables.
Processes Lists the processes that the MULTI Debugger is currently attached to.
Signals Lists the names and configuration settings of all signals.
Breakpoints Lists all software breakpoints.
Dialog Boxes Lists all loaded dialog boxes.
For information about the commands listed in the table, see Chapter 19,
“TimeMachine Command Reference” in the MULTI: Debugging Command
Reference book unless otherwise noted.
Menu Item Meaning
Load Trace Session Loads a previously saved trace session.
Corresponds to: the traceload command.
Save Trace Session Saves the trace session.
Corresponds to: the tracesave command.
Enable Trace Starts trace collection and clears any previously collected data on the
target. Data that has already been retrieved is not cleared, but if trace
retrieval is currently in progress, it is aborted.
Corresponds to: the trace enable command.
Disable Trace Stops trace collection and retrieves trace data. For more information,
see “Enabling and Disabling Trace Collection” on page 411.
Corresponds to: the trace disable command.
Retrieve Trace Retrieves trace data from the trace probe or target.
With SuperTrace Probe v3 targets, this either retrieves the amount of
data set by the Target buffer size option (see “The Collection Tab”
on page 487), or it retrieves twice as much data as has already been
retrieved. In the latter case, all previously retrieved trace data is retrieved
again.
With all other targets, all trace data is always retrieved.
Corresponds to: the trace retrieve command.
Abort Trace Aborts the retrieval of trace data.
Retrieval Corresponds to: the trace abort command.
Clear Data Clears all current trace data on the host, trace probe, and target.
Corresponds to: the trace clear command.
Set Triggers Opens the Set Triggers window, which allows you to configure trace
collection by setting triggers and other target-specific events. See “The
Set Triggers Window” on page 499.
Corresponds to: the trace triggers command.
The following are menu items that may appear in the Windows menu:
Menu Item Meaning
debug window Gives focus to a debugging-related window that has been launched from
the local executable.
application name Gives focus to the main Debugger window for the local application.
IDE tool Opens a submenu that lists windows corresponding to the IDE_tool. The
windows listed in this submenu might be created from the local execution
or from other executions.
If only one MULTI Launcher is open, that tool does not have a submenu;
it has a menu entry instead.
instructions about how to add or remove buttons from the toolbar, see “Adding,
Removing, and Rearranging Toolbar Buttons” on page 722.
Button Effect
Go Back Runs backward to the previous breakpoint or, if no previous
breakpoint exists, to the first instruction in the trace data.
Corresponds to: Alt+F5 and the bc command. For information
about this command, see “Run Commands” in Chapter 13, “Program
Execution Command Reference” in the MULTI: Debugging
Command Reference book.
Step Up Steps back up to the caller of the current function.
Corresponds to: Alt+F9 and the bcU command. For information
about this command, see “Single-Stepping Commands” in Chapter
13, “Program Execution Command Reference” in the MULTI:
Debugging Command Reference book.
Previous Steps back one line. In source display mode, clicking this button
steps back a single source line. In an assembly mode, it steps back
a single machine instruction. For more information about display
modes, see “Source Pane Display Modes” on page 24.
Corresponds to: Alt+F10 and the bprev command. For information
about this command, see “Single-Stepping Commands” in Chapter
13, “Program Execution Command Reference” in the MULTI:
Debugging Command Reference book.
Step Back Steps back one line, stepping into a function if the previous line
contains a function call.
Corresponds to: Alt+F11 and the bs command. For information
about this command, see “Single-Stepping Commands” in Chapter
13, “Program Execution Command Reference” in the MULTI:
Debugging Command Reference book.
Step (into Functions) Executes a single source line. If the line contains function calls, it
on Selected Items steps into the called functions. When in interlaced source/assembly
mode, a machine instruction is executed instead of a source line.
Corresponds to: Debug → Step (into Functions) on Selected
Items, F11, and the s command. For information about this
command, see “Single-Stepping Commands” in Chapter 13,
“Program Execution Command Reference” in the MULTI:
Debugging Command Reference book.
Button Effect
Next (over Functions) Executes until the next source line of the current function (that is,
on Selected Items steps over function calls). When in interlaced source/assembly
mode, executes until the next machine instruction of the current
function.
Corresponds to: Debug → Next (over Functions) on Selected
Items, F10, and the n command. For information about this
command, see “Single-Stepping Commands” in Chapter 13,
“Program Execution Command Reference” in the MULTI:
Debugging Command Reference book.
Return on Selected Continues to the end of the current function, and stops in the calling
Items function after returning to it.
Corresponds to: Debug → Return on Selected Items, F9, and the
cU command. For information about this command, see “Continue
Commands” in Chapter 13, “Program Execution Command
Reference” in the MULTI: Debugging Command Reference book.
Go on Selected Items Begins execution of the program. If the process is stopped, this
button continues execution.
Corresponds to: Debug → Go on Selected Items, F5, and the c
command. For information about this command, see “Continue
Commands” in Chapter 13, “Program Execution Command
Reference” in the MULTI: Debugging Command Reference book.
Halt on Selected Halts program execution.
Items Corresponds to: Debug → Halt on Selected Items and the halt
command. For information about this command, see “Halt
Commands” in Chapter 13, “Program Execution Command
Reference” in the MULTI: Debugging Command Reference book.
Restart Restarts the process with the same arguments as before.
If you click this button while debugging a Dynamic Download
INTEGRITY application, MULTI attempts to (re)load the
application. This button may not be available for relocatable
modules.
This button is not supported for ROM programs.
Corresponds to: Debug → Restart, Ctrl+Shift+F5, and the restart
command. For information about this command, see “Run
Commands” in Chapter 13, “Program Execution Command
Reference” in the MULTI: Debugging Command Reference book.
Button Effect
Prepare Target Automatically prepares your target or opens the Prepare Target
dialog box, which allows you to download your program, flash your
program, or verify that your program is present on the target. For
more information, see “Preparing Your Target” on page 110.
This button may not be available for relocatable modules.
Corresponds to: Debug → Prepare Target and the prepare_target
command. For information about this command, see “General Target
Connection Commands” in Chapter 17, “Target Connection
Command Reference” in the MULTI: Debugging Command
Reference book.
Reset Resets the target board. This button is only available when you are
connected to a target that supports being reset by the Debugger.
Corresponds to: the reset command. For information about this
command, see “General Target Connection Commands” in Chapter
17, “Target Connection Command Reference” in the MULTI:
Debugging Command Reference book.
Reload Symbols Reloads the current executable.
Corresponds to: the debug command. For information about this
command, see Chapter 2, “General Debugger Command Reference”
in the MULTI: Debugging Command Reference book.
Assembly Toggles between displaying source code only and source interlaced
with assembly code. This button appears to be pushed down if any
assembly instructions are displayed.
Corresponds to: View → Display Mode → Source Only, View →
Display Mode → Interlaced Assembly, and the assem command.
For information about this command, see Chapter 8, “Display and
Print Command Reference” in the MULTI: Debugging Command
Reference book.
Program Counter Displays the current program counter (PC) in the source pane.
Corresponds to: View → Navigation → Current PC and the E
command. For information about this command, see Chapter 8,
“Display and Print Command Reference” in the MULTI: Debugging
Command Reference book.
Upstack Displays the function up one stack frame. Hold this button down
to access a menu that allows you to go to any level in the call stack.
Corresponds to: View → Navigation → UpStack, Ctrl++, and the
E+ command. For information about this command, see Chapter
8, “Display and Print Command Reference” in the MULTI:
Debugging Command Reference book.
Button Effect
Downstack Displays the function down one stack frame. Hold this button down
to access a menu that allows you to go to any level in the call stack.
Corresponds to: View → Navigation → DownStack, Ctrl+–, and
the E- command. For information about this command, see Chapter
8, “Display and Print Command Reference” in the MULTI:
Debugging Command Reference book.
Call Stack Displays the call stack in the Call Stack window. See also “Viewing
Call Stacks” on page 394.
Corresponds to: View → Call Stack and the callsview command.
For information about this command, see Chapter 5, “Call Stack
Command Reference” in the MULTI: Debugging Command
Reference book.
Breakpoints Displays the Breakpoints window, which you can use to add and
edit breakpoints. See “Viewing Breakpoint and Tracepoint
Information” on page 129.
Corresponds to: View → Breakpoints and the breakpoints
command. For information about this command, see Chapter 3,
“Breakpoint Command Reference” in the MULTI: Debugging
Command Reference book.
Memory Opens a new Memory View window. See Chapter 15, “Using the
Memory View Window” on page 337.
Corresponds to: View → Memory and the memview command.
For information about this command, see “General View
Commands” in Chapter 21, “View Command Reference” in the
MULTI: Debugging Command Reference book.
Registers Displays the Register View window, which shows machine
registers. See Chapter 13, “Using the Register Explorer” on page 261.
Corresponds to: View → Registers and the regview command. For
information about this command, see “Register Commands” in
Chapter 14, “Register Command Reference” in the MULTI:
Debugging Command Reference book.
Locals Displays local variables in a Data Explorer. For more information,
see “Displaying Local Variables” on page 191.
Corresponds to: View → Local Variables, the view $locals$
command, and the localsview command. For information about
these commands, see “General View Commands” in Chapter 21,
“View Command Reference” in the MULTI: Debugging Command
Reference book.
Button Effect
Connect Opens the Connection Chooser, which allows you to create, edit,
or choose a Connection Method to connect to your target. See
“Creating a Standard Connection Using the Connection Chooser”
on page 43.
Corresponds to: Target → Connect, F4, and the connect command.
For information about this command, see “General Target
Connection Commands” in Chapter 17, “Target Connection
Command Reference” in the MULTI: Debugging Command
Reference book.
Disconnect Disconnects from the currently selected target.
Corresponds to: Target → Disconnect from Target and the
disconnect command. For information about this command, see
“General Target Connection Commands” in Chapter 17, “Target
Connection Command Reference” in the MULTI: Debugging
Command Reference book.
Edit Opens an Editor window at the currently viewed location in the
source pane.
Corresponds to: Tools → Editor and the edit command. For
information about this command, see “General View Commands”
in Chapter 21, “View Command Reference” in the MULTI:
Debugging Command Reference book.
TimeMachine Enables/disables TimeMachine mode. For more information, see
Debugger Part IV. TimeMachine Debugging on page 405.
Corresponds to: TimeMachine → TimeMachine
Debugger/TimeMachine → Leave TimeMachine Mode and the
timemachine command. For information about this command, see
Chapter 19, “TimeMachine Command Reference” in the MULTI:
Debugging Command Reference book.
OSA Explorer Opens the OSA Explorer on the RTOS running on the target. This
button is only available for some RTOSes.
Corresponds to: View → OSA Explorer and the osaexplorer
command. For information about this command, see “Object
Structure Awareness (OSA) Commands” in Chapter 15, “Scripting
Command Reference” in the MULTI: Debugging Command
Reference book.
Dump and Show Dumps the event log and displays events in the MULTI
Events EventAnalyzer. This button is only available for some RTOSes.
Button Effect
MULTI Launches the MULTI EventAnalyzer. This button is only available
EventAnalyzer for some RTOSes.
Corresponds to: Tools → MULTI EventAnalyzer
MULTI Launches the MULTI ResourceAnalyzer. This button is only
ResourceAnalyzer available if you are using INTEGRITY.
Corresponds to: Tools → MULTI ResourceAnalyzer
OSA Viewer Launches the OSA Object Viewer on the object currently selected
in the target list. If multiple items are selected in the target list, the
OSA Object Viewer displays information for the entire INTEGRITY
target. This button is visible only if you are debugging a run-mode
connection and using INTEGRITY version 10 or later.
Corresponds to: the osaview -context command if one item is
selected in the target list.
Corresponds to: the osaview command if multiple items are selected
in the target list.
For information about this command, see “Object Structure
Awareness (OSA) Commands” in Chapter 15, “Scripting Command
Reference” in the MULTI: Debugging Command Reference book.
Close Debugger Quits the MULTI Debugger. If you are debugging a process, MULTI
gives you the choice to Quit and kill process or Detach from
process.
Whether this button appears on your toolbar depends on the setting
of the option Display close (x) buttons. To access this option, select
Config → Options → General Tab.
Corresponds to: File → Close Debugger Window, Ctrl+Q, and
the quit window command. For information about this command,
see Chapter 2, “General Debugger Command Reference” in the
MULTI: Debugging Command Reference book.
For information about the buttons that appear to the right of the target list's Status
column, see “Repositioning and Hiding the Target List” on page 15 and “The Star
Column” on page 18.
The pane on the left side of the window—Debugger Toolbar—displays all the
buttons that may currently appear on your toolbar. If your toolbar does not contain
all the buttons located in the Debugger Toolbar pane, your current debugging
environment does not support them. For information about these buttons, see “The
Debugger Window Toolbar” on page 715. The pane on the right side of the
window—Available Buttons—displays a comprehensive set of pre-defined buttons
that you can add to your toolbar. For a description of these buttons, see the next
section.
The following list provides instructions for using the Customize Toolbar window.
2. In the dialog box that appears, select a button icon from the Icon pane. Fill
in the Button Name text field with the text you want to appear in a tooltip
when the cursor moves over the button, the Command text field with the
command you want to execute when you click the button, and the Help String
text field with the text you want to appear at the bottom of the Debugger window
when the cursor moves over the button.
3. Click OK.
4. Your new button appears in the Available Buttons pane. Drag it to the
desired location in the Debugger Toolbar pane.
5. Click OK.
• To edit a custom button:
1. Drag the button to the Available Buttons pane if it is not already there.
3. Click OK.
4. To add the button to the toolbar, drag it to the desired location in the
Debugger Toolbar pane.
5. Click OK.
Modifications that you make to the toolbar through the Customize Toolbar window
are saved by default.
You can edit the button.odb configuration file to make the same toolbar changes
that are detailed above. The button.odb file is located in:
Within the current MULTI session, you can reprogram any of the pre-defined
Debugger toolbar buttons except the Close Debugger button ( ). You can define
a button's name, command string, corresponding icon (optional), etc. by entering
the debugbutton command with appropriate arguments. For more information
about this command, see Chapter 7, “Configuring and Customizing MULTI” in the
MULTI: Managing Projects and Configuring the IDE book.
Pre-Defined Buttons
There are a number of pre-defined buttons that you can add to the Debugger toolbar
via the Customize Toolbar window (see “Adding, Removing, and Rearranging
Toolbar Buttons” on page 722). The following table contains descriptions of these
buttons.
Button Effect
Separator Adds a vertical bar between adjacent icons on the toolbar.
Delete all view Closes all Data Explorers and Register View, Call Stack,
windows Breakpoints, Memory View, and Browse windows.
Corresponds to: View → Close All Views and the viewdel
command. For information about this command, see “General View
Commands” in Chapter 21, “View Command Reference” in the
MULTI: Debugging Command Reference book.
Button Effect
Download Program Loads the current program into the target system's memory if the
target supports and was configured with a dynamic loader (for
example, the LoaderTask on INTEGRITY).
Corresponds to: the load -setup command. For information about
this command, see “General Target Connection Commands” in
Chapter 17, “Target Connection Command Reference” in the
MULTI: Debugging Command Reference book.
Go to next selected Returns to the next location in the trace navigation history. This
location in trace data button is only available if you have previously clicked the Go to
previous selected location in trace data button (described next).
Corresponds to: the trace history + command. For information
about this command, see Chapter 19, “TimeMachine Command
Reference” in the MULTI: Debugging Command Reference book.
Go to previous Returns to the previous location in the trace navigation history. This
selected location in trace can be useful if you want to undo an action (such as running or
data stepping backwards in the TimeMachine Debugger) that brought
you to an unexpected location in your source code.
Corresponds to: the trace history - command. For information
about this command, see Chapter 19, “TimeMachine Command
Reference” in the MULTI: Debugging Command Reference book.
Only show starred, Toggles the exclusive display of starred target list entries, their
selected, or stopped ancestors, the currently selected target list entry, and stopped entries.
items Corresponds to: the target list button (Only show starred items)
and the star toggle command. For information about this command,
see “General Configuration Commands” in Chapter 6,
“Configuration Command Reference” in the MULTI: Debugging
Command Reference book.
Open project Opens a Project Manager on the current project.
manager for current Corresponds to: Tools → Project Manager and the builder
project command. For information about this command, see Chapter 4,
“Building Command Reference” in the MULTI: Debugging
Command Reference book.
Start collecting trace Toggles collection of trace data. The button appears to be pushed
data down while trace data is being collected.
Corresponds to: TimeMachine → Enable/Disable Trace and trace
toggle command. For information about this command, see Chapter
19, “TimeMachine Command Reference” in the MULTI: Debugging
Command Reference book.
Note
This is the default behavior. If you have configured a right-click to
perform other functions, the shortcut menu will not appear.
This menu is context sensitive and depends on the object (such as a function, type,
or variable) you right-click. Some menu items may appear dimmed, indicating that
they are unavailable in the current context.
In the following shortcut menu discussion, the term “right-clicked line” refers to
the source line where the right-click occurred.
The following table describes the selections available from the Trace submenu.
Menu Item Meaning
Trace Around This Sets the trigger event to be any execution of the selected line and enables
Line trace. See “Configuring Trace Directly from MULTI” on page 496.
Browse Traced After collecting trace data, displays a list showing each time the selected
Executions source line was executed and stored in trace data. See “The Trace
Instruction Browser” on page 461.
The following table describes the selections available from the Set Breakpoint
submenu.
Menu Item Meaning
Set Breakpoint Sets a software breakpoint.
See also the b command in Chapter 3, “Breakpoint Command Reference”
in the MULTI: Debugging Command Reference book
Set And Edit Opens the Software Breakpoint Editor window, which allows you to
specify and set a software breakpoint. See the editswbp command in
Chapter 3, “Breakpoint Command Reference” in the MULTI: Debugging
Command Reference book.
Set Jump Queries for a location to jump to when the breakpoint is hit and sets a
Breakpoint jump breakpoint. A jump breakpoint executes the g location;resume;
commands when it is reached. For information about the g command,
see “General Program Execution Commands” in Chapter 13, “Program
Execution Command Reference” in the MULTI: Debugging Command
Reference book. For information about the resume command, see
Chapter 3, “Breakpoint Command Reference” in the MULTI: Debugging
Command Reference book.
The following table lists the entries in the Browse Other submenu.
Menu Item Meaning
Browse Callers Opens a Browse window displaying the callers of the function.
Browse Callees Opens a Browse window displaying the callees of the function.
Browse Static Calls Opens a Tree Browser window displaying the static call graph of the
function (which shows its callers and callees and their callers and callees).
See “The Tree Browser Window” on page 249.
For more information about collecting trace data, see “Enabling and Disabling Trace
Collection” on page 411.
The following table lists the entries in the Browse Other submenu.
Menu Item Meaning
Browse Shows the type's super-classes in a Browse window.
Superclasses
Browse Subclasses Shows the type's sub-classes in a Browse window.
Browse Class Opens a tree browser window to show class hierarchy information. See
Hierarchy “The Tree Browser Window” on page 249.
The toggle buttons in this window are the same as those in the Editor's search dialog
box.
To initiate or repeat searches without the search dialog box, you can also use the
Ctrl+F or Ctrl+B key sequences in the command pane.
The title bar of the file chooser will vary depending on the action you are performing.
The following table describes the main elements of the file chooser.
Item Meaning
Directory Displays the directory whose contents are shown in the File List. Type
in a new directory name and press Enter to display a different directory.
Directory Buttons With this set of buttons, you can quickly go to different important
directories. The buttons that appear are:
— Up One Directory from the current directory.
— Jumps to the current Working Directory.
— Jumps to the IDE Installation Directory.
— Jumps to the User Home Directory.
File List Below the directory text field is the file list. To enter a directory,
double-click the directory. To choose a file, single-click the filename.
You can click any column header to sort the list in ascending or
descending order.
If multiple files are allowed for the present operation (for example, Open
is selected in the editor menu), use the Shift key to select a consecutive
list of files; use the Ctrl key to select non-consecutive files.
Filename Type a filename or directory name into this text field. As you type in
this field, the selection in the file list will change to reflect the closest
match. If you type a directory name and press Enter, or follow the
directory name by a slash (/), the file list will change to the specified
directory.
Item Meaning
File type If you select a file type, the File List will only display files with suffixes
that match the selected file type.
Action buttons There are two buttons in the lower right corner of the file chooser
window. The upper button displays the action that will occur, such as
Edit (in the example above), OK, or Open. The lower button is the
Cancel button, which closes the window without taking any action.
Contents
Main Debugger Window Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742
Source Pane Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 743
Command Pane Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 744
Appendix B. Keyboard Shortcut Reference
Note
If you have clicked in the source pane or command pane, these shortcuts
may have different effects. See “Source Pane Shortcuts” on page 743 and
“Command Pane Shortcuts” on page 744.
Shortcut Effect
F1 Displays help about the current window.
Corresponds to: the help command (see Chapter 9, “Help and
Information Command Reference” in the MULTI: Debugging Command
Reference book).
F4 Opens the Connection Chooser, which allows you to create, edit, or
choose a Connection Method to connect to your target. See “Creating
a Standard Connection Using the Connection Chooser” on page 43.
Corresponds to: and the connect command (see “General Target
Connection Commands” in Chapter 17, “Target Connection Command
Reference” in the MULTI: Debugging Command Reference book).
F5 Begins execution of the program. If the process is stopped, it continues
execution.
Corresponds to: and the c command (see “Continue Commands” in
Chapter 13, “Program Execution Command Reference” in the MULTI:
Debugging Command Reference book).
Ctrl+Shift+F5 Restarts the process with the same arguments as before.
If you use this shortcut while debugging a Dynamic Download
INTEGRITY application, MULTI attempts to (re)load the application.
This shortcut may not be available for use with relocatable modules.
This shortcut is not supported for ROM programs.
Corresponds to: and the restart command (see “Run Commands”
in Chapter 13, “Program Execution Command Reference” in the
MULTI: Debugging Command Reference book).
Shortcut Effect
F9 Continues to the end of the current function, and stops in the calling
function after returning to it.
Corresponds to: and the cU command (see “Continue Commands”
in Chapter 13, “Program Execution Command Reference” in the
MULTI: Debugging Command Reference book).
F10 Executes until the next source line of the current function (that is, steps
over function calls). When in interlaced source/assembly mode, a
machine instruction is executed instead of a source line.
Corresponds to: and the n command (see “Single-Stepping
Commands” in Chapter 13, “Program Execution Command Reference”
in the MULTI: Debugging Command Reference book).
F11 Executes a single source line. If the line contains function calls, it steps
into the called functions. When in interlaced source/assembly mode, a
machine instruction is executed instead of a source line.
Corresponds to: and the s command (see “Single-Stepping
Commands” in Chapter 13, “Program Execution Command Reference”
in the MULTI: Debugging Command Reference book).
Ctrl++ Displays the function up one stack frame.
Corresponds to: and the E + command (see Chapter 8, “Display and
Print Command Reference” in the MULTI: Debugging Command
Reference book).
Ctrl+– Displays the function down one stack frame.
Corresponds to: and the E - command (see Chapter 8, “Display and
Print Command Reference” in the MULTI: Debugging Command
Reference book).
Shortcut Effect
Ctrl+B Search backward in the source pane.
Esc Abort current operation or halt process.
Shortcut Effect
Click with the right Opens a shortcut menu for the command pane. For a full description
mouse button of the shortcut menu, see “The Command Pane Shortcut Menu”
on page 736.
Contents
Using a Specification File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 753
Appendix C. Command Line Reference
The following command line options can be used when starting MULTI from the
command line, as described in “Starting the Debugger in GUI Mode” on page 6.
-- args
Passes all the arguments that follow the double dash to the program being debugged as though
the arguments were set with the setargs command.
For more information, see the setargs command in “General Program Execution Commands”
in Chapter 13, “Program Execution Command Reference” in the MULTI: Debugging Command
Reference book.
-build file
Opens the Project Manager on default.gpj in your current working directory and starts building
file, which may be anything you can build within default.gpj.
The Debugger does not open when you use this option, so you should not specify a program to
debug.
-c file
-config file
-configure file
Configures MULTI using the information in the configuration file file.
For more information, see “Creating and Editing Configuration Files” in Chapter 7, “Configuring
and Customizing MULTI” in the MULTI: Managing Projects and Configuring the IDE book.
-C core_file
Linux/Solaris only
Specifies the core file, where core_file is a Linux/Solaris core image of the program to be
debugged. For more information, see Appendix H, “Debugging Linux/Solaris Core Files”
on page 831.
-cmd commands
Runs the specified commands when the Debugger is up.
-E file
Opens the Debugger on multiple files. Use this option for each file after the first that you want
to debug. For example, if you want to debug foo, bar, and baz, use the command:
multi foo -E bar -E baz
This opens a single Debugger window and lists foo, bar, and baz in the target list of that window.
The maximum number of files you can specify is 256. The first file you specify, which is not
preceded by -E, is included in this maximum number.
-h
Displays a concise description of all command line options. This is equivalent to the -usage
option (below).
-H
-help
Opens the MULTI Help Viewer on the MULTI: Debugging book.
-I directory
(This option is a capital letter “i.”)
Names an alternative directory for the Debugger to search for files in. You can specify multiple
alternative directories by using multiple -I directory arguments. The Debugger searches
alternative directories in the order given. If it does not find a file in the specified alternative
directory or directories, it also searches the current directory.
See also the -D command line option earlier in this table and the source command in “General
Configuration Commands” in Chapter 6, “Configuration Command Reference” in the MULTI:
Debugging Command Reference book.
-m file
Sets file as the default specification file.
For more information, see “Using a Specification File” on page 753.
-nocfg
Causes MULTI to ignore all .cfg files on startup.
-nodisplay
Linux/Solaris only
Specifies that the Debugger will open in non-GUI mode.
For more information, see “Starting the Debugger in Non-GUI Mode (Linux/Solaris only)”
on page 8.
-R file
Records commands and output to file.
For more information, see “Record and Playback Commands” in Chapter 15, “Scripting
Command Reference” in the MULTI: Debugging Command Reference book.
-rc file
Executes the command script file when an executable is first opened in the Debugger. If
multiple executables are opened as with the -E option (above), file executes only when the
first executable opens.
Global and user script files execute before file.
For more information, see “Using Script Files” in Chapter 7, “Configuring and Customizing
MULTI” in the MULTI: Managing Projects and Configuring the IDE book.
-RO file
Records output to file. (Commands are not recorded.)
For more information, see “Record and Playback Commands” in Chapter 15, “Scripting
Command Reference” in the MULTI: Debugging Command Reference book.
-run debug_server [-timeout=num] --
Connects to debug_server, runs program in the Debugger (see “Starting the Debugger in
GUI Mode” on page 6), runs any commands specified on the command line or in any relevant
MULTI script files, and then exits.
-timeout specifies the number of seconds until the operation times out. On Windows and
Linux, the default is 600; on Solaris, the default is 2400. The maximum value of num is 231/1000.
If num is -1, the operation never times out.
This option should be specified after other options and before program (see “Starting the
Debugger in GUI Mode” on page 6).
-servertimeout time
Sets the default debug server timeout to time seconds.
-socket port
Starts a socket server on the port port. An external program that connects to the socket server
can send commands to the Debugger and receive output from the Debugger.
For more information, see “socket” in Chapter 15, “Scripting Command Reference” in MULTI:
Debugging Command Reference.
-text offset
Sets the default offset for all text addresses to offset, which is assumed to be in decimal unless
preceded by 0x. Do not set offset to -1. This option is only useful when debugging programs
built with position-independent code; it should not be used with other kinds of programs.
-top
Native targets only
Opens the Process Viewer, which displays a snapshot of the processes running on your native
target and allows you to attach to native processes. For more information, see “Viewing Native
Processes” on page 396.
-tv file
Specifies the task view configuration file for run-mode debugging.
For more information about task view configuration files, see “Task Group Configuration File”
on page 541.
-usage
Displays a concise description of all command line options. This is equivalent to the -h option
(above).
-V
Prints Debugger version information.
Your specification file should have an .mc extension. To indicate the command line
arguments associated with an executable, type the name of the executable followed
by a space and the list of command line arguments, all on a single line. If you need
to continue a list of arguments on a second line, the second line must begin with a
tab. To create a list of commands for another executable, begin a new line and enter
the executable name followed by a space and the list of command line options. For
example, a specification file that uses separate command line arguments when
debugging foo and when debugging bar might contain the following lines.
Windows:
Linux/Solaris:
To use a specification file, pass the -m file option and launch the MULTI Debugger
from the command line. This results in MULTI searching the specified file for a
line that begins with the name of the executable on which you are opening the
Debugger. If it finds a line that begins with the executable name, the Debugger uses
the specified command line options on that line when it opens on the program. For
example, if the specification file albatross.mc contains the lines given above,
entering the command:
multi -m albatross.mc foo
has the same effect on your operating system as entering one of the following
commands.
Contents
Using the Debugger with Third-Party Compilers . . . . . . . . . . . . . . . . . . . . . . . 756
Running Third-Party Tools from the Debugger . . . . . . . . . . . . . . . . . . . . . . . . . 757
Using MULTI with Rhapsody . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 758
Appendix D. Using Third-Party Tools with the MULTI Debugger
This appendix describes how to use various third-party tools with the MULTI
Debugger.
If you have licensed one of the Green Hills Debug Translators, you can configure
MULTI to automatically convert DWARF or Stabs debugging information when
an executable compiled entirely by a third-party compiler that generates that type
of information is loaded into the Debugger. To enable automatic conversion:
For more information, including instructions about what to do if you compiled some
of the object files of your executable with a third-party compiler and others with a
Green Hills Software compiler, see the documentation about generating debugging
information for applications compiled with third-party compilers in the MULTI:
Building Applications book.
To display the contents of output files produced by third-party tools, issue the cat
file command. The Debugger displays the contents of file in the command pane.
For information about the cat command, see Chapter 8, “Display and Print Command
Reference” in the MULTI: Debugging Command Reference book.
If you have the make utility installed on your system, you can use it to build
programs from within the MULTI Debugger by issuing the Debugger's make
command. For information about the make command, see “External Tool
Commands” in Chapter 15, “Scripting Command Reference” in the MULTI:
Debugging Command Reference book.
You can configure the MULTI IDE to invoke the editor of your choice instead of
the MULTI Editor. For more information, see “Third-Party Editor Configuration
Options” in Chapter 8, “Configuration Options” in the MULTI: Managing Projects
and Configuring the IDE book.
Ultimately, the integration between these two tools provides automation and a
seamless path from phases such as requirements analysis, UML design, and
model-driven development through to code generation, compilation, loading,
running, debugging, validation, and testing.
Supported Environments
At the time of writing, supported versions of Rhapsody are:
• 7.5.1
• 7.5.3
• INTEGRITY 10 and 5
○ Power Architecture, ColdFire, ARM, MIPS, x86
Note
While INTEGRITY 10 is supported, the Rhapsody GUIs only refer
to INTEGRITY 5.
Integration Description
The three significant points of integration between Rhapsody and MULTI can be
summarized as follows:
• Build — Rhapsody can generate source files and the necessary MULTI project
files (.gpj files) and invoke the build processes automatically.
• Target — The Rhapsody Adapters (framework libraries) provide the adaptation
layer between the generated model and the underlying OS, such as INTEGRITY.
The Adapters take into account the Green Hills Compiler and are customized
for the underlying OS.
• Debug — Rhapsody provides model-level debugging called Animation, whereas
MULTI provides source-level debugging. While these debugging methods can
be used independently and effectively, the integration provides the additional
capability to synchronize them.
The Rhapsody installer records the location of the Compiler and/or INTEGRITY
directories in one or more .bat files located in the Rhapsody\Share\etc directory
(depending upon your target environment and versions of tools). They include
Integrity5Make.bat and Integrity5MakefileGenerator.bat. If you enter the wrong
directory during installation, or if the Compiler or INTEGRITY directories are
subsequently moved, you may manually correct these files.
The Rhapsody build system for INTEGRITY requires the following system
environment variables to be set when you run Rhapsody:
Licensing
Standard MULTI and Compiler licenses are required for MULTI and the Green
Hills Compilers, respectively. To enable the synchronous debugging functionality,
MULTI requires the additional “Rhapsody Integration License.” If you do not
already have these licenses, contact your Green Hills sales representative to obtain
them.
Additional Notes
Much of the information in the following sections is covered by Rhapsody
documentation, but some highlights are presented here.
The resulting Adapter libraries are linked into your models when you build them.
From the command line, build the OXF framework libraries for an ISIM ARM
target. Using your particular Compiler and INTEGRITY directories, enter:
> cd Rhapsody\Share\LangCpp
> IntegrityBuild C:\GHS\intxxxx simarm C:\ghs\comp_xxxxxx –trg arm_integrity.tgt
Contents
Using MULTI Data Visualization (.mdv) Files . . . . . . . . . . . . . . . . . . . . . . . . . 769
Invoking Customized Data Visualizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 772
MULTI Data Visualization (.mdv) File Format . . . . . . . . . . . . . . . . . . . . . . . . . 773
Appendix E. Creating Custom Data Visualizations
MULTI data visualization (.mdv) files can be used to create customized views
which display certain types of variables according to your specifications. Depending
upon the types of data you want to display, and your specific settings, these custom
views will be shown in the Data Explorer or Graph View windows. The following
two examples use custom visualizations to define the way data types are displayed.
A linked list using the following structure definition in your source code:
struct ListType {
int value;
struct ListType* next;
}
A binary tree using the following structure definition in your source code:
struct TreeNode {
int value;
struct TreeNode *left, *right;
}
• Data descriptions are the basic building blocks of custom data visualizations.
They describe how MULTI should display variables of a particular type.
You can create multiple profiles, but only one profile can be active at a time.
Custom visualizations are only available for the variables described in the
active profile or in no profile. (Data descriptions that are not included in a
profile are considered to be part of a global profile that is always accessible.)
You can change profiles easily by using the dvprofile prof_name command.
For information about the dvprofile command, see “Data Visualization
Commands” in Chapter 21, “View Command Reference” in the MULTI:
Debugging Command Reference book.
• View descriptions specify a configuration of profiles to use for displaying
variables in a Graph View window. These allow you to specify a profile to be
active during evaluation of the view. They also allow you to create a “dual
pane” display, where selecting an object in the first pane causes a new graph
rooted on that object to be displayed in the second pane, using a different profile
and therefore potentially providing a different view of the data.
data_descriptions {
data_desc_name_1 {
signature = {"sig1", "sig2", ... }
[required_fields = {"field1", "field2", ... }]
type = "data_desc_type"
[predicate = "pred"]
[required and optional fields depending on type]...
}
...
}
}
unique_view_id {
initial_pane = "pane_name"
default_root = "def_root_view"
[tab_name = "tab"]
panes {
pane_name1 {
profile_name = "prof_name1"
[child_pane = "child_pane_name1"]
}
...
}
}
For an example .mdv file, see “.mdv File Examples” on page 796.
dvload filename
where filename is the name of a custom MULTI data visualization (.mdv) file.
You can load multiple .mdv files by issuing this command repeatedly, once for
each file you want to load. If the file is specified with a relative path, MULTI
searches for it in the user configuration directory, then in the Compiler installation's
configuration directory, and finally in the IDE installation's configuration directory.
All of the data descriptions, profile descriptions, and view descriptions included in
all loaded .mdv files will be available during your MULTI session, but will not
persist across re-launches. However, only those data descriptions contained in the
active profile or in no profile will be accessible for viewing, and only one profile
can be active at a time. These are the data descriptions that MULTI will match your
program data against when selecting data to be displayed in your custom view.
(You can change the active profile to any profile in a loaded .mdv file by issuing
the dvprofile prof_name command. See “Profile Descriptions” on page 792.)
To clear MULTI data visualization files you have loaded, use the following
command:
dvclear
The graph data description type, on the other hand, describes how to display a
graphical representation of the variable in a Graph View window (see “The Graph
View Window” on page 256). Data descriptions with the
use_for_print_and_view field set to false are also not used when viewing a
variable in a Data Explorer or printing to the Debugger command pane. They are
typically used to define containers that are used in graph data description types.
For example, the children of a node can be specified in a container, which would
need a corresponding data description.
For information about how MULTI matches a data description to a variable, see
“Data Descriptions” on page 773.
To view the graphical representation of data for which you have graph data
descriptions, use one of the following methods:
• Right-click a variable and select Graph Data from the shortcut menu that
appears. If you have right-clicked a variable matching a graph data description,
MULTI will create a graph of objects based on the data description, and display
it in a Graph View window. The graph will be rooted on the clicked variable.
If no data description is found for the variable's type, the text of the node will
be the output of print variable.
• Right-click in the Debugger source pane and select Display Program
Visualizations or enter the command dataview in the Debugger command
pane (see “Data Visualization Commands” in Chapter 21, “View Command
Reference” in the MULTI: Debugging Command Reference book). This will
display a graph with one tab for each defined custom view description, using
the default root and profile specified for each view.
This will open a graph displaying the specified profile (prof_name) or view
(view_name). The graph will use the default root (def_root_prof or
def_root_view) specified in the profile or view description.
Note
Many of the fields used to describe data types, profiles, and views in
.mdv files take expressions. See “Using Expressions in MULTI Data
Visualization (.mdv) Files” on page 796 for information about valid
expressions.
Data Descriptions
Data descriptions describe how data is accessed for a particular type. A data
description has the following format (lines enclosed in square brackets are optional;
the square brackets are not part of the syntax, but the curly brackets are):
data_desc_name {
signature = {"sig1", "sig2", ... }
[required_fields = {"field1", "field2", ... }]
type = "data_desc_type"
[predicate = "pred"]
[required and optional fields depending on type]
}
The meaning of the elements in this format are described in the following table.
data_desc_name
Uniquely identifies the data description. Data descriptions with the same name will overwrite
each other.
signature = {"sig1", "sig2", ... }
Specifies the signature or signatures (sig1, sig2, etc.) of the data type being described in the
data description. The signature is used to match against the type of a variable, to determine
whether the data description should be used for the variable. Wildcards can be used when
matching. For example, to match an STL list, use the format:
signature = {"std::list<*>"}
To match objects or pointers of either type DeviceType1 or DeviceType2, use the format:
signature = {"DeviceType1", "DeviceType2"}
Variables are always cast to derived types and dereferenced before being used in a data
description.
This field is required.
required_fields = {"field1", "field2", ... }
Specifies a list of fields (field1, field2, etc.) that must be present in the type to match this
data description. This line is not required, but specifying required fields can be useful for sanity
checking.
type = "data_desc_type"
Specifies what type of data description is being defined, where data_desc_type is one of the
following:
• container
• list
• null_terminated_list
• circular_list
• binary_tree
• structure
• alias
• singleton
• function_definer
• graph
See “Data Description Types and Their Type-Specific Fields” on page 776 for more information
about each data type.
This field is required.
predicate = "pred"
Specifies a predicate expression to determine whether the data description should be used. For
example, if this data description should only be used when the value field of the struct is 0,
the predicate line of the description would be:
predicate = "return self.value == 0"
Specifies required and optional fields according to the type of data description. See the following
sections for a description of the required and optional fields for each data type.
When checking whether a data description matches the variable, MULTI first casts
the variable to its derived type. Then MULTI compares the type name to the
signature entries in the data description. If the type name matches, MULTI checks
that all fields listed in required_fields are present in the structure, and then
evaluates the predicate expression, if any. If the type matches the signature,
required_fields, and the predicate expression returns true, the data
description is used to display that type.
Tip
If extra information about the parent structure is needed by an iterator,
set a MULTI special variable to contain this information in the
begin_iter expression (see below).
The type-specific fields for the container data description type are described in
the following table.
size = "size_expr"
Specifies an expression, size_expr, that returns an integer value that equals the number of
elements in the container.
This field is required.
begin_iter = "begin_iter_expr"
Specifies an expression, next_iter_expr, that is used to retrieve the next iterator from the
current iterator. In this expression, the self variable refers to the current iterator, not to the
original structure.
For example, for a list, this line might be:
next_iter = "return self.next"
Specifies whether the data description should be used for displaying the type in Data Explorers
and when printing, where bool_expr is either true or false.
Defining this field is optional. It defaults to true, which causes the graph description to be used
for graph views and print views. In most situations, this setting should not be changed; however,
there may be times when you need to set up a container data description to support another data
description (particularly in graph data descriptions), but do not want the container to display
in a Data Explorer.
next = "next"
termination_condition = "return &self == &EndOfListNode"
}
The type-specific fields for data descriptions for lists are described in the table
below.
next = "next_field_name"
Specifies next_field_name as the field within the type that points to the next element in the
list.
This line is required.
termination_condition = "term_condition_expr"
Specifies the expression term_condition_expr as the condition that ends the list.
This field is required.
use_for_print_and_view = bool_expr
Specifies whether the data description should be used for displaying the type in Data Explorers
and when printing, where bool_expr is either true or false.
Defining this field is optional. It defaults to true, which causes the graph description to be used
for graph views and print views. In most situations, this setting should not be changed; however,
there may be times when you need to set up a container data description to support another data
description (particularly in graph data descriptions), but do not want the container to display
in a Data Explorer.
next = "next"
}
The type-specific fields for data descriptions for null-terminated lists are described
in the table below.
next = "next_field_name"
Specifies next_field_name as the field within the type that points to the next element in the
list.
This line is required.
use_for_print_and_view = bool_expr
Specifies whether the data description should be used for displaying the type in Data Explorers
and when printing, where bool_expr is either true or false.
Defining this field is optional. It defaults to true, which causes the graph description to be used
for graph views and print views. In most situations, this setting should not be changed; however,
there may be times when you need to set up a container data description to support another data
description (particularly in graph data descriptions), but do not want the container to display
in a Data Explorer.
next = "next"
}
The type-specific fields for data descriptions for circular lists are described in the
table below.
next = "next_field_name"
Specifies next_field_name as the field within the type that points to the next element in the
list.
This line is required.
use_for_print_and_view = bool_expr
Specifies whether the data description should be used for displaying the type in Data Explorers
and when printing, where bool_expr is either true or false.
Defining this field is optional. It defaults to true, which causes the graph description to be used
for graph views and print views. In most situations, this setting should not be changed; however,
there may be times when you need to set up a container data description to support another data
description (particularly in graph data descriptions), but do not want the container to display
in a Data Explorer.
left = "left"
right = "right"
}
The type-specific fields for data descriptions for binary trees are described in the
following table.
left = "left_field_name"
use_for_print_and_view = bool_expr
Specifies whether the data description should be used for displaying the type in Data Explorers
and when printing, where bool_expr is either true or false.
Defining this field is optional. It defaults to true, which causes the graph description to be used
for graph views and print views. In most situations, this setting should not be changed; however,
there may be times when you need to set up a container data description to support another data
description (particularly in graph data descriptions), but do not want the container to display
in a Data Explorer.
The syntax for the structure type data description follows (lines enclosed in
square brackets are optional; the square brackets are not part of the syntax, but the
curly brackets are):
data_desc_name {
signature = {"sig1", "sig2", ... }
[required_fields = {"field1", "field2", ... }]
type = "structure"
[predicate = "pred"]
fields {
field1{
name = name_string
value = "value_expr"
mutable = bool_expr
}
...
}
}
type = "structure"
predicate = "return self._Ptr != 0"
fields {
next {
name = "_Next"
value = "return self._Ptr->_Next"
}
prev {
name = "_Prev"
value = "return self._Ptr->_Prev"
}
value {
name = "_Myval"
value = "return self._Ptr->_Myval"
}
}
}
The type-specific fields for data descriptions for structures are described in the table
below.
field1
Specifies name_string as the name of the artificial field you are creating. This name must not
contain any whitespace.
This field is required.
value = "value_expr"
Specifies the expression, value_expr, as the value to be displayed for the field.
This field is required.
mutable = bool_expr
Specifies whether the value can be edited in Data Explorer windows, where bool_expr is
either true or false.
Defining this field is optional. It defaults to true, which allows the values to be edited.
An example of an alias data description for an STL string is shown next. This
data description causes an STL string to be displayed as its underlying C-style string.
string {
signature = {"basic_string<*>"}
required_fields = {"_Bx", "_Myres"}
type = "alias"
The type-specific fields for data descriptions for aliases are described in the table
below.
value = "val_expr"
Specifies that the result of the expression val_expr will be displayed in place of the actual
value of the item matching this data description.
This field is required.
mutable = bool_expr
Specifies whether the value can be edited in Data Explorer windows, where bool_expr is
either true or false.
Defining this field is optional. It defaults to true, which allows the value to be edited.
replace_self = bool_expr
Specifies whether the variable being viewed is replaced with the result of the expression specified
by the line value = "val_expr". The argument bool_expr is either true or false. If
bool_expr is true, the variable being viewed is replaced with the result of val_expr. If
bool_expr is false, the result of val_expr is used as the value of the variable, but the original
variable's type is still displayed.
Defining this field is optional. It defaults to false.
would be:
singleton_class {
signature = {"SingletonClass"}
type = "singleton"
instance = "SingletonClass::instance"
}
This data description would allow you to see the singleton instance of the class by
viewing the class type. There is only one type-specific field for data descriptions
for singletons, which is described in the table below.
instance = "variable_name"
Specifies variable_name as the instance variable of the type. This must be a valid variable
identifier.
This field is required.
The syntax for the function_definer data description follows (lines enclosed
in square brackets are optional; the square brackets are not part of the syntax, but
the curly brackets are):
data_desc_name {
signature = {"sig1", "sig2", ... }
[required_fields = {"field1", "field2", ... }]
type = "function_definer"
[predicate = "pred"]
functions {
unique_name {
name = "name_string"
[arguments = {"arg_string1", "arg_string2", ...}]
body = "body_expr"
}
}
}
Note
The functions block shown above can also be added to any of the other
data description types (except graph), rather than being placed in a
function_definer type.
functions {
size {
name = "size"
body = "return self._Mysize"
}
front {
name = "front"
body = "return self._Myhead->_Next->_Myval"
}
back {
name = "back"
body = "return self._Myhead->_Prev->_Myval"
}
}
}
The type-specific fields for data descriptions for function definers are described in
the table below.
unique_name
Specifies the string name_string as the name of the function. For example, if the name is
size, then the function can be called by obj.size().
This field is required.
arguments = {"arg_string1", "arg_string2", ...}
protected:
std::list<Bus*> inputs;
std::list<Bus*> outputs;
};
See “.mdv File Examples” on page 796 for a complete example of the graph data
description.
The type-specific fields for data descriptions for graphs are described in the following
table.
replace_with = "repl_node_expr"
Specifies a value, repl_node_expr, to replace (in Graph View) the node being defined. If
this line is present, all other fields in the data description are ignored. The node being defined
will not show up in the graph, but will instead be replaced by a node representing the value
returned by the expression repl_node_expr.
To make a node not show up at all, use the line:
replace_with = "return (void*) 0"
Specifies one or more MULTI commands, separated by semicolons, that generate output which
will appear on the node being defined. Commands that can be used for output include echo,
print, and mprintf. Any textual output from these commands will be captured and displayed
in the node.
This field is required.
vertical_layout = bool_expr
Specifies information about the node's children. Each child must have a unique name,
child_name, but the number of children is unlimited.
For more information about the syntax and fields for describing children, see the next section.
Specifying children is optional.
parents {
parent_name {
value = "parent_val_expr"
}
...
}
Specifies information about the node's parents. Each parent must have a unique name,
parent_name.
If an edge is specified by both the parent and the child, it will only appear once. This provides
an easy mechanism for describing complex graphs without having to worry about duplication.
For more information about the syntax and fields for describing parents, see the next section.
Specifying parents is optional.
next_sibling = "sibl_expr"
The core functionality of the graph type is describing children and parents of a
node. The children of a node may be significant pointers contained in the structure,
entries from a lookup table, or any other value that can be calculated given the
structure as a starting point.
The syntax for defining a child follows (lines enclosed in square brackets are
optional; the square brackets are not part of the syntax, but the curly brackets are):
children {
child_name {
value = "child_val_expr"
[is_container = bool_expr]
[is_array = bool_expr]
[array_len = "length_expr"]
[invisible_edge = bool_expr]
}
...
}
value = "child_val_expr"
Specifies whether this child should be treated as a container of children, where bool_expr is
either true or false.
If bool_expr is true, the child is treated as a container — MULTI looks up a data description
for that type and adds each element of the container as a child. STL container descriptions have
been provided, so any time you have a structure with a list, vector, or map of children, you can
simply set this value to true and each element will be added as a child.
This field is optional and defaults to false. This field is mutually exclusive with is_array;
only one of is_array and is_container can be true.
is_array = bool_expr
Specifies whether the child should be treated as an array of children, where bool_expr is either
true or false.
This field is optional and defaults to false. This field is mutually exclusive with is_container;
only one of is_array and is_container can be true.
array_len = "length_expr"
Specifies whether the edge defined by this parent or child relationship will be displayed, where
bool_expr is either true or false.
This field gives you greater control over the layout of a graph. If bool_expr is true, the edge
will not be displayed, but will still restrain the layout of the graph, allowing you to, for example,
enforce an ordering on nodes without having visible edges connecting them.
This field is optional and defaults to false.
Parents can be described in the same way as children by using the parents keyword
in place of the children keyword. A single data description can contain both
parents and children blocks.
Profile Descriptions
A data visualization profile is a collection of data descriptions. You can create
several profiles, but only one is active at a given time. Only the active profile is
used when searching for data descriptions. Using profiles allows you to have multiple
data descriptions for the same type, which you use in different circumstances. You
can change which profile is active by using the command:
dvprofile prof_name
Any data description not in a profile is placed in a global profile, and is always
accessible.
Profiles are defined in profile descriptions in .mdv files. A profile description has
the following form. (Lines enclosed in square brackets are optional; the square
brackets are not part of the syntax, but the curly brackets are part of the syntax.)
unique_prof_id {
profile_name = "prof_name"
[parent_profile = "parent_prof_name"]
[default_root = "def_root_prof"]
[vertical_layout = bool_expr]
[add_siblings_of_root = bool_expr]
data_descriptions {
[series_of_data_descriptions]
}
}
unique_prof_id
Specifies a unique identifier, unique_prof_id, for the profile. Reading in a new profile with
the same identifier will overwrite the original.
This field is required.
profile_name = "prof_name"
Specifies prof_name as the string used to refer to the profile when you are using the dvprofile
command or working with different views. See the dvprofile command in “Data Visualization
Commands” in Chapter 21, “View Command Reference” in the MULTI: Debugging Command
Reference book, and see “View Descriptions” on page 794.
This field is required.
parent_profile = "parent_prof_name"
Specifies that the profile with the name parent_prof_name is the parent of the profile. A
profile can have at most one parent. When searching for a data description, MULTI starts at the
active profile and then searches its parent, then the parent of that parent, and so on. If no parent
is specified, the parent is set to the global profile by default.
This field is optional.
default_root = def_root_prof
Specifies a variable identifier def_root_prof as the default root variable for graphs using this
profile. This line is optional, but is used by the dataview command. For information about the
dataview command, see “Data Visualization Commands” in Chapter 21, “View Command
Reference” in the MULTI: Debugging Command Reference book.
vertical_layout = bool_expr
Specifies whether the graph should use a vertically oriented layout or a horizontally oriented
layout, where bool_expr is either true or false. If bool_expr is true, the graph will use
a vertically oriented layout.
This field is optional and defaults to false.
add_siblings_of_root = bool_expr
Specifies whether the siblings of the root node for the graph of this profile should be added,
where bool_expr is either true or false. If bool_expr is true, siblings will be added.
This field is optional and defaults to true.
View Descriptions
Views are high-level visualizations in graph form. You can create views for elements
of the graph data type by including view descriptions in your loaded .mdv file(s).
When you select Display Program Visualizations from a right-click shortcut menu
in the Debugger source pane, a graph will be displayed for each view that is defined
in your loaded .mdv files. These individual graphs will appear on separate tabs of
a single window.
Every view starts at a default root and contains one or two panes. A single pane
view displays the data specified by a single profile. A dual-pane view displays a
profile in the initial, or primary, pane. When a node in this primary pane is clicked,
that node is used as the root variable for a graph that is then displayed in the second
pane, using a different profile.
A view description contains specifications about the contents and layout of a single
view. The syntax for defining views has the following form. (Lines enclosed in
square brackets are optional; the square brackets are not part of the syntax, but the
curly brackets are part of the syntax.)
view_unique_name {
initial_pane = "pane_name"
default_root = "def_root_view"
[tab_name = "tab"]
panes {
pane_name1 {
profile_name = "prof_name"
[child_pane = "child_pane_name"]
}
[pane_name2 {
profile_name = "prof_name2"
}]
}
}
view_unique_name
Specifies a unique identifier, view_unique_name, for the view. This name can be used with
the dataview command to open a Graph View window on this view (see “Invoking Customized
Data Visualizations” on page 772).
This field is required.
initial_pane = "pane_name"
Specifies which pane is the primary pane for this view. In single pane views, this will be the
name of the only pane. In dual pane views, this will be the name of the pane on the left. In dual
pane views, clicking a node in the primary pane will cause the child pane to display a new graph
with the selected object as its root.
This field is required.
default_root = "def_root_view"
Specifies the string to be displayed on the tab that displays this view.
This field is optional.
pane_name
Specifies the name (pane_name1, pane_name2) of the pane(s). This is used to refer to the pane
within this view.
This field is required for each pane in the view.
profile_name = "prof_name"
Specifies prof_name as the profile to use as the active profile when displaying this pane. (See
“Profile Descriptions” on page 792.)
This field is required for each pane in the view.
child_pane = "child_pane_name"
Specifies child_pane_name as the child pane. When a node is selected in the pane being
defined, the selected node will be displayed in this child pane.
This field is required if the pane has a child pane.
Expressions can contain loops, MULTI special variables, and command line function
calls. Expressions can also refer to program variables and return pointers, but they
cannot return objects.
Expressions access the current structure through the self keyword. The current
structure is usually the structure that the data description's signature matches. (There
are some exceptions, such as when the current structure is the iterator while walking
through a container.)
protected:
const char* deviceName;
int deviceId;
std::list<Bus*> inputs;
std::list<Bus*> outputs;
};
class Bus {
public:
Bus(const char* name, const int id);
void addInputDevice(Device* input);
void addOutputDevice(Device* output);
protected:
const char* busName;
int busId;
std::list<Device*> inputs;
std::list<Device*> outputs;
};
A sample .mdv file used to display the preceding types is listed below.
demo_profile {
profile_name = "Device_Bus_Profile"
data_descriptions {
device {
signature = {"Device"}
type = "graph"
node_text = "mprintf(\"%s\nDevice ID: %d\", self.deviceName, self.deviceId)"
children {
outputs {
value = "return self.outputs"
is_container = true;
}
}
parents {
inputs {
value = "return self.inputs"
is_container = true;
}
}
}
bus {
signature = {"Bus"}
type = "graph"
node_text = "mprintf(\"%s\nBus ID: %d\nInputs: %d\nOutputs: %d\","
node_text+= "self.busName, self.busId, self.inputs.size(), self.outputs.size())"
children {
outputs {
value = "return self.outputs"
is_container = true;
}
}
parents {
inputs {
value = "return self.inputs"
is_container = true;
}
}
}
my_list {
signature = {"std::list<*>"}
type = "container"
demo_view {
initial_pane = "only_pane"
default_root = "deviceA"
tab_name = "Device Graph"
panes {
only_pane {
profile_name = "Device_Bus_Profile"
}
}
}
The preceding .mdv file might yield a Graph View like the following.
Contents
The GRD Register Definition Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 802
Appendix F. Register Definition and Configuration Reference
Section Overview
Target register information is defined in GRD files, which contain some or all of
the following sections:
Each section is enclosed in a block with a tag name identifying the section. Blocks
can be delimited in two ways:
or
"general"."register_offset" = "16";
The definition for each section can be separated into multiple parts. For example,
you can define one register section for all special purpose registers, then a group
section for the special purpose registers, and then another register section.
This appendix describes each section's syntax, including the attributes that can be
defined in each section. If an attribute for a section is defined in more than one GRD
file, the Debugger uses the definition from the GRD file that is loaded last.
CPC0_SR {address="${PPC400_DCR_BASE}+0x000000b0"}
In the value of CPC0_SR's address attribute, the Debugger substitutes 5000 for
${PPC400_DCR_BASE} and then evaluates the resulting expression
5000+0x000000b0.
Pre-defined preprocessor symbols for the debugging environment are available for
use in GRD files. For more information, see the comment at the top of the file
os_constants_internal.grd, which is located at
compiler_install_dir/defaults/registers.
pvr_mask[index] = mask
bcr_address[index] = identifier
bcr_info[index] {register definition block}
bcr_mask[index] = mask
sign_extend_address = bool
multi_command = commands
}
Note
The only required attribute is version. All other attributes are optional.
version = number
Defines the version number of the Green Hills Software Register Definition language used in
the GRD file. The version number should be 3.
Example: version = 3
pad_bitfield = bool
Where bool can be:
• true or false
• An integer (where 0 means false, and a nonzero integer means true)
When a register with bitfields is defined, some bits or bit ranges may be omitted. This option
tells the Debugger whether to automatically generate fields for the omitted bits or bit ranges
when creating symbol information for the bitfield. If this attribute is true, when a register with
the corresponding bitfield is displayed, the automatically generated padding fields will be
displayed.
The default value for this attribute is true.
Example: pad_bitfield = true
register_width = int
Where int defines the default register width in bits.
The default value for this attribute is 32.
The default register width will be applied to all registers except those registers whose definitions
override the default width by using the width setting.
Example: register_width = 16
register_offset = string
Each register has an identifier in the Debugger, but it can have a different identifier (register
offset) in the communication message between the Debugger and the debug server. This setting
defines the default register offset that will be applied to all registers. A register definition can
override the default offset expression by using the offset setting.
Example: register_offset = "return 2*__regadr"
__regadr is a reserved symbol whose value is the register's identifier in the Debugger.
byte_endian = string
This setting defines the default byte order for a register. A register definition can override the
default byte order by using the byte_endian setting.
Here are the supported values:
In big endian registers, the most significant byte is at the lowest address. In little endian registers,
the least significant byte is at the lowest address.
Example: byte_endian = "big"
bit_0_is_msb = bool
This setting defines the default bit order for a register. A register definition can override the
default bit order by using the bit_0_is_msb setting.
This setting indicates how a register's bit numbers are ordered. If the value for bit_0_is_msb
is true, bit 0 will refer to the register's most significant bit (msb), and the largest bit number will
refer to the register's least significant bit (lsb). Otherwise, bit 0 will refer to the register's least
significant bit (lsb), and the largest bit number will refer to the register's most significant bit
(msb).
The default value for the attribute is false.
Example: bit_0_is_msb = true
memory_space = number
This setting defines the default memory space for memory-mapped registers.
A memory space is an identifier that dictates how the underlying debug server should perform
a particular memory access. In most cases, the memory space indicates whether the access is
to text or data memory, and whether the address is physical or virtual. The Debugger supports
the following memory spaces. Preprocessor symbols with these names are defined in the file
os_constants_internal.grd located at compiler_install_dir/defaults/registers.
Additionally, a debug server may implement memory spaces that do not correspond directly to
a target's memory bus. These are both specific to the target and to the debug server. Values
65535 and smaller are reserved for Green Hills' use. Values 65536 and larger are available for
use by third-party debug servers. See documentation for your debug server for a list of any
supported custom memory spaces.
Example: memory_space = 95 # MSPACE_DATA_PHYSICAL
pvr_address[index] = identifier
This setting defines a processor version register (PVR). When the corresponding pvr_value
is used, the value from the register with this address is read. The values that may be used for
this setting are the same as the values that may be used for the address setting in the register
section.
If a processor has more than one processor version register (PVR), index can be appended to
pvr_address. The two settings pvr_address and pvr_address0 represent the same processor
version register.
identifier should be an integer.
See also “Processor Version Register Information” on page 810.
Example: pvr_address10 = 1061
pvr_mask[index] = mask
This optional setting defines a mask that will be applied to the value of the processor version
register (PVR) with the given index when it is read.
index has the same meaning as in the processor version register address.
mask should be an integer.
See also “Processor Version Register Information” on page 810.
Example: pvr_mask10 = 0xffff0000
bcr_address[index] = identifier
This setting defines a board configuration register (BCR). When the corresponding bcr_value
is used, the value from the register with this address is read. The values that may be used for
this setting are the same as the values that may be used for the address setting in the register
section.
If a target has more than one board configuration register (BCR), index can be appended to
bcr_address. The two settings bcr_address and bcr_address0 represent the same BCR.
identifier should be an integer.
See also “Board Configuration Register Information” on page 810.
Example: bcr_address10 = 258
bcr_mask[index] = mask
This optional setting defines a mask that will be applied to the value of the board configuration
register (BCR) with the given index when it is read.
index has the same meaning as in the board configuration register address.
mask should be an integer.
See also “Board Configuration Register Information” on page 810.
Example: bcr_mask10 = 0xffff0000
sign_extend_address = bool
This setting specifies whether the Debugger attempts to sign-extend memory addresses for
memory-mapped registers and memory-based indirect registers. If true, and if the target
allows sign extension (for example, because it does not fully support 64-bit addresses), the
Debugger sign-extends addresses. If false, the Debugger does not sign-extend addresses.
The default value for this attribute is true.
multi_command = multi_commands
multi_command += multi_commands
This setting defines Debugger commands in a string that will be executed when the register
definition is constructed inside the Debugger.
This setting is especially useful to support memory-mapped registers whose addresses are not
based on another register's value but which could depend on other factors, such as the following:
• A debug server could move a register base around when it connects to the target (via its
setup script, for example).
• A program such as the INTEGRITY kernel could move a register base when it runs.
• A program's build process might move a register base.
You can define the address of these registers with an expression using one or more Debugger
local variables. For example, on a PowerPC target supporting QUICC, a Debugger variable is
defined for the base of the QUICC registers:
$MULTI_PPC_QUICC_SIU_IMMR_BASE
which can be used to define the addresses of QUICC registers as described below:
bcr_address = "$MULTI_PPC_QUICC_SIU_IMMR_BASE + 0x10024"
The special variable can be initialized to the default base with a Debugger command:
multi_command +=
" if (!$MULTI_PPC_QUICC_SIU_IMMR_BASE_IS_SET)
{eval $MULTI_PPC_QUICC_SIU_IMMR_BASE = 0x0f000000;}"
where eval is used to prevent the Debugger from printing the new value of
$MULTI_PPC_QUICC_SIU_IMMR_BASE after the assignment.
The default GRD files for some targets already use this mechanism. If the default IMMR base
does not match your target setting, you can either change the GRD file directly or add statements
such as the following into your program script file (.rc) or target setup script (.mbs) to set the
correct IMMR base and disable the default setting:
eval $MULTI_PPC_QUICC_SIU_IMMR_BASE_IS_SET = 1
eval $MULTI_PPC_QUICC_SIU_IMMR_BASE = 0xfc000000
where index is the index (starting from 0) for the processor version register.
where index is the index (starting from 0) for the board configuration register.
enum_entry_name {
description = string
help_key = string
long_name = string
value = int
}
...
}
}
Note
All attributes are optional.
description = string
description += string
desc = string
desc += string
The description string can be an expression starting with %EVAL, which will be dynamically
evaluated.
An enumeration can have a long description combined from multiple description settings (with
+=). Newline characters (\n) must be specified if you want a newline displayed in the Register
Information window's help pane.
Example:
desc = "Indicates whether interrupts are enabled:\n";
desc += " 0 - disabled\n";
help_key = string
hk = string
The help key string can be an expression starting with %EVAL, which will be dynamically
evaluated.
Example:
hk = "register.msr"
auto_value_desc = bool
The default setting for this option is true.
When this option is set to false, the Debugger will not automatically generate the specification
for the enumeration's values in the help pane of the Register Information window for those
bitfields whose type is the enumeration.
If you include a detailed list of enumeration values in the enumeration description, set this option
to false to avoid duplicating the list of enumeration values in the help pane.
Example:
auto_value_desc = false
An enumeration must have at least one value entry, which can have the following
attributes. If none of the attributes are specified, the braces should still be present.
description = string
description += string
desc = string
desc += string
The description string can be an expression starting with %EVAL, which will be dynamically
evaluated.
help_key = string
hk = string
The help key will be used to show online help. The help key string can be an expression starting
with %EVAL, which will be dynamically evaluated.
long_name = string
ln = string
The long name string can be an expression starting with %EVAL, which will be dynamically
evaluated.
value = int
value = {int1, ..., intn}
The enumeration entry will have the value or values specified. If an enumeration entry does not
have a value explicitly specified, its value is assigned as follows:
• If no previous enumeration entry exists, the enumeration entry will be assigned the value
0.
• If a previous enumeration entry exists, the enumeration entry will be assigned a value one
greater than that of that previous enumeration entry.
• If a previous enumeration entry contains a list of values, the enumeration entry will be
assigned a value one greater than maximum value in the previous enumeration entry.
field_name {
description = string
help_key = string
long_name = string
type = string
}
...
}
}
Note
All attributes are optional.
description = string
desc = string
This is the structure's description. MULTI 7 does not use this value, which is currently being
reserved for a future release.
help_key = string
hk = string
This is the structure's help key. MULTI 7 does not use this value, which is currently being
reserved for a future release.
description = string
desc = string
This is the structure field's description. MULTI 7 does not use this value, which is currently
being reserved for a future release.
help_key = string
hk = string
This is the structure field's help key. MULTI 7 does not use this value, which is currently being
reserved for a future release.
long_name = string
ln = string
This is the structure field's long name. MULTI 7 does not use this value, which is currently
being reserved for a future release.
type = string
The type string must be one of the following:
field_name {
description = string
help_key = string
short_name = string
long_name = string
auto_value_desc = bool
loc = "begin_bit...end_bit"
type = string
}
...
}
}
Note
The only required attribute is loc. All other attributes are optional.
description = string
desc = string
The bitfield description is displayed in the Register Information window's help pane.
help_key = string
hk = string
This is the bitfield's help key. MULTI 7 does not use this value, which is currently being reserved
for a future release.
description = string
description += string
desc = string
desc += string
A long description can be defined with multiple += statements.
The field description is displayed in the Register Information window's help pane.
help_key = string
hk = string
This is the field's help key. MULTI 7 does not use this value, which is currently being reserved
for a future release.
short_name = string
sn = string
This is the field's GUI name shown in Register View window and Register Information window.
Multiple fields can have the same GUI name, like Reserved for those reserved fields. But each
field's tag name must be unique in a bitfield.
If the attribute is absent, the field's tag name will be used as GUI name.
long_name = string
ln = string
This is the field's long name. It is displayed in the following places in the Register Information
window:
auto_value_desc = bool
This option is only relevant for fields with an enumeration type. The default setting for this
option is true.
When this option is set to false, the Debugger will not automatically generate the specification
for the field's values in the help pane of the Register Information window.
If you include a detailed list of enumeration values in the field description, set this option to
false to avoid duplicating the list of enumeration values in the help pane.
loc = "begin_bit..end_bit"
loc = "bit_index"
The second form of this setting is for a field with only one bit.
type = type_string
The type must be one of the following basic types:
• hex
• binary
• unsigned
• signed
• A defined enumeration type
Note
The address attribute is always required. Other attributes may be
required depending on the access type.
description = string
description += string
desc = string
desc += string
This is the register's description. It is displayed in Register Information window.
help_key = string
hk = string
This is the register's help key. MULTI 7 does not use this value, which is currently being reserved
for a future release.
short_name = string
sn = string
If a register's short name is defined, the short name instead of the tag name will be displayed in
Register Explorer windows.
alias = {string_list}
A register's aliases. They will be displayed in the Register View window, the Register
Information window, and the Register Search window.
long_name = string
ln = string
This is the register's long name. It is displayed in the following places:
gui_tab = string
This setting allows a register to be associated with a Register View window tab. The Debugger
will create the specified tab and display the register in the tab.
cache_value = bool
This setting indicates whether the Debugger can cache a register's value to improve performance
while the target is halted.
The default value is true, which is okay for most registers. For some special registers, such as
the timer, the setting should be defined as false so that when you manually refresh values
from the Register View window or print values in the Debugger window, the values can be
fetched from the target even though the corresponding process is stopped on the target.
access = string
The string must be one of the following strings or an expression that can be resolved into one
of the following strings:
• regular — [default] A physical register that is accessed through the debug server. The
address syntax is num|expr, which resolves to the register number.
• fpu — A floating-point register that is accessed through the debug server. The address
syntax is num|expr, which resolves to the register number.
• special — A special coprocessor register that is accessed through the debug server. The
address syntax is num|expr, which resolves to the register number.
• io — An input/output register that is accessed through the debug server. The address
syntax is num|expr, which resolves to the register number.
• synonym — A synonym for another defined register. The address syntax is name|expr
and resolves to the name of the register for which this register is a synonym.
• memorymapped — The contents of the register correspond to a location in memory. The
address syntax is num|expr.
If the address field is a number, it indicates the address in memory of the start of the
register's contents.
If the address field is not a number, then it is assumed to be string containing a Debugger
expression that will evaluate to an address. This expression is evaluated dynamically each
time the register is accessed to produce an address, and may depend on other registers.
This expression is not surrounded by %EVAL{}.
An expression value surrounded by %EVAL{} is evaluated when the file is loaded, producing
either a numerical address or a string that contains a Debugger command to be evaluated
at run time to produce an address.
• dynamic — The contents of the register are obtained by evaluating a Debugger expression.
The address syntax is expr.
The value is a string that contains an expression in the language being debugged and which
is evaluated to produce the register's value each time the register is accessed. This expression
is not surrounded by %EVAL{}.
An expression value surrounded by %EVAL{} is evaluated when the file is loaded, producing
a string that contains a Debugger command to be evaluated at run time to produce a value.
• indirect — The register's value is obtained by writing its address into an address port
and reading its value from a data port. The address syntax is num|expr and resolves to
the control value to be written to the address port so the register value will be made available
on the data port.
• command — The register's value is the output of the MULTI Debugger command specified
by address. See below.
address = number_or_string
For a register of type regular, special, io, or fpu, the address must be a number, or a string
that can be immediately resolved into a number.
For a synonym register, the address should be another register name or a string that can be
immediately resolved into another register name. The register name used here should not contain
the $ prefix.
For a memorymapped register, the address must be a number, or an expression that can be
resolved into an address immediately or at the time it is accessed.
For a dynamic register, the address should be an expression that can be resolved into a number
immediately or at the time it is accessed.
For an indirect register, the address can be a number or an expression that can be resolved
into a number immediately or at the time it is accessed.
For a command register, the address is a string containing MULTI Debugger commands whose
output is the register's value. For example, you can define a command register to use another
register's value:
cmdRegForEflags {access="command";
address="mprintf(\"eflags.CF = %d, \
eflags.IF =%d\", $eflags.CF, $eflags.IF)"}
Note that it does not make sense to use certain commands in this context (such as commands
that open a window). Additionally, run control commands are not allowed.
Any newline characters in the command output are converted to spaces.
offset = string
The value must be a string or an expression that can be resolved into a number when the register
is accessed.
The resolved number is the register's ID used by the Debugger to communicate with the debug
server.
If the setting is absent and register_offset is defined in the general section, then the
string value of register_offset from the general section will be used as the register's
offset.
address_port = number_or_string
This setting defines an indirect register's address port.
The address port value must be a number, a register name or an expression that can be resolved
into a number or register name. If it is an expression that can be resolved into a register name,
it should be resolvable immediately.
address_mask = number_or_string
This setting defines the mask for the control value to be written to an indirect register's address
port.
Its value must be a number or an expression that can be resolved into a number immediately.
sign_extend_address = bool
This setting specifies whether the Debugger attempts to sign-extend the memory address for
the memory-mapped register or memory-based indirect register. If true, and if the target
allows sign extension (for example, because it does not fully support 64-bit addresses), the
Debugger sign-extends the address. If false, the Debugger does not sign-extend the address.
The default value for this attribute is true.
data_port = number_or_string
This setting defines an indirect register's data port, from which the indirect register's value
is read.
The data port value must be a number, a register name or an expression that can be resolved
into a register name or a number. If it is an expression that can be resolved into a register name,
it should be resolvable immediately.
An indirect register's data port and address port must both be register names or both be
numbers for addresses.
width = number_or_string
This setting specifies a register's width in bits. If the attribute is not explicitly specified, the
default register width will be used.
The value must be a number or a string expression that can be immediately resolved into a
number.
byte_endian = string
This setting defines a register's byte order, and overrides the byte order defined in the general
section. For the available values and other details, see byte_endian attribute in “The general
Section” on page 803.
If the setting is absent, the byte order defined in the general section will be used for the register.
bit_0_is_msb = bool
This setting defines a register's bit order.
If the value for bit_0_is_msb is true, bit 0 will refer to the register's most significant bit (msb),
and the largest bit number will refer to the register's least significant bit (lsb). Otherwise, bit 0
will refer to the register's least significant bit (lsb), and the largest bit number will refer to the
register's most significant bit (msb).
If the attribute is not explicitly specified, the default bit order defined in the general section
will be applied.
permission = string
The value must be a string in the syntax specified below or an expression which can be resolved
into such a string immediately:
action/permission[/user_mode][;action/permission[/user_mode]]
where:
type = string
The value must be one of the following strings or an expression that can be immediately resolved
into one of the strings:
• unsigned
• signed
• A defined bitfield name
• A defined enumeration name
• A defined structure name
• A pointer to one of the above types or a pointer to void, such as unsigned * or void
*
read_length = number_or_string
The value must be a number or an expression that can be resolved into a number immediately.
The attribute is only valid for memorymapped registers or indirect registers located in memory.
If no read length is specified for such registers, the default read block length is the width of the
whole register.
write_length = number_or_string
The value must be a number or an expression that can be resolved into a number immediately.
The attribute is only valid for memorymapped registers or indirect registers located in memory.
If no write length is specified for such registers, the default write block length is the width of
the whole register.
hide = bool_or_string
The value must be a Boolean value or a string expression that can be resolved into a Boolean
immediately.
This setting indicates whether a register should be hidden or displayed.
memory_space = number
This setting defines the memory space for memory-mapped registers.
For more information, see the memory_space attribute in “The general Section” on page 803.
A group can contain other groups as well as registers. A group can be included by
at most one other group. If a group is not included by any other group, it is a top-level
group. A group must contain at least one register or group; otherwise, it will be
automatically hidden.
Groups and registers compose the hierarchy in the Debugger's Register View
window.
Note
All attributes are optional.
description = string
description += string
desc = string
desc += string
This is the group's description. MULTI 7 does not use this value, which is currently being
reserved for a future release.
help_key = string
hk = string
This is the group's help key. MULTI 7 does not use this value, which is currently being reserved
for a future release.
short_name = string
sn = string
The value must be a string or an expression that can be immediately resolved into a string.
If group's short name is defined, it will be used to represent the group in the Debugger's Register
View window, otherwise, the group's tag name is used.
long_name = string
ln = string
The value must be a string or an expression that can be immediately resolved into a string.
A group's long name is displayed in a tooltip in the Register View window.
top_level_index = number_or_string
The value must be a number or a string expression that can be immediately resolved into a
number.
The attribute will be used to determine the group's position at top level if it is a top-level group,
or inside a group if it is included by another group.
collapse = bool_or_string
The value must be a Boolean or a string expression that can be immediately resolved into a
Boolean.
If this attribute is true, the Debugger collapses the group. If false, the Debugger expands the
group. The default value for groups created on the fly is false. Otherwise, the default value is
true.
Note: In GRD files with a version of 1 or 2, the Debugger initially collapses all nested groups
and expands all top-level groups, regardless of the specification in the GRD file. In GRD files
with a version of 3, the Debugger follows the specification in the GRD file.
Note: The Register View window remembers the value of this attribute across debugging
sessions for targets of the same type. This information overrides the specification in the GRD
file.
register = {registers}
register += {registers}
The strings used in the value to represent registers must be register tag names. The registers
listed in the value must be defined.
group = {groups}
group += {groups}
The strings used in the value to represent groups must be group tag names. The groups listed
in the value must be defined.
Contents
Multiple Breakpoints and Tracepoints on a Single Line . . . . . . . . . . . . . . . . . . 828
Breakpoint Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 828
Hardware Breakpoints in Specific Environments . . . . . . . . . . . . . . . . . . . . . . . 829
Appendix G. Advanced Breakpoint Topics
For example, suppose a single source line contains multiple software breakpoints,
some of which are enabled and some disabled; one hardware breakpoint that is
enabled; and one tracepoint that is disabled. If you click the marker to the left of
the source line, MULTI clears all the software breakpoints, clears the hardware
breakpoint, and enables the tracepoint.
Breakpoint Limitations
• Full source-level debugging is not possible within function prologues and
epilogues, so MULTI does not display source-level breakpoints within these
regions. For more information, see “The Call Stack Window and Function
Prologues and Epilogues” on page 396.
• If you halt a process at an instruction where a software breakpoint is set, the
software breakpoint may not be hit. This means that any operation associated
with the breakpoint is not executed. For example, any commands set to run
when the breakpoint is hit will not run; if the breakpoint is a jump breakpoint,
it will not jump to the specified location; etc.
• Setting, removing, enabling, or disabling a breakpoint requires communication
between the Debugger and your target. While this communication is quick, it
is not instantaneous. As a result, setting or enabling a breakpoint on a running
target may result in the breakpoint not being hit. Similarly, removing or
disabling a breakpoint on a running target may result in the breakpoint being
hit. In the second scenario, the Debugger may report Stopped by unknown
trap/breakpoint.
• Before you can set a hardware breakpoint in an OSA task for which
TimeMachine is enabled, TimeMachine must be enabled for the master process.
If TimeMachine is not enabled for the master process, MULTI prompts you
to enable it.
In freeze mode:
Hardware breakpoint support depends on whether your debug server limits hardware
breakpoints to kernel/supervisor mode, as follows.
• Any existing core-specific hardware breakpoints are removed when OSA tasks
appear in the target list. Additionally, setting core-specific hardware breakpoints
is not permitted in this context.
• Any-core hardware breakpoints set in your program cannot be set correctly on
certain targets, such as i.MX6 SABRE Lite, when you prepare the target and
then run the program. This is due to a hardware limitation. For more information
about hardware breakpoint limitations, see the Green Hills Debug Probes User's
Guide.
Debugging Linux/Solaris
Core Files
Appendix H. Debugging Linux/Solaris Core Files
Note
This appendix describes debugging core files (also known as core dumps
or core images) generated by native Linux and Solaris programs only.
Native core file debugging is not available on Windows. For information
about debugging core files generated by INTEGRITY systems or
applications, see the documentation about core file debugging in the
INTEGRITY Development Guide. INTEGRITY core file debugging is
available on all supported hosts.
Core file debugging allows you to perform static analysis of your target. The target's
state is dumped into a core file when the program running on the target encounters
a fatal signal.
Note
The state of the target is not dumped into a core file if you have disabled
core dumps or if your program is being run under the control of a
debugger.
To debug a core file generated from a Linux or Solaris program, use the following
command to start the MULTI Debugger from the command line:
multi program_name -C core_file
where:
You can also use one of the following Debugger commands to open the MULTI
Debugger on a core file:
See the debug and new commands in Chapter 2, “General Debugger Command
Reference” in the MULTI: Debugging Command Reference book.
overview, 373 R
profiling, 368
-r command line option, 751
(see also profiling data)
-R command line option, 752
tasks
RAM download programs, 113
all in system, 369, 545
RAM_VLE system variable, 602
single, 369
-rc command line option, 752
trace-enabled target, 368, 371, 481
.rc files
profiling data, 368
ignoring with -norc, 7, 751
(see also profiling)
portable, 572
coverage, instrumented, 368, 369
read-only system variables, 327
merging, 372
reading command scripts on startup, 752
performance, instrumented, 368, 369
real-time operating systems (RTOS)
recordings (see recordings, profile)
debugging
sampled, 368, 369
INDRT (rtserv), 78
saving and exporting, 372
INDRT2 (rtserv2), 60
traced, 368, 371, 481
Rebuild menu item, 709
types of, 368
Reconstructed Registers window, 481
viewing, 373, 375
Record Command+Output menu item, 714
Program already present on target. Verify option, 116
Record Commands menu item, 713
program counter (PC), 24
recording
dimmed, 139
commands
location in TimeMachine mode, 422, 425
command line options for, 751, 752
samples, 368, 369
menu items for, 713, 714
Program Counter button, 718
output, 752
Program Flash ROM option, 116
profiling data (see recordings, profile)
PROGRAMMING_FLASH system variable, 602
recordings, profile
programs
creating, 369, 371
execution of, 124
merging, 372
RAM download, 113
saving and exporting, 372
ROM copy, 115
redirecting input/output, 688
ROM run, 114
Refresh Views menu item, 699
in Separate Session TimeMachine mode, 428
register definition files
starting, 124
customizing, 293, 296, 297
stepping through, 125
default, 293, 296, 297
in TimeMachine mode, 419
GRD format, 284, 802
unknown, 115
location of, 294
Project Manager
overloading, 296
opening, 709, 725
overview, 802
Project Manager menu item, 709
searching for, 294
prologue code
Register Explorer, 262
debugging, 396
(see also register definition files)
Py pane, 34
(see also Register Information window)
python pane, 34
(see also Register View window)
Python scripts, TimeMachine API, 477, 478
overview, 262
startup, 294
Q Register Information window
question mark (?) wildcard character, 314 buttons, 283
quit command, 576 opening, 279
overview, 278, 279
panes, 280, 281, 282
file interface, 472, 474, 475, 478 _TOP_PROJECT system variable, 331
live interface, 472, 473, 477 _TOP_PROJECT_DIR system variable, 331
overview, 472 tpset command, 624, 630, 632, 633
Python examples, 477, 478 trace
timemachine command, 420, 422, 424, 429 accessing with TimeMachine API, 472
TimeMachine Debugger, 419 analyzing
(see also TimeMachine tools) with TimeMachine, 409
(see also trace) with TimeMachine API, 472
commands, 423 bookmarking, 451, 452, 454
disabling, 421 browsing, 437, 458, 460, 461, 463
enabling, 420 clearing, 416, 581
limitations, 419 collecting, 411
location of program counter in, 422, 425 configuring collection of, 494, 496, 497, 499, 503
on a multi-core target, 579, 581 converting to
OS trace in, 424, 425 EventAnalyzer information, 480
overview, 419 profiling data, 368, 371, 481
quick start, 408 disabling collection of, 411
run control buttons, 420, 422 discarding, 416
Separate Session, 428 events supported, by architecture, 500
TimeMachine Debugger button, 720 events, defining, 510
TimeMachine Debugger menu item, 708 events, modifying with Set Triggers window, 500
TimeMachine menu, 707 events, specifying with
TimeMachine mode Advanced Event Editor, 450, 503
program or task in, 17, 419 count expressions, 511
TimeMachine tools, 409 state machine expressions, 512
(see also MULTI EventAnalyzer) state machine resources, 508
(see also PathAnalyzer) events, viewing in the EventAnalyzer, 480
(see also Profile window) filtering, 448, 449, 450
(see also TimeMachine API) loading, 455
(see also TimeMachine Debugger) managing, 410
(see also Trace Browsers) navigating, 434, 442, 447, 448
(see also Trace List) operating system
(see also Trace Statistics window) collecting, 412
accessing from Trace List, 450 navigating, 442
overview, 409 options, setting, 486
timeout overview, 408
setting for debug servers, 752 quick start, 408
Toggle All Breakpoints menu item, 691 reconstructed register values, viewing, 481
Toggle IO Buffering menu item, 705 retrieving, 413
toggling saving, 455
breakpoint status, 129 searching, 437, 453
tracepoint status, 129 statistics, viewing, 465, 466, 467, 468, 469, 470
toolbar targets
adding buttons to, 722 configuring, 493
button descriptions, 715 multi-core, 579, 580, 581
removing buttons from, 722 profiling, 368, 371, 481
Tools menu, 709 supported, 408
_TOOLS_DIR system variable, 331 viewing information about, 494
-top command line option, 753 time analysis, 446
Top Project triggers, 494, 496, 499, 503
contents, 90 viewing with Trace List, 440, 441, 443