ARM RealView Debugger Version 16 User Manual

RealView Debugger  
Version 1.6  
Essentials Guide  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
Contents  
RealView Debugger Essentials Guide  
Preface  
1.1  
1.2  
1.3  
Debugging mode ......................................................................................... 1-6  
Chapter 2  
Chapter 3  
2.1  
2.2  
Getting Started with RealView Debugger  
3.1  
3.2  
3.3  
3.4  
3.5  
Starting RealView Debugger ....................................................................... 3-2  
Connecting to a target ................................................................................. 3-4  
Working with memory .................................................................................. 3-7  
Loading an image ..................................................................................... 3-10  
Debugging an image ................................................................................. 3-14  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
iii  
Contents  
Chapter 4  
4.1  
4.3  
4.4  
4.5  
4.6  
How to use the tutorial ................................................................................ 4-2  
Completing the tutorial .............................................................................. 4-35  
Chapter 5  
Chapter 6  
5.1  
5.2  
5.3  
6.1  
6.2  
6.4  
6.5  
6.6  
6.7  
About the desktop ....................................................................................... 6-2  
Finding options on the main menu ........................................................... 6-11  
Analysis window ....................................................................................... 6-26  
Appendix A  
Configuration Files Reference  
A.1  
A.2  
A.3  
Overview ..................................................................................................... A-2  
Files in the etc directory .............................................................................. A-3  
Files in the home directory ......................................................................... A-5  
Glossary  
iv  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
Preface  
This preface introduces the RealView Debugger Essentials Guide. This guide shows  
you how to start using RealView Debugger to manage software projects and to debug  
your application programs. It contains the following sections:  
About this book on page vi  
Feedback on page xi.  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
v
 
Preface  
About this book  
RealView Debugger provides a powerful tool for debugging and managing software  
projects. This book contains:  
an introduction to the software components that make up RealView Debugger  
a tutorial to create a project and build an executable image  
a step-by-step guide to getting started, making a connection to a target, and  
loading an image to start a debugging session  
details about ending a debugging session  
a description of the RealView Debugger desktop  
a glossary of terms for users new to RealView Debugger.  
Intended audience  
Using this book  
This book is written for developers who are using RealView Debugger to manage  
ARM-targeted development projects. It assumes that you are an experienced software  
developer, and that you are familiar with the ARM development tools. It does not  
This book is organized into the following chapters:  
Chapter 1 About RealView Debugger  
Read this chapter for an introduction to RealView Debugger. This chapter  
describes the underlying debugger concepts and explains terminology  
Chapter 2 Features of RealView Debugger  
Read this chapter for a description of the features of RealView Debugger,  
including details about those that are new in RealView Debugger v1.6.  
Chapter 3 Getting Started with RealView Debugger  
This chapter explains how to begin using RealView Debugger for the first  
time. This describes how to start RealView Debugger, make a connection,  
and load an image ready to start debugging.  
vi  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
         
Preface  
Chapter 4 Quick-start Tutorial  
Read this chapter when you have access to a workstation. Follow the  
step-by-step instructions to gain some experience of using RealView  
Chapter 5 Ending your RealView Debugger Session  
This chapter describes how to end your RealView Debugger session and  
exit the debugger.  
Chapter 6 RealView Debugger Desktop  
Read this chapter for a detailed description of the contents of the  
RealView Debugger desktop.  
Glossary  
An alphabetically arranged glossary defines the special terms used.  
Typographical conventions  
The following typographical conventions are used in this book:  
italic  
Highlights important notes, introduces special terminology,  
denotes internal cross-references, and citations.  
bold  
Highlights interface elements, such as menu names. Denotes  
ARM processor signal names. Also used for terms in descriptive  
lists, where appropriate.  
monospace  
monospace  
Denotes text that can be entered at the keyboard, such as  
commands, file and program names, and source code.  
Denotes a permitted abbreviation for a command or option. The  
underlined text can be entered instead of the full command or  
option name.  
monospace italic  
Denotes arguments to commands and functions where the  
argument is to be replaced by a specific value.  
monospace bold  
Denotes language keywords when used outside example code.  
Further reading  
This section lists publications from both ARM Limited and third parties that provide  
additional information.  
ARM periodically provides updates and corrections to its documentation. See  
http://www.arm.comfor current errata, addenda, and Frequently Asked Questions.  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
vii  
Preface  
ARM publications  
This book is part of the RealView Debugger documentation suite. Other books in this  
suite include:  
RealView Debugger v1.6 User Guide (ARM DUI 0153)  
RealView Debugger v1.6 Target Configuration Guide (ARM DUI 0182)  
RealView Debugger v1.6 Command Line Reference Guide (ARM DUI 0175)  
RealView Debugger v1.6 Extensions User Guide (ARM DUI 0174).  
If you are using RealView Debugger with the ARM Developer Suite (ADS) v1.2, refer  
to the following books in the ADS document suite for more information:  
Getting Started (ARM DUI 0064)  
ADS Compilers and Libraries Guide (ARM DUI 0067)  
ADS Linker and Utilities Guide (ARM DUI 0151)  
CodeWarrior IDE Guide (ARM DUI 0065)  
AXD and armsd Debuggers Guide (ARM DUI 0066)  
ADS Assembler Guide (ARM DUI 0068)  
ADS Debug Target Guide (ARM DUI 0058)  
ADS Developer Guide (ARM DUI 0056).  
If you are using RealView Debugger with the RealView Compilation Tools (RVCT)  
v1.2, refer to the following books in the RVCT document suite for more information:  
RealView Compilation Tools v1.2 Getting Started Guide (ARM DUI 0202)  
RealView Compilation Tools v1.2 Compilers and Libraries Guide (ARM DUI  
0205)  
RealView Compilation Tools v1.2 Linker and Utilities Guide (ARM DUI 0206)  
RealView Compilation Tools v1.2 Assembler Guide (ARM DUI 0204)  
RealView Compilation Tools v1.2 Developer Guide (ARM DUI 0203).  
The following documentation provides general information on the ARM architecture,  
processors, associated devices, and software interfaces:  
ARM Architecture Reference Manual (ARM DUI 0100). This is provided in  
electronic form with ADS and is also available as a printed book:  
David Seal, ARM Architecture Reference Manual, Second Edition, 2001, Addison  
Wesley. ISBN 0-201-73719-1  
ARM Reference Peripheral Specification (ARM DDI 0062)  
viii  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
Preface  
ARM-Thumb® Procedure Call Standard (ATPCS) Specification (SWS ESPC  
0002).  
Refer to the following documentation for information relating to the ARM debug  
interfaces suitable for use with RealView Debugger:  
ARM Agilent Debug Interface v1.0 User Guide (ARM DUI 0158)  
Multi-ICE version 2.2.2 User Guide (ARM DUI 0048).  
Refer to the following documentation for information relating to specific ARM Limited  
processors:  
ARM7TDMI (Rev 4) Technical Reference Manual (ARM DDI 0210)  
ARM7EJ-S (Rev 1) Technical Reference Manual (ARM DDI 0214)  
ARM9TDMI (Rev 3) Technical Reference Manual (ARM DDI 0180)  
ARM920T (Rev 1) Technical Reference Manual (ARM DDI 0151)  
ARM922T (Rev 0) Technical Reference Manual (ARM DDI 0184)  
ARM9EJ-S (Rev 1) Technical Reference Manual (ARM DDI 0222)  
ARM926EJ-S (Rev 0) Technical Reference Manual (ARM DDI 0198)  
ARM940T (Rev 2) Technical Reference Manual (ARM DDI 0144)  
ARM946E-S (Rev 1) Technical Reference Manual (ARM DDI 0201)  
ARM966E-S (Rev 2) Technical Reference Manual (ARM DDI 0213)  
ARM1020E Technical Reference Manual (ARM DDI 0177)  
ARM1022E Technical Reference Manual (ARM DDI 0237).  
Refer to the following documentation for details on the FLEXlm® license management  
system, supplied by GLOBEtrotter Inc., that controls the use of ARM applications:  
ARM FLEXlm License Management Guide (ARM DUI 0209).  
Other publications  
For a comprehensive introduction to ARM architecture see:  
Steve Furber, ARM system-on-chip architecture (2nd edition, 2000). Addison Wesley,  
ISBN 0-201-67519-6.  
For the definitive guide to the C programming language, on which the RealView  
Debugger macro and expression language is based, see:  
Brian W. Kernighan, Dennis M. Ritchie, The C Programming Language (2nd edition,  
1989). Prentice-Hall, ISBN 0-13-110362-8.  
For more information about Oak and TeakLite processors from the DSP Group see:  
http://www.dspg.com.  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
ix  
Preface  
Contact information for MaxCore from AXYS is available at:  
http://www.axysdesign.com.  
x
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
Preface  
Feedback  
ARM Limited welcomes feedback on both RealView Debugger and its documentation.  
Feedback on RealView Debugger  
If you have any problems with RealView Debugger, please submit a Software Problem  
Report:  
1.  
Select Help Send a Problem Report... from the RealView Debugger main  
menu.  
2.  
3.  
Complete all sections of the Software Problem Report.  
To get a rapid and useful response, please give:  
a small standalone sample of code that reproduces the problem, if  
applicable  
a clear explanation of what you expected to happen, and what actually  
happened  
the commands you used, including any command-line options  
sample output illustrating the problem.  
4.  
Email the report to your supplier.  
Feedback on this book  
If you have any comments on this book, please send email to [email protected]mgiving:  
the document title  
the document number  
the page number(s) to which your comments apply  
a concise explanation of your comments.  
General suggestions for additions and improvements are also welcome.  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
xi  
     
Preface  
xii  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
Chapter 1  
About RealView Debugger  
development environment for embedded systems applications using the ARM family of  
processors.  
This chapter contains the following sections:  
RealView Debugger on page 1-2  
About the debugging environment on page 1-4  
Debugging mode on page 1-6  
Using the documentation suite on page 1-7.  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
1-1  
   
About RealView Debugger  
1.1  
RealView Debugger  
RealView Debugger enables you to debug your embedded application programs and  
have complete control over the flow of the program execution so that you can quickly  
isolate and correct errors.  
1.1.1  
RealView Debugger concepts and terminology  
The following terminology is used throughout the RealView Debugger documentation  
suite to describe debugging concepts:  
Debug target  
A piece of hardware or simulator that runs your application program. A  
hardware debug target might be a single processor, or a development  
board containing a number of processors.  
Connection The link between the debugger program and the debug target.  
Single connection access  
The base installation of RealView Debugger enables you to carry out  
debugging tasks in single-processor debugging mode, that is where there  
is only one target connection.  
Multiprocessor access  
RealView Debugger has been developed as a fully-featured debugger for  
working with multiprocessor debug target systems. Multiprocessor  
access enables you to maintain one or more connections to debug targets.  
Multiprocessor access is a separately licensed feature of RealView  
Debugger.  
DSP  
RealView Debugger has been developed to provide full debugging  
functions when working with a range of debug target systems including  
Digital Signal Processors (DSPs). DSP-based debugging is a separately  
licensed feature of RealView Debugger.  
RTOS  
Operating systems provide software support for application programs  
running on a target. Real Time Operating Systems (RTOSs) are operating  
systems that are designed for systems that interact with real-world  
activities where time is critical.  
1-2  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
             
About RealView Debugger  
Multithreaded operation  
RTOS processes can share the memory of the processor so that each can  
share all the data and code of the others. These are called threads.  
RealView Debugger enables you to:  
attach Code windows to threads to monitor one or more threads  
select individual threads to display the registers, variables, and  
code related to that thread  
change the register and variable values for individual threads.  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
1-3  
   
About RealView Debugger  
1.2  
About the debugging environment  
RealView Debugger uses a three-tier environment to debug application programs:  
the debugger software  
the debug interface layer, incorporating the execution vehicles  
the debug target.  
RealView Debugger uses connection information to describe:  
how the debugger connects to the debug target  
information required to use that connection  
what kind of processor the target is using.  
It might also include cached copies of processor registers or memory.  
This approach means that you can switch between debug targets without having to start  
a second or third instance of the debugger program.  
This section describes the RealView Debugger debugging environment:  
Components of RealView Debugger  
Debug target interface on page 1-5  
Persistence information on page 1-5.  
1.2.1  
Components of RealView Debugger  
RealView Debugger comprises:  
GUI  
The Graphical User Interface (GUI) gives access to the main features of  
the debugger, command processing, and the Code windows.  
Target Vehicle Server (TVS)  
RealView Debugger maintains connections through the TVS and plugins  
that support each combination of target processor and execution vehicle.  
Using plugins, for example a board file (*.brd), and board-chip definition  
files (*.bcd), enables RealView Debugger to enumerate advanced  
information about your target hardware or processor.  
The TVS contains the basic debugging functionality and forms most of  
the software making up RealView Debugger. If you have the appropriate  
licenses, the TVS provides multiprocessor debugging, supports  
multithreaded operation under an RTOS, and enables tracing and  
performance profiling.  
1-4  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
             
About RealView Debugger  
RealView Connection Broker  
RealView Connection Broker operates in two modes:  
Local  
Operating as RealView Connection Broker, this runs on your  
local workstation and enables you to access local targets.  
Remote Operating as RealView Network Broker, this runs on a remote  
workstation and makes specified targets on that workstation  
available to other workstations connected to the same network.  
1.2.2  
Debug target interface  
RealView Debugger works with either a hardware or a software debug target. An ARM  
development board communicating through Multi-ICE® is an example of a hardware  
debug target system. ARMulator is an example of a software debug target system.  
The debug target interface contains the execution vehicles that process requests from the  
client tools to the target. A debug interface might be a JTAG interface unit such as  
Multi-ICE, a simulator, or a ROM monitor.  
1.2.3  
Persistence information  
RealView Debugger maintains persistence information to enable you to halt a  
debugging session and resume at a later date. This means that RealView Debugger can  
remember your working environment including:  
current target connections  
loaded images  
open projects  
desktop settings, for example pane selections and window positions.  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
1-5  
           
About RealView Debugger  
1.3  
Debugging mode  
The base installation of RealView Debugger enables you to debug your images in single  
connection mode, that is, where there is only one connection.  
If you have the appropriate license, you can also debug multiprocessor applications.  
RealView Debugger supports such multiprocessor debugging by maintaining  
connections to multiple debug targets through one or more Code windows. When  
working in multiprocessor debugging mode, you can use one Code window to cycle  
through the connected targets, or multiple Code windows to view different targets.  
Multiprocessor debugging mode is a separately licensed feature of RealView Debugger  
and is described in detail in RealView Debugger v1.6 Extensions User Guide.  
1-6  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
     
About RealView Debugger  
1.4  
Using the documentation suite  
The RealView Debugger documentation suite consists of five books:  
RealView Debugger v1.6 Essentials Guide  
RealView Debugger v1.6 User Guide  
RealView Debugger v1.6 Target Configuration Guide  
RealView Debugger v1.6 Command Line Reference Guide  
RealView Debugger v1.6 Extensions User Guide.  
At the front of each book is a Preface describing how the contents are organized and  
how information is presented in the chapters. The following description explains how  
you might use the books:  
1.  
You are recommended to read the chapters in this book, RealView Debugger v1.6  
Essentials Guide, to start debugging your images and to learn how to use  
RealView Debugger quickly. This book describes the minimum needed for the  
new user.  
2.  
For a comprehensive description of the features available in RealView Debugger,  
see RealView Debugger v1.6 User Guide. This describes, in detail, how to debug  
your images, how to work with projects, and how to configure RealView  
Debugger to customize your working environment. This book also contains  
examples of debugging software and details shortcuts, and tips, for the developer.  
3.  
4.  
RealView Debugger v1.6 Target Configuration Guide describes how to connect to  
targets, how to amend existing targets that are set up in the base installation, and  
how to customize your own targets.  
If you want to use the RealView Debugger Command Line Interface (CLI) to  
control your debugging tasks, RealView Debugger v1.6 Command Line Reference  
Guide provides a detailed description of every CLI command and includes  
examples of their use.  
5.  
If you have the appropriate licenses, you can access RealView Debugger  
extensions, for example multiprocessor debugging mode and Trace. These  
features are described in RealView Debugger v1.6 Extensions User Guide.  
Refer to ARM FLEXlm License Management Guide for details on the license  
management system that controls the use of ARM applications.  
See the installation notes delivered with your product for details on installing RealView  
Debugger.  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
1-7  
     
About RealView Debugger  
1-8  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
Chapter 2  
Features of RealView Debugger  
This chapter describes the features of RealView Debugger and highlights new  
functionality in RealView Debugger v1.6. It contains the following sections:  
RealView Debugger v1.6 on page 2-2  
Getting more information online on page 2-5.  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
2-1  
   
Features of RealView Debugger  
2.1  
RealView Debugger v1.6  
OS awareness  
Extended Target Visibility (ETV)  
Advanced debugging facilities  
Trace, Analysis, and Profiling on page 2-3  
Project manager on page 2-4  
RealView Debugger downloads on page 2-4.  
2.1.1  
2.1.2  
Multi-core debugging  
RealView Debugger v1.6 provides a single debug kernel for mixed ARM and DSP  
debugging. The debugger provides full support for synchronized start and stop,  
stepping, and cross triggering of breakpoints.  
OS awareness  
RealView Debugger v1.6 enables you to:  
use RTOS debug including Halted System Debug (HSD)  
interrogate and display resources after execution has halted  
access semaphores and queues  
view the status of the current thread or other threads  
customize views of application threads.  
2.1.3  
2.1.4  
Extended Target Visibility (ETV)  
RealView Debugger v1.6 provides visibility of targets such as boards and SoC. Users  
can configure targets using board-chip definition files and preconfigured files are  
available:  
ARM family files provided as part of the installation  
customer/partner board files provided through ARM DevZone®.  
Advanced debugging facilities  
RealView Debugger v1.6 provides standard debug views and advanced debugging  
features:  
RealView Debugger supports variables of 64-bit type ‘long long’ throughout the  
user interface (new in v1.6).  
2-2  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
           
Features of RealView Debugger  
There is now support for module statics, that is static variables of non-local scope,  
in the Call Stack pane (new in v1.6).  
RealView Debugger offers a powerful command-line interface and scripting  
capability that includes macros support, conversion from ARM AXD and armsd,  
and history lists to record previous actions.  
Users can access a console (headless debugger) driven from the command line or  
from scripts (new in v1.6).  
RealView Debugger includes an editing control called Tooltip Evaluation that  
provides hover-style evaluation in different code views (new in v1.6).  
RealView Debugger enables you to position a Memory pane to display a memory  
region based on the contents of a variable or register in the Register or Watch  
panes, or in the Src tab (new in v1.6).  
Users now have greater control over panes in the Code window and the debug  
views displayed. RealView Debugger provides the option of using a single Code  
window to display a wide range of data views during debugging (new in v1.6).  
Programming Flash modules are available as standard.  
Memory mapping is enabled if required.  
Colored memory views indicate the type of memory according to memory map  
settings.  
2.1.5  
Trace, Analysis, and Profiling  
New in RealView Debugger v1.6, Trace, Analysis, and Profiling is enabled by a Trace  
debug license. Trace support is available for:  
ARM ETM v1.0 (ETM7 and ETM9), including On-Chip Trace  
ARM ETM v2.0 (ETM10) (beta)  
ARMulator ETM simulator  
AXYS Oak and TeakLite MaxSim simulators  
DSP Group On-Chip Trace (Oak and TeakLite)  
Motorola 56600 On-Chip Trace  
Intel XScale On-Chip Trace.  
Trace and Profiling provides full trace support including simple and complex  
tracepoints and data filtering:  
viewing raw trace  
viewing code trace  
viewing data trace  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
2-3  
 
Features of RealView Debugger  
viewing disassembly trace  
tracing of function calls  
the profiling of time spent in each function  
the ability to filter captured trace data by field  
the ability to sort captured trace data by field.  
You can set tracepoints directly in the source-level view and/or the disassembly-level  
view. The same functionality is available in the Memory pane so that you can select  
regions in memory to trace, or trace a specific memory value when it changes.  
2.1.6  
2.1.7  
Project manager  
RealView Debugger v1.6 is a fully-featured Integrated Development Environment  
(IDE) including a project manager and build system.  
New in v1.6, the project manager includes a Configuration Summary window to display  
the switch string passed to the compiler tools for build target configurations in the  
current project.  
RealView Debugger downloads  
ARM provides a range of services to support developers using RealView Debugger.  
Among the downloads available are OS awareness modules to support RTOS  
developers and enhanced support for different hardware platforms through technical  
information and board description files. See http://www.arm.comto access these  
resources from ARM DevZone.  
2-4  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
   
Features of RealView Debugger  
2.2  
Getting more information online  
The full documentation suite is available online as DynaText, XML, and PDF files.  
Select Start Programs RealView Debugger v1.6 from the Windows Start  
menu. From here:  
select Online Books to view the DynaText files  
select XML Documentation to see the XML version.  
You can also access the DynaText files from the Help menu when RealView Debugger  
is running.  
For a Typical installation, the DynaText and XML files are installed in:  
C:\Program Files\ARM\Documentation  
To access the XML documentation, you must use either:  
Netscape 6.2  
Mozilla 1.0.  
The PDF files are installed, as part of the base installation, in install_directory\PDF  
.
Note  
The DynaText, XML, and PDF files contain the same information.  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
2-5  
     
Features of RealView Debugger  
2-6  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
Chapter 3  
Getting Started with RealView Debugger  
This chapter gives step-by-step instructions to get started with RealView Debugger,  
including making a connection and loading an image for debugging. It also covers the  
main tasks that you might carry out in a debugging session.  
Starting RealView Debugger on page 3-2  
Connecting to a target on page 3-4  
Working with memory on page 3-7  
Loading an image on page 3-10  
Debugging an image on page 3-14.  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
3-1  
   
Getting Started with RealView Debugger  
3.1  
Starting RealView Debugger  
To start your debugging session, you must complete the following steps:  
1.  
2.  
3.  
Start RealView Debugger.  
Connect to your chosen debug target.  
Load an image for debugging.  
This section describes how to start RealView Debugger and display the default Code  
window. It contains the following sections:  
Starting RealView Debugger  
The Code window.  
3.1.1  
Starting RealView Debugger  
To start RealView Debugger:  
1.  
Select Start Programs RealView Debugger v1.6 from the Windows Start  
menu.  
2.  
Select RealView Debugger from the menu.  
The first time you run RealView Debugger after installation, it creates a unique working  
directory, in your RealView Debugger home directory, for you to store your personal  
files, debugger settings, and target configuration files. RealView Debugger then creates  
or copies files into this directory ready for your first debugging session.  
If a user ID is not specified then RealView Debugger creates a general-purpose working  
directory called install_directory\home\owner  
.
3.1.2  
The Code window  
Starting RealView Debugger immediately after installation displays the default Code  
window to provide a starting point for all debugging tasks. The Code window is your  
main debugging and editing window. This is shown in Figure 3-1 on page 3-3.  
3-2  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
               
Getting Started with RealView Debugger  
Color Box  
Title bar  
Toolbars Pane Management Build controls  
Processor  
State  
controls  
Side pane  
File Editor pane  
Output pane  
Keyboard  
status  
Cursor location field  
Status  
line  
Pane  
title bar  
Command line  
The appearance of the Code window depends on your licenses. For example, the base  
installation enables you to debug your images in single connection mode, that is where  
there is only one connection. If you are working in this mode, the title bar does not show  
[Unattached]  
.
For a full description of the contents of this window, see Chapter 6 RealView Debugger  
Desktop.  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
3-3  
 
Getting Started with RealView Debugger  
3.2  
Connecting to a target  
The next stage in your debugging session is to connect to your debug target. The base  
installation of RealView Debugger includes built-in configuration files to enable you to  
make a connection without having to modify any configuration details.  
This section introduces target configuration and how to make a connection:  
Target configuration  
Working with connections  
Making a connection on page 3-5  
Setting connect mode on page 3-6.  
3.2.1  
Target configuration  
RealView Debugger uses a board file to access information about the debugging  
environment and the debug targets available to you, for example how memory is  
mapped. See RealView Debugger v1.6 Target Configuration Guide for details of how to  
customize your targets.  
You can start to use RealView Debugger with the default board file installed as part of  
the base installation without making any further changes.  
3.2.2  
Working with connections  
RealView Debugger makes a distinction between target configuration, and how a target  
is accessed, that is the connection.  
Select File Connection Connect to Target... from the main menu to display the  
Connection Control window ready to make your first connection. This is shown in  
Figure 3-2 on page 3-5.  
3-4  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
           
Getting Started with RealView Debugger  
Check box to make  
a connection  
RDI execution vehicle  
Connections  
available  
for this vehicle  
Execution vehicles  
Figure 3-2 Connection Control window  
This window dynamically details all your connections during a debugging session.  
Note  
If you are licensed to use RealView Debugger extensions, the Connection Control  
window includes tabs, not shown here. For example, in multiprocessor debugging  
mode, the window includes a Connect tab and a Synch tab.  
3.2.3  
Making a connection  
If you have ADS 1.2 or RVCT 1.2 installed the top-level entry ARM-A-RRis the execution  
vehicle that supports connections to ARM RDI targets, as shown in Figure 3-2. Expand  
this to show the ARMulatorconnection that uses the ARMulator instruction set simulator.  
The default configuration files installed as part of the base installation enable you to  
connect to an ARM7TDMIcore using ARMulator on your local workstation. The  
Connection Control window shows this default target connection.  
Select the ARM7TDMIcheck box so that it is checked to make the connection.  
With the connection established, your Code window is updated:  
the Code window title bar is updated with the name of the current connection  
the hyperlink in the File Editor pane changes to enable you to load an image  
the Output pane displays details of the connection  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
3-5  
       
Getting Started with RealView Debugger  
panes are updated with debug information, for example the Register pane shows  
the core registers for the connected target.  
Where you are always debugging code on the same target you can configure RealView  
Debugger to make the same connection automatically each time it starts. See the chapter  
describing connecting to targets in RealView Debugger v1.6 Target Configuration  
Guide for details of how to set this option.  
RDI connection details  
RealView Debugger displays RDI connection details in different tabs depending on the  
startup conditions and the Code windows you are using. Because this is the first time  
you connected to an RDI target from the default Code window, the startup connection  
details are displayed in the Log tab and the Cmd tab of the Output pane. In future  
debugging sessions, this information is displayed in the Cmd tab.  
3.2.4  
Setting connect mode  
You can control the way a target processor starts when you connect. This is particularly  
useful when debugging multiprocessor debug targets and working with multiple  
threads. In single processor debugging mode, you might want to leave an image  
executing while RealView Debugger closes down and then restart at a later date.  
If you are not connected, you can set connect mode when you make a new connection:  
1.  
2.  
3.  
Select File Connection Connect to Target... to display the Connection  
Control window.  
Right-click on the connection entry and select Connect (Defining Mode)... from  
the Connection context menu.  
Select the required state from the selection box.  
The options listed depend on your execution vehicle.  
4.  
Click OK to make the connection with the processor in the required state.  
If you set connect mode from the Connection Control window, this temporarily  
overrides any setting in your target configuration file. See the chapter describing  
connecting in RealView Debugger v1.6 Target Configuration Guide for full details on  
setting connect mode for your debug target.  
3-6  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
     
Getting Started with RealView Debugger  
3.3  
Working with memory  
Before you load an image, you might have to define memory settings. This depends on  
the debug target you are using to run your image. For example, if you are using the  
default ARMulator to simulate an ARM processor, setting the value of top of memory  
is not appropriate.  
Where appropriate, defining memory gives you full access to all the memory on your  
debug target. RealView Debugger enables you to do this in different ways, for example  
using an include file, or defining the memory map as part of your target configuration  
settings. These options are described in detail in RealView Debugger v1.6 User Guide.  
Note  
In the example in this section, you set up memory manually for the current session.  
Target memory settings defined in this way are only temporary and are lost when you  
exit RealView Debugger.  
This section describes how to set up memory:  
Setting top of memory and stack values  
Setting top of memory for a session on page 3-8.  
3.3.1  
Setting top of memory and stack values  
The top of memory variable is used to enable the semihosting mechanism to return the  
top of stack and heap. If you are not using an ARM-based target, or if your target does  
not use semihosting, this is ignored.  
If you do not set these values, RealView Debugger uses default settings that are  
dependent on the debug target. For ARM processors the default value used for top of  
memory is 0x20000  
.
When you first connect to an ARM-based target, RealView Debugger displays a  
warning message in the Cmd tab:  
Warning: No stack/heap or top of memory defined - using defaults.  
You can set permanent values for top of memory, stack, and heap, using the Connection  
Properties window. Configure your debug target and define these settings so that they  
are used whenever you connect. See the chapter describing configuring custom targets  
in RealView Debugger v1.6 Target Configuration Guide for an example of how to do  
this.  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
3-7  
       
Getting Started with RealView Debugger  
3.3.2  
Setting top of memory for a session  
If you are working with an appropriate debug target, you can set the value of top of  
memory on a temporary basis, that is for the current session, using the @top_of_memory  
register.  
Note  
If you are using the default ARMulator to simulate an ARM processor, this is not a  
suitable target for setting top of memory in this way because top of memory is set from  
an ARMulator configuration file rather than from within RealView Debugger.  
To set the value of top of memory for an ARM Integrator/AP board and ARM940Tcore,  
using Multi-ICE:  
1.  
Select Debug Memory/Register Operations Set Register... to display the  
Interactive Register Setting dialog box.  
2.  
Specify the register to be changed, @top_of_memory, and enter the required value,  
for example 0x40000, as shown in Figure 3-3.  
Figure 3-3 Setting top of memory for session  
3.  
4.  
Click Set to update the register contents. The Log display is updated to record the  
change.  
Click Close to close the dialog box.  
The Debug tab, in the Register pane, displays the updated value, as shown in the  
example in Figure 3-4 on page 3-9.  
3-8  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
     
Getting Started with RealView Debugger  
Figure 3-4 Changed settings in the Register pane  
The value of top of memory might be displayed in dark blue to show that it has changed  
since the last update.  
If you set this value too low, loading an image to your target might generate a warning  
message in the Cmd tab:  
Warning: No room for heap - could cause unpredictable behavior.  
For full details on setting top of memory for an ARM-based target, see the chapter  
describing memory mapping in RealView Debugger v1.6 User Guide.  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
3-9  
   
Getting Started with RealView Debugger  
3.4  
Loading an image  
When you have connected to a suitably configured debug target you are ready to load  
your image for debugging:  
Loading an image  
What is shown in the title bar? on page 3-12  
Reloading an image on page 3-12  
Unloading an image on page 3-13.  
3.4.1  
Loading an image  
In this example, you load the image dhrystone.axfinstalled as part of the base  
installation. By default this is located in the ARM examples directory in  
install_directory\examples\demo_ARM\dhrystone\Debug.  
Select File Load Image... to load your image. This displays the Load File to Target  
dialog box where you can locate the required image and specify the way in which it is  
loaded.  
Note  
Do not change any default settings in the Load File to Target dialog box.  
Your Code window looks like Figure 3-5 on page 3-11.  
3-10  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
         
Getting Started with RealView Debugger  
Figure 3-5 Code window with an image loaded  
In this Code window Text Coloring is enabled by default and line numbering is turned  
on by selecting Edit Editing Controls Show Line Numbers.  
When you load an image, the debugger:  
inserts the source filename, for the current context, in the File field at the top of  
the File Editor pane  
highlights the location of the Program Counter (PC) at the entry point with a red  
box  
moves the text insertion point to the current location of the PC  
updates the Code window panes as appropriate  
updates the Code window title bar to show the name of the project associated with  
the image  
displays the load line in the Cmd tab in the Output pane.  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
3-11  
   
Getting Started with RealView Debugger  
3.4.2  
What is shown in the title bar?  
The Code window title bar gives details of the connection and any processes running on  
your debug target. If you connect to a target and load an image, your title bar looks like  
the one shown in Figure 3-6.  
Figure 3-6 Code window title bar  
In addition to the application icon, you can see (from left to right):  
RVDEBUG Identifies the Code window. This changes to identify each new Code  
window that you open, for example RVDEBUG_1, or RVDEBUG_2.  
(dhrystone) The project associated with the loaded image.  
@ARM...  
The connection, including the target processor, the connection number,  
and the execution vehicle.  
[Unattached]  
If you are working in multiprocessor debugging mode, this shows the  
attachment of the window to a specified connection. A Code window is  
unattached by default, shown by [Unattached]  
.
If you float a pane, the pane title bar reflects the title bar of the calling Code window.  
Note  
The contents of your title bar might be different from the one shown in Figure 3-6  
depending on your licenses, the current connection (if any), open projects and windows  
attachment. For a full description of the contents, see Chapter 6 RealView Debugger  
Desktop.  
3.4.3  
Reloading an image  
During your debugging session you might have to amend your source code and then  
recompile. Select File Reload Image to Target from the Code window to reload an  
image following these changes.  
Reloading an image refreshes any window displays and updates debugger resources.  
3-12  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
           
Getting Started with RealView Debugger  
3.4.4  
Unloading an image  
You do not have to unload an image from a debug target before loading a new image for  
execution. Display the Load File to Target dialog box and ensure that the Replace  
Existing File(s) check box is selected ready to load the next image.  
However, you might want to unload an image explicitly as part of your debugging  
session, for example if you correct coding errors and then rebuild outside RealView  
Debugger. You can do this using the Process Control pane:  
1.  
2.  
3.  
Select View Pane Views Process Control Pane from the default Code  
window main menu.  
Right-click on the Imageentry, for example dhrystone.axf, or on the Load entry,  
Image+Symbols, to display the Image context menu.  
Select Unload.  
You can also unload an image by clicking on the check box associated with the Load  
entry so that it is unselected.  
Unloading an image does not affect target memory. It unloads the symbols and removes  
most of the image details from RealView Debugger. However, the image name is  
retained.  
Note  
To remove image details completely, right-click on the Imageentry in the Process  
Control pane and select Delete Entry.  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
3-13  
   
Getting Started with RealView Debugger  
3.5  
Debugging an image  
Chapter 4 Quick-start Tutorial provides details on using the features of RealView  
Debugger with your images. This section summarizes how to start debugging with  
RealView Debugger:  
Getting started  
Code views on page 3-15  
Viewing target status on page 3-15.  
3.5.1  
Getting started  
You can start debugging your image when you have completed the following steps:  
1.  
2.  
3.  
Start RealView Debugger, see Starting RealView Debugger on page 3-2.  
Connect to your target, see Making a connection on page 3-5.  
Set top of memory, if appropriate, see Setting top of memory for a session on  
page 3-8.  
4.  
Load your image, see Loading an image on page 3-10.  
To start your debugging session:  
1.  
2.  
Select Edit Editing Controls Show Line Numbers to display line  
numbers.  
This is not necessary but might help you to follow the examples.  
Right-click in the first entry in the Memory pane, <NoAddr>, and select Set New  
Start Address... from the context menu.  
3.  
4.  
5.  
6.  
Enter a value as the start address for the area of interest, for example 0x8008  
Click Set to confirm the setting and close the dialog box.  
Click on the Src tab in the File Editor pane.  
.
Set a simple, unconditional breakpoint at line 149 in dhry_1.c Proc_5();, by  
,
double-clicking on the line number.  
If the line number is not visible, then double-click inside the gray area at the left  
of the required statement in the File Editor pane to set the breakpoint.  
7.  
Set a watch by right-clicking on the variable Int_1_Locat line 152 in dhry_1.cso  
that it is underlined in red. Select Watch from the context menu.  
3-14  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
         
Getting Started with RealView Debugger  
8.  
9.  
To start execution either:  
Select Debug Execution Control Go (Start Execution) from the  
main menu.  
Click the Go button on the Actions toolbar.  
Enter the required number of runs, for example 50000  
.
10. Monitor execution until the breakpoint is reached.  
11. Click Go again and monitor the programas execution continues.  
3.5.2  
Code views  
Use the File Editor pane to view source code during your debugging session. In the  
example shown in Figure 3-5 on page 3-11, the File Editor pane contains three tabs:  
the Dsm tab enables you to track program execution in the disassembly-level  
view  
the Src tab enables you to track program execution in the source-level view  
the file tab dhry_1.cshows the name of the current source file in the editing, or  
non-execution, view.  
Click on the relevant tab to toggle between the different code views.  
3.5.3  
Viewing target status  
The State group, on the Actions toolbar, shown in Figure 3-5 on page 3-11, enables you  
to see the current state of your debug target:  
Unknown  
Shows that the current state of the target is unknown to the debugger. For  
example it might have been running when the connection was established  
or it might be disconnected.  
Stopped  
Running  
Shows that the target is connected but any image loaded is not executing.  
Shows that an image is executing. In this case, a running progress  
indicator is also included.  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
3-15  
       
Getting Started with RealView Debugger  
3-16  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
Chapter 4  
Quick-start Tutorial  
This chapter provides a step-by-step tutorial using RealView Debugger to debug your  
Setting up your first project on page 4-3  
Debugging with RealView Debugger on page 4-13  
Working with custom panes on page 4-27  
More about projects on page 4-29  
Completing the tutorial on page 4-35.  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
4-1  
   
Quick-start Tutorial  
4.1  
How to use the tutorial  
The tutorial starts by setting up a user-defined project to build an image for debugging.  
A user-defined project in RealView Debugger is not required for debugging, but it can  
provide a powerful aid to development. A project enables RealView Debugger to save  
your list of files, understand your build model, and maintain a record of your  
project-level preferences. In this tutorial, you build source files installed as part of the  
base installation and then debug the executable.  
If you do not set up your own project, you can follow the tutorial using the supplied  
project, named dhrystone.prj, installed in the ARM examples directory. This sample  
project comes with a ready-built image, named dhrystone.axf, installed in the directory  
install_directory\examples\demo_ARM\dhrystone\Debug  
.
4.1.1  
Getting started  
Begin by making a copy of the source files provided so that the tutorial is self-contained  
and the installed example files are untouched:  
1.  
Create a new directory called install_directory\Tutorial. This is the tutorial  
project base directory.  
2.  
Copy the required files, dhry.h dhry_1.c, and dhry_2.c, from the examples  
,
directory, that is install_directory\examples\demo_ARM\dhrystone, into the new  
tutorial directory.  
Start your session so that you can follow the tutorial:  
1.  
Start RealView Debugger, as described in Starting RealView Debugger on  
page 3-2.  
2.  
Connect to the ARM7TDMIcore processor using ARMulator, as described in Making  
a connection on page 3-5.  
You can complete the tutorial using the default files provided in the base installation. It  
is not necessary to change any of these files or to amend any configuration files.  
4-2  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
       
Quick-startTutorial  
4.2  
Setting up your first project  
RealView Debugger enables you to set up different types of user-defined projects:  
Standard project, including Compile/Assemble/Link  
Library project, including Compile/Assemble/Add to library  
Custom project, using your makefile or defining a no-build project to hold only  
image and properties  
Container project, composed of existing projects  
Copy, created by copying existing projects.  
When you create a new project, you can also merge a saved auto-project to create a  
user-defined project.  
For full details on creating different types of project, merging project settings, and  
accessing the project management features of RealView Debugger, see the chapter  
describing managing projects in RealView Debugger v1.6 User Guide.  
This section takes you through the basic steps to set up a Standard user-defined project  
based on a set of example source files in the base installation. Follow this section to  
specify the default behavior for your C, C++, or assembly language programs, and build  
an image. This section describes:  
Defining a Standard Project on page 4-5  
Setting up compiler options on page 4-7  
Project base directory on page 4-9  
Building the application on page 4-9  
Project files on page 4-10  
Closing the project on page 4-11.  
Note  
This section introduces the Build-Tool Properties window and the Project Properties  
window to set up your first development project. There are full descriptions of the  
general layout and controls of these Settings windows in the RealView Debugger online  
help topic Changing Settings.  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
4-3  
     
Quick-start Tutorial  
4.2.1  
Defining your build tools  
RealView Debugger provides support for multiple toolchains. The debugger can locate  
your build tools automatically based on your environment variables or Registry entries.  
You can use the default build tools in every project you create or to build source files  
outside a project. However, you can override these settings for specific projects if  
required.  
To see the default toolchain:  
1.  
Select Project Build-Tool Properties... from the Code window main menu.  
This displays the Build-Tool Properties window shown in Figure 4-1.  
Figure 4-1 Build-Tool Properties for a Typical installation  
This shows a Typical installation where the ADS 1.2 toolchain is installed. If you  
have installed a Custom configuration your window looks different.  
When you are working with the Build-Tool Properties window, click on an entry  
in the left or right pane to see a one-line text explanation in the Description field  
at the top of the window. Right-click on an entry and select Detailed  
Description... to see extended online help.  
2.  
Select File Close window to close the Build-Tool Properties window.  
The first time you open the Build-Tool Properties window, RealView Debugger copies  
the file install_directory\etc\genmake.locinto your home directory ready for building  
operations during your debugging sessions. This is updated each time you amend your  
Build-Tool Properties window settings. You are warned before changes are saved in this  
file, but you can restore all entries to the installation defaults if required.  
This is all that is required to start your first project.  
4-4  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
       
Quick-startTutorial  
Note  
For details on how to change your build tools see Changing build tools on page 4-29.  
4.2.2  
Creating a new project  
To set up the new project:  
1.  
Select Project New Project... from the default Code window main menu.  
This displays the Create New Project dialog box. The Project Base field might be  
prefilled with your RealView Debugger installation directory name as defined by  
your environment variable. You can override this.  
2.  
Enter the project details as shown in Figure 4-2.  
2. Click the folder icon and choose <Select Dir>  
to locate the project base directory  
1. Enter project name  
3. Select  
Standard Project  
4. Click OK  
Figure 4-2 Creating a new project  
RealView Debugger confirms that the specified project base directory exists. If the  
directory does not exist, you are given the option to create the directory ready for your  
project files.  
4.2.3  
Defining a Standard Project  
When you close the Create New Project dialog box, RealView Debugger displays the  
Create Standard Project dialog box where you specify the:  
processor family and toolchain you are using  
source files to include in the build process  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
4-5  
       
Quick-start Tutorial  
image name.  
To define the project:  
1.  
2.  
Click on the down arrow to specify the Processor Type that you are using to run  
your images and the toolchain. In this example, that is ARM-ADS  
.
Click the folder icon to open the project base directory, defined previously, and  
specify the source files to use in the build process. This displays the Select source  
files for Project dialog box where you can highlight one or more files. Use the  
Shift or Ctrl keys to select the files dhry_1.cand dhry_2.c  
.
3.  
Click Open and add the required source files to your project.  
The Create Standard Project dialog box looks like Figure 4-3.  
Figure 4-3 Create Standard Project dialog box  
The Executable field contains the image name, that is tutorial.axf. Do not  
change this so that you can follow the rest of the tutorial.  
You do not have to change the project Description field.  
4.  
Click OK to confirm your entries and close the Create Standard Project dialog  
box.  
Closing the dialog box creates the project settings file in the project base directory and  
opens the project into the debugger, shown in the Code window title bar.  
4-6  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
   
Quick-startTutorial  
4.2.4  
Viewing the project settings  
When you close the Create Standard Project dialog box, RealView Debugger displays  
the Project Properties window, shown in Figure 4-4.  
Figure 4-4 Project Properties window  
The Project Properties window enables you to view project settings as defined in the  
project file. Click on the entry ...\tutorial.prjat the top of the list of entries in the left  
pane of the window. This displays the full path of the project settings file in the  
Description field at the top of the window. In this new standard project this is identified  
as install_directory\Tutorial\tutorial.prj  
.
Most entries in the Project Properties window are filled automatically from the Create  
Standard Project dialog box. You do not have to change any entries. Select File Close  
Window from the menu to close the Project Properties window.  
When you examine your project settings and then close the Project Properties window,  
RealView Debugger regenerates the makefiles. The Build tab in the Output pane  
displays information about the generation process. You must wait for this to complete  
before making the next change. See Generated makefiles on page 4-32 for more details.  
4.2.5  
Setting up compiler options  
For this tutorial, you must specify a preprocessor macro that is included as part of the  
build model. You have to set the -Dcompiler switch to specify how the compiler  
processes #ifdirectives. You must set this to MSC_CLOCKto specify the C function library  
to control how timing measurements are made.  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
4-7  
         
Quick-start Tutorial  
To do this you must change a project setting:  
1.  
Select Project Project Properties... from the default Code window main  
menu to display the Project Properties window.  
2.  
3.  
4.  
Click on *COMPILE=arm in the left pane to see the contents.  
Double-click on Preprocessorin the right pane to see the contents.  
Right-click on Definein the right pane and select Edit Value from the context  
menu.  
5.  
6.  
Type MSC_CLOCK and press Enter.  
An asterisk is placed at the front of the setting to show that it has changed from  
the default.  
Select File Save and Close from the menu to close the Project Properties  
window.  
RealView Debugger regenerates the makefiles, as shown in the Build tab in the Output  
pane. You must wait for this to complete before making more changes.  
Customizing your project  
You can also make other changes to the project to specify the build model, for example  
to suppress compiler warning messages. To do this you must change a project setting:  
1.  
Select Project Project Properties... from the default Code window main  
menu to display the Project Properties window.  
2.  
3.  
4.  
5.  
Click on *COMPILE=arm in the left pane to see the contents.  
Double-click on Messagesin the right pane to see the contents.  
Double-click on Warningin the right pane to see the contents.  
Right-click on Suppress_warningsin the right pane and select enabled from the  
context menu.  
6.  
Select File Save and Close from the menu to close the Project Properties  
window.  
RealView Debugger regenerates the makefiles, as shown in the Build tab in the Output  
pane. You must wait for this to complete before making more changes.  
4-8  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
 
Quick-startTutorial  
4.2.6  
Project base directory  
When the new project setup is complete, your project base directory is updated with the  
files required to manage your new project. These are the:  
project file tutorial.prj  
build target configuration directories Debug Release, and DebugRel  
,
generated makefiles for each build target configuration, for example  
tutorial_Debug.mk  
.
Note  
The project source files do not have to be in the project base directory, although this is  
recommended for single-user, self-contained projects.  
4.2.7  
Building the application  
If you have the ARM C compiler installed on your workstation, you can now build the  
application defined by the example project tutorial.prj. If you do not have the  
compiler installed, you can follow the steps to complete the tutorial but you cannot build  
an executable.  
To build the executable for the example project:  
1.  
2.  
Select Tools Build... from the default Code window main menu.  
If you have made any changes to the Project Properties, or to the Build-Tool  
Properties, you are prompted to rebuild all project files.  
Click Yes to confirm the rebuild.  
The build, or rebuild, completes and RealView Debugger displays the Build tab, in the  
Output pane, to report successful completion. The Build tab also displays any errors or  
warnings generated during the build.  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
4-9  
         
Quick-start Tutorial  
4.2.8  
Project files  
The project you have just created is a single-user, self-contained project. This means  
that the project base directory now contains all the files associated with the tutorial  
project, as described in Table 4-1.  
Table 4-1 Tutorial project files  
Project  
contains  
Directory/filename  
Description  
Debug  
directory  
Debug  
This area contains the object files and the  
executable ready for debugging or execution.  
By default, Debug is specified as the active  
configuration for this project. This means that  
this is the build target configuration that is built  
and loaded. Change this using the Project  
Properties window to view, and amend, the  
CONFIGURATIONgroup, shown in Figure 4-4 on  
page 4-7.  
DebugRel  
directory  
DebugRel  
Release  
This area is empty.  
Release  
This area is empty.  
directory  
Source files  
Project file  
dhry_1.c  
dhry_2.c  
dhry.h  
The original source files and headers for the  
project. If any files have been edited, this area  
also includes the backup files (see Backup files  
on page 4-11).  
tutorial.prj  
The project settings file, using the project name  
specified when the project was created. This is  
identified as the first entry in the project settings,  
If the project settings have been edited, this area  
also includes the backup file (see Backup files on  
page 4-11).  
makefiles  
tutorial_Debug.mk  
tutorial_DebugRel.mk  
tutorial_Release.mk  
The makefiles generated by RealView Debugger  
for each build target configuration (see  
Generated makefiles on page 4-32).  
The filenames and the rules can be changed in  
the project settings using the Project Properties  
window to view, and amend, the BUILDgroup,  
shown in Figure 4-4 on page 4-7.  
4-10  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
     
Quick-startTutorial  
Executable files  
By default, the executable image created in this project is saved in  
install_directory\Tutorial\Debug\tutorial.axf. You can copy this file to another  
location or share it with others in your development team. You can load the image to a  
target processor without opening the project first. However, where you have created a  
user-defined project, it is recommended that you open the project first to load and debug  
the associated image. Opening the project enables you to access the project properties,  
save new settings, or make changes to the build model.  
Backup files  
If you make any changes to the project during your current session, a backup file is  
automatically created to enable you to recover from any accidental editing or to restore  
previous settings. Similarly, changing a source file in the File Editor pane also creates a  
backup file for safety. These files are given the .bakextension by default, for example  
dhry_1.c.bak, and tutorial.prj.bak, and are located in the project base directory.  
4.2.9  
Closing the project  
The default Code window title bar shows the name of your new project:  
RVDEBUG(tutorial) = @ARM7TDMI_0:ARM-A-RR [Unattached]  
The project is automatically associated with the connection. This is called project  
binding. The project name, tutorial, is enclosed in round brackets to show that it is  
bound to the connection.  
Note  
If several projects are open, the title bar shows the name of the active project. See the  
chapter describing managing projects in RealView Debugger v1.6 User Guide for  
details on controlling projects.  
You can keep projects open while you are debugging. This might be useful to add new  
files to the project or if source files change. It is not necessary to keep the project open  
to debug the executable you just created.  
To close the project, select Project Close Project... from the Code window main  
menu. Because there is only one open project, it closes immediately.  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
4-11  
             
Quick-start Tutorial  
Note  
If you have loaded the image created by your project, RealView Debugger gives you the  
option to unload the image. Unload the image associated with the project to avoid the  
creation of an auto-project (see Working with images on page 4-16 for more details).  
The Code window title bar shows that the project is no longer open.  
Any files displayed in the File Editor pane remain after the parent project closes. To  
close the file shown on the top tab, either:  
select File Close from the Code window main menu  
right-click on the file tab and select Close from the context menu.  
If any file has been edited, you are warned and given the option to save the file before  
it closes. A backup copy of the previous version is saved by default, unless you have  
changed this in your workspace.  
If you have several files displayed in the File Editor pane, the next tab is brought to the  
top and you can then close this one in the same way.  
In the next part of the tutorial you use the debugging features of RealView Debugger to  
load an executable image and monitor execution. It is not necessary to exit RealView  
Debugger at this stage.  
4-12  
Copyright © 2002 ARM Limited. All rights reserved.  
ARM DUI 0181B  
Quick-startTutorial  
4.3  
Debugging with RealView Debugger  
This section gives you step-by-step instructions to carry out some basic debugging  
tasks. These examples use the sample project dhrystone.prj, supplied as part of the  
RealView Debugger base installation. If you prefer, you can use the executable built in  
Setting up your first project on page 4-3 and saved in the tutorial project, tutorial.prj  
.
If you are not licensed to use RealView Debugger extensions, your Code window might  
look different to the one shown in the rest of this tutorial. This does not affect the  
tutorial.  
This section contains the following subsections:  
Getting started  
Basic debugging tasks on page 4-14  
Using breakpoints on page 4-22.  
4.3.1  
Getting started  
Complete these steps so that you can follow the rest of the tutorial:  
1.  
2.  
3.  
4.  
Start RealView Debugger, as described in Starting RealView Debugger on  
page 3-2.  
Connect to the ARM7TDMIcore processor using ARMulator, as described in Making  
a connection on page 3-5.  
Select Project Open Project... to open the required project, for example  
install_directory\examples\demo_ARM\dhrystone\dhrystone.prj  
.
Click on the hyperlink in the File Editor pane to load the associated image, for  
example install_directory\examples\demo_ARM\dhrystone\Debug\dhrystone.axf  
.
This location has been derived automatically from the project information.  
The default Code window title bar shows the name of your open project:  
RVDEBUG(dhrystone) = @ARM7TDMI_0:ARM-A-RR [Unattached]  
Note  
If you are using the supplied source files, RealView Debugger might warn that the  
source is more recent than the executable. This message can be ignored.  
ARM DUI 0181B  
Copyright © 2002 ARM Limited. All rights reserved.  
4-13