xvw166 v8.7
xvw166 v8.7
xvw166 v8.7
C166/ST10 v8.7
CrossView Pro Debugger
Users Manual
A publication of
Altium BV
Documentation Department
Copyright 2007 Altium BV
http://www.tasking.com
http://www.altium.com
CONTENTS
TABLE OF
CONTENTS
Table of Contents
CONTENTS
CONTENTS
IV
Table of Contents
OVERVIEW
1.1
1.2
1.3
1.4
1.5
1.6
1.6.1
1.6.2
1.6.3
1.6.3.1
1.6.3.2
1.6.3.3
1.6.4
1.6.5
1.6.6
1.6.7
1.6.8
1.6.9
1.6.9.1
1.6.9.2
1.6.9.3
11
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CrossView Pros Features . . . . . . . . . . . . . . . . . . . . . .
Source Level Debugging . . . . . . . . . . . . . . . . . . . . . . .
How CrossView Pro Works . . . . . . . . . . . . . . . . . . . .
C166/ST10 Program Development . . . . . . . . . . . . . .
Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Before Starting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting Up the Execution Environment . . . . . . . . . . .
Starting CrossView Pro . . . . . . . . . . . . . . . . . . . . . . . .
CrossView Pro Target Settings . . . . . . . . . . . . . . . . . .
Configuring CrossView Pro . . . . . . . . . . . . . . . . . . . .
Loading Symbolic Debug Information . . . . . . . . . . .
Executing an Application . . . . . . . . . . . . . . . . . . . . . .
Debugging an Application . . . . . . . . . . . . . . . . . . . . .
CrossView Pro Output . . . . . . . . . . . . . . . . . . . . . . . .
Exiting CrossView Pro . . . . . . . . . . . . . . . . . . . . . . . . .
What You May Have Done Wrong . . . . . . . . . . . . . .
Building Your Executable . . . . . . . . . . . . . . . . . . . . . .
Using EDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the Control Program . . . . . . . . . . . . . . . . . . . . .
Using the Makefile . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SOFTWARE INSTALLATION
2.1
2.2
2.3
2.4
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Note about Filenames . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring the X Windows Motif Environment . . .
Using X Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . .
COMMAND LANGUAGE
3.1
3.2
3.3
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CrossView Pro Expressions . . . . . . . . . . . . . . . . . . . .
Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13
13
18
19
111
113
113
114
115
116
124
125
128
130
132
133
134
135
135
142
145
21
23
23
23
24
31
33
33
34
Table of Contents
VI
3.4
3.5
3.6
3.7
3.8
3.9
3.10
Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Formatting Expressions . . . . . . . . . . . . . . . . . . . . . . . .
Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Special Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . .
Conditional Evaluation . . . . . . . . . . . . . . . . . . . . . . . .
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Case Sensitivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CONTENTS
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the CrossView Pro Interface . . . . . . . . . . . . . .
Starting CrossView Pro . . . . . . . . . . . . . . . . . . . . . . . .
Startup Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What You May Have Done Wrong . . . . . . . . . . . . . .
The CrossView Pro Desktop . . . . . . . . . . . . . . . . . . .
Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Local Popup Menus . . . . . . . . . . . . . . . . . . . . . . . . . . .
Window Operation . . . . . . . . . . . . . . . . . . . . . . . . . . .
Dialog Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Customizing CrossView Pro . . . . . . . . . . . . . . . . . . . .
CrossView Pro Messages . . . . . . . . . . . . . . . . . . . . . .
CrossView Pro Windows . . . . . . . . . . . . . . . . . . . . . .
Command Window . . . . . . . . . . . . . . . . . . . . . . . . . . .
Source Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Register Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Memory Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Data Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Stack Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Trace Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terminal Window . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Data Analysis Window . . . . . . . . . . . . . . . . . . . . . . . .
PopUp Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Control Operations for CrossView Pro . . . . . . . . . . .
Echoing Commands . . . . . . . . . . . . . . . . . . . . . . . . . .
37
313
317
318
319
320
320
41
43
43
44
45
411
412
414
415
415
417
418
420
421
422
424
427
428
430
433
434
435
437
438
439
439
Table of Contents
4.7.2
4.8
4.8.1
4.8.2
VII
Mouse/Menu/Command Equivalents . . . . . . . . . . . .
Using the Online Help . . . . . . . . . . . . . . . . . . . . . . .
Accessing Online Help . . . . . . . . . . . . . . . . . . . . . . .
Using MSWindows Help . . . . . . . . . . . . . . . . . . . . . .
Source Positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Changing the Viewing Position . . . . . . . . . . . . . . . . .
Changing the Execution Position . . . . . . . . . . . . . . .
Synchronizing the Execution and Viewing Positions
Controlling Program Execution . . . . . . . . . . . . . . . . .
Starting the Program . . . . . . . . . . . . . . . . . . . . . . . . . .
Halting and Continuing Execution . . . . . . . . . . . . . .
SingleStep Execution . . . . . . . . . . . . . . . . . . . . . . . . .
Stepping through at the Machine Level . . . . . . . . . .
Notes About Program Execution . . . . . . . . . . . . . . . .
Searching through the Source Window . . . . . . . . . .
Searching for a Function . . . . . . . . . . . . . . . . . . . . . . .
Searching for a String . . . . . . . . . . . . . . . . . . . . . . . . .
Jumping to a Source Line . . . . . . . . . . . . . . . . . . . . . .
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Accessing Variables . . . . . . . . . . . . . . . . . . . . . . . . . . .
Viewing Variables, Structures and Arrays . . . . . . . . .
Changing Variables . . . . . . . . . . . . . . . . . . . . . . . . . . .
The l Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Evaluating Expressions . . . . . . . . . . . . . . . . . . . . . . . .
Monitoring Expressions . . . . . . . . . . . . . . . . . . . . . . .
Formatting Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Displaying Memory . . . . . . . . . . . . . . . . . . . . . . . . . . .
Displaying Memory Addresses . . . . . . . . . . . . . . . . . .
439
440
440
440
51
53
54
55
57
58
58
59
59
512
514
514
514
515
516
61
63
63
63
67
610
611
611
612
614
615
617
Table of Contents
VIII
6.4
6.4.1
6.5
6.5.1
6.5.2
6.5.3
6.5.4
6.6
6.6.1
6.7
6.7.1
6.7.2
CONTENTS
Introduction to Breakpoints . . . . . . . . . . . . . . . . . . . .
Code Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Data Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Listing and Jumping to Breakpoints . . . . . . . . . . . . .
Setting Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . .
Data Breakpoints over a Range of Addresses . . . . .
Temporary Breakpoints . . . . . . . . . . . . . . . . . . . . . . .
Breakpoint Names . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting the Count . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Sequence Breakpoints . . . . . . . . . . . . . . . . . . . . . . . .
Deleting Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . .
Enabling/Disabling Breakpoints . . . . . . . . . . . . . . . .
Breakpoint Commands . . . . . . . . . . . . . . . . . . . . . . . .
Attaching Conditionals to a Breakpoint . . . . . . . . . .
Attaching Macros to a Breakpoint . . . . . . . . . . . . . . .
Attaching Strings to a Breakpoint . . . . . . . . . . . . . . .
Suppressing Breakpoint Messages . . . . . . . . . . . . . . .
Uplevel Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . .
Patches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Patching Code out of a Program . . . . . . . . . . . . . . . .
618
619
620
620
621
623
623
625
625
627
627
629
71
73
73
77
78
78
711
712
713
714
715
716
717
719
721
721
722
722
723
725
725
Table of Contents
7.8.2
7.8.3
7.9
7.10
7.10.1
7.10.2
7.10.3
7.10.4
7.10.5
7.10.6
7.10.7
IX
Recording Commands . . . . . . . . . . . . . . . . . . . . . . . . .
Entering Comments . . . . . . . . . . . . . . . . . . . . . . . . . . .
Suspend Recording . . . . . . . . . . . . . . . . . . . . . . . . . . .
Resume Recording . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Check Recording Status . . . . . . . . . . . . . . . . . . . . . . .
726
726
727
728
728
729
731
731
732
733
735
81
83
83
85
85
86
87
88
89
810
811
811
811
812
91
93
94
95
95
96
Table of Contents
9.1.5
9.1.6
9.2
9.2.1
9.2.2
9.2.3
9.3
9.4
9.4.1
9.4.2
9.4.3
9.4.4
9.4.5
9.5
9.6
CONTENTS
I/O SIMULATION
10.1
10.2
10.2.1
10.2.2
10.3
10.3.1
10.4
10.5
10.5.1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
I/O Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting Up File I/O Streams . . . . . . . . . . . . . . . . . . . .
Redirecting I/O Streams . . . . . . . . . . . . . . . . . . . . . . .
File System Simulation . . . . . . . . . . . . . . . . . . . . . . . .
File System Simulation Libraries . . . . . . . . . . . . . . . .
Debug Instrument I/O . . . . . . . . . . . . . . . . . . . . . . . .
The Terminal Window . . . . . . . . . . . . . . . . . . . . . . . .
Terminal Window Keyboard Mappings . . . . . . . . . .
SPECIAL FEATURES
11.1
11.2
11.3
11.4
11.4.1
Transparency Mode . . . . . . . . . . . . . . . . . . . . . . . . . . .
RTOS Aware Debugging . . . . . . . . . . . . . . . . . . . . . . .
Coverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Profiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Function Profiling . . . . . . . . . . . . . . . . . . . . . . . . . . . .
96
97
98
99
99
910
910
912
913
915
915
915
917
918
919
101
103
103
104
106
107
108
109
1010
1010
111
113
114
116
118
119
Table of Contents
11.4.2
11.5
11.5.1
11.6
11.7
11.7.1
11.7.2
11.7.3
11.7.4
11.7.5
11.7.6
11.7.7
11.7.8
XI
DEBUGGING NOTES
12.1
12.2
COMMAND REFERENCE
13.1
13.2
13.2.1
13.2.2
13.2.3
13.2.4
13.2.5
13.2.6
13.2.7
13.2.8
13.2.9
13.2.10
13.2.11
13.2.12
1110
1111
1113
1119
1123
1123
1124
1125
1126
1127
1127
1127
1128
121
123
123
131
133
134
134
135
137
138
1311
1312
1313
1314
1314
1315
1315
1316
Table of Contents
XII
13.3
ERROR MESSAGES
14.1
14.2
GLOSSARY
15.1
15.2
CONTENTS
141
143
143
151
What this Chapter Covers . . . . . . . . . . . . . . . . . . . . . .
Glossary Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
INTERPROCESS COMMUNICATION
1
1.1
1.2
1.2.1
1.2.2
1.2.3
1.3
1.3.1
1.3.2
1.3.3
1.4
1.5
1.5.1
1.5.2
1.5.3
1.5.4
2
2.1
2.2
2.3
2.3.1
1316
COM Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the COM Object Interface . . . . . . . . . . . . . . . .
RunTime Environment . . . . . . . . . . . . . . . . . . . . . . .
Command Line Options . . . . . . . . . . . . . . . . . . . . . . .
Startup Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
COM Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Activating the COM object . . . . . . . . . . . . . . . . . . . . .
Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Implementation Details . . . . . . . . . . . . . . . . . . . . . . . .
Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
COM Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Python Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Visual Basic Examples . . . . . . . . . . . . . . . . . . . . . . . .
WORD Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Excerpt of the MIDL Definition . . . . . . . . . . . . . . . . .
DDE Server Interface . . . . . . . . . . . . . . . . . . . . . . . . .
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
DDE Items and Topics . . . . . . . . . . . . . . . . . . . . . . . .
DDE Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Packet Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
153
153
A1
A3
A3
A3
A3
A3
A4
A5
A5
A6
A7
A8
A12
A12
A16
A17
A19
A20
A20
A20
A27
A27
Table of Contents
2.4
2.4.1
2.4.2
2.5
2.5.1
2.5.2
2.5.3
2.5.4
2.5.5
XIII
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Syntax of CXL . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Base Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Compound Types . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Constants and Expressions . . . . . . . . . . . . . . . . . . . . .
Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
File Inclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Predefined Functions . . . . . . . . . . . . . . . . . . . . . . . . .
Mathematical functions . . . . . . . . . . . . . . . . . . . . . . . .
Array and String functions . . . . . . . . . . . . . . . . . . . . .
I/O functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Graph functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Miscellaneous functions . . . . . . . . . . . . . . . . . . . . . . .
A28
A28
A28
A29
A29
A30
A31
A32
A32
B1
B3
B4
B6
B6
B7
B7
B8
B8
B9
B9
B10
B10
B11
B11
B13
B17
C1
Table of Contents
XIV
CONTENTS
ROM/RAM MONITOR
1
2
3
4
5
5.1
5.1.1
5.1.2
5.1.3
5.2
5.3
5.3.1
5.4
5.4.1
5.4.2
5.4.3
6
7
8
8.1
8.2
8.3
8.4
8.5
9
10
10.1
10.2
10.3
10.3.1
10.3.2
10.4
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Executable Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
General Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The RAM and ROM Debug Monitor . . . . . . . . . . . . .
Monitor Configurations . . . . . . . . . . . . . . . . . . . . . . . .
RAM Debug Monitor . . . . . . . . . . . . . . . . . . . . . . . . . .
ROM Debug Monitor Using Dual Vector Table . . . .
ROM Debug Monitor Using Memory Switch . . . . . .
Resources used by the Debug Monitors . . . . . . . . . .
Rebuilding the Debug Monitors . . . . . . . . . . . . . . . .
Debug Monitor Configuration Parameters . . . . . . . .
Debug Monitor Interface Description . . . . . . . . . . . .
Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Command Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Target Configuration File . . . . . . . . . . . . . . . . . .
Building your Application . . . . . . . . . . . . . . . . . . . . .
Connecting to the Target Board . . . . . . . . . . . . . . . .
RS232 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CAN (Windows Only) . . . . . . . . . . . . . . . . . . . . . . . . .
CAN Interface Messages . . . . . . . . . . . . . . . . . . . . . . .
Connection Process Messages . . . . . . . . . . . . . . . . . .
Connection Problems . . . . . . . . . . . . . . . . . . . . . . . . .
Troubleshooting the Debug Monitor . . . . . . . . . . . .
Target Board Application Notes . . . . . . . . . . . . . . . . .
Ertec EVA165, EVA167 and EVA167AA . . . . . . . . . . .
Rigel RMB165, RMB167, RMB167SR
and RMB167CRI . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
I+ME C167C Board . . . . . . . . . . . . . . . . . . . . . . . . . . .
Debug Monitors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PHYTEC MM165, MM167CR and MM167CW . . .
Mon1
Mon3
Mon3
Mon3
Mon4
Mon5
Mon5
Mon5
Mon11
Mon13
Mon14
Mon16
Mon18
Mon21
Mon21
Mon21
Mon23
Mon35
Mon40
Mon41
Mon41
Mon43
Mon45
Mon47
Mon49
Mon50
Mon52
Mon55
Mon56
Mon56
Mon56
Mon56
Mon57
Table of Contents
10.4.1
10.4.2
10.5
10.6
XV
Boot Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PHYTEC KC161, KC163, KC164 and KC167 . . .
TQComponents STK16X/STK16XU Starter Kits . . .
SIMULATOR
1
2
3
3.1
4
4.1
4.2
4.3
5
6
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Executable Name . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Supported Features . . . . . . . . . . . . . . . . . . . . . . . . . . .
Mapping Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Peripheral Simulation . . . . . . . . . . . . . . . . . . . . . . . . .
Peripheral Support . . . . . . . . . . . . . . . . . . . . . . . . . . .
Scenario Scripting Using CXL . . . . . . . . . . . . . . . . . . .
Peripheral Examples . . . . . . . . . . . . . . . . . . . . . . . . . .
Target Configuration File . . . . . . . . . . . . . . . . . . . . . .
Restrictions and Implementation Details . . . . . . . . .
Mon57
Mon57
Mon58
Mon58
Sim1
Sim3
Sim3
Sim3
Sim3
Sim4
Sim4
Sim6
Sim8
Sim9
Sim11
OCDS1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . OCDS3
Supported Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . OCDS3
Additional System Requirements . . . . . . . . . . . . . . . . OCDS3
Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . OCDS4
Hardware Installation OCDS via the Parallel Port . . OCDS4
Hardware Installation OCDS via DAS . . . . . . . . . . . . OCDS4
Software Installation . . . . . . . . . . . . . . . . . . . . . . . . . . OCDS4
Configuring CrossView Pro . . . . . . . . . . . . . . . . . . . . OCDS5
OCDS Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . OCDS5
The Target Configuration File . . . . . . . . . . . . . . . . . . OCDS6
Infineon Board OCDS Interface Circuit . . . . . . . . . . OCDS9
The Infineon JTAG connector . . . . . . . . . . . . . . . . . . OCDS11
The connector Layout . . . . . . . . . . . . . . . . . . . . . . . . . OCDS11
Implementation Considerations . . . . . . . . . . . . . . . . . OCDS13
Table of Contents
XVI
CONTENTS
INDEX
PURPOSE
This manual is aimed at users of the CrossView Pro debugger for the
C166/ST10 microcontroller family. It assumes that you are familiar with
programming the C166/ST10.
MANUAL STRUCTURE
Related Publications
Conventions Used In This Manual
CHAPTERS
1. Overview
Highlights specific CrossView Pro features and capabilities, and shows
how to compile code for debugging.
2. Software Installation
Describes how to install CrossView Pro on your system.
3. Command Language
Details the syntax of CrossView Pros command language.
4. Using CrossView Pro
Describes the basic methods of invoking, operating, and exiting
CrossView Pro.
5. Controlling Program Execution
Describes the various means of program execution.
6. Accessing Code and Data
Describes how to view and edit the variables in your source program.
7. Breakpoints and Assertions
Describes breakpoints and assertions.
XVII
XVIII
MANUAL STRUCTURE
APPENDICES
A. Interprocess Communication
Contains a description of the COM interface and the DDE interface.
B. CrossView Extension Language (CXL)
Contains a description of the syntax of CXL scripts.
C. Sound Support (MSWindows)
Describes how to add sound to CrossView Pro events under
MSWindows.
ADDENDUM
Execution Environment
Contains information specific to your particular type of target system.
XIX
XX
RELATED PUBLICATIONS
The C Programming Language (second edition) by B. Kernighan and
D. Ritchie (1988, Prentice Hall)
ANSI X3.1591989 standard [ANSI]
ISO/IEC 9899:1999(E), Programming languages C [ISO/IEC]
MANUAL STRUCTURE
italics
{}
[]
...
For example
command [option]... filename
This line could be written in plain English as: execute the command
command with the optional options option and with the file filename.
XXI
XXII
Illustrations
The following illustrations are used in this manual:
This is a note. It gives you extra information.
This illustration indicates actions you can perform with the mouse.
MANUAL STRUCTURE
CHAPTER
OVERVIEW
OVERVIEW
CHAPTER
12
Chapter 1
Overview
13
1.1 INTRODUCTION
This chapter highlights many of the features and capabilities of CrossView
Pro, including an Introduction to Source Level Debugging and the
C166/ST10 Development Environment.
This chapter also contains the section Getting Started, which shows you
how to compile a program to work with the debugger.
Chapter 1
14
MultiWindow Interface
This interface uses your hosts native windowing system, so that you
already know how to open, close and resize windows. With windows you
can keep track of information concerning registers, the stack, and
variables. CrossView Pro automatically updates each window whenever
execution stops.
You have great freedom in designing a suitable display. You can hide and
resize the various windows if you choose.
Statement Evaluation
You can enter C expressions, CrossView Pro commands or any
combination of the two for CrossView Pro to evaluate. You may also call
functions defined in your source code from the command line. Expression
evaluation is an ideal way to test subroutines by passing them sample
values and checking the results.
Breakpoints
Breakpoints halt program execution and return control to you. There are
several types of breakpoints: code, data, instruction count, cycle count,
timer and sequence.
Code breakpoints let you halt the program at critical junctures of program
execution and observe values of important variables.
OVERVIEW
You may place data breakpoints to determine when memory addresses are
read from, written to, or both. With data breakpoints, you can easily track
the use and misuse of variables.
An instruction count breakpoint halts the program after a specified number
of instructions have been executed; a cycle count breakpoint stops the
program after a number of CPU cycles; a timer breakpoint stops the
program after a number of micro seconds or ticks and sequence
breakpoints stop the program when a number of breakpoints are hit in a
specified sequence.
Data breakpoints, instruction count breakpoints, cycle count breakpoints
and timer breakpoints are not available for all execution environments,
please check the Addendum.
Overview
15
Chapter 1
16
Coverage
When a command such as StepInto or Continue executes the application,
CrossView Pro traces all memory access, i.e. memory read, memory write
and instruction fetch. Through code coverage you can find executed and
nonexecuted areas of the application program. Areas of unexecuted
code may exist because of programming errors or because of unnecessary
code. It may be that your program input, your test set, is incomplete; It
does not cover all paths in the program. Data coverage allows you to
verify which memory locations, i.e. which variables, are accessed during
program execution. Additionally, you can see stack and heap usage. The
availability of this feature depends on the execution environment.
Profiling
Profiling allows you to perform timing analysis on your software. Two
forms of profiling are implemented in CrossView Pro.
Function profiling, also called cumulative profiling, gives you timing
information about a particular function or set of functions. CrossView Pro
shows: the number of times a function is called, the time spent in the
function, the percentage of time spent in the function, and the
minimum/maximum/average time spent in the function. The timing results
include the time spent in functions called by the profiled function.
OVERVIEW
Overview
Macros
Macros let you store and recall complex commands and expressions with a
minimal number of keystrokes. You can store macros in a "toolbox",
making it possible to execute complex functions with the touch of a
mouse button. You can also place macros in command lists of breakpoints
and assertions. You can use flow control statements within macros, and
macros can call other macros, allowing you to construct arbitrarily
complex sequences. Macros can accept multiple parameters, be saved and
loaded from files and can even rename existing CrossView Pro commands.
Record & Playback
At any time, you can record the commands you type, and optionally their
output, to a file. You can also play back files of commands all at once or
in a singlestep playback mode. These functions are helpful for setting up
standardized debugging tests or to save results for later study or
comparison.
Kernel Support
CrossView Pro supports RTOS (RealTime Operating System) aware
debugging for various kernels. Since each kernel is different, the RTOS
aware features are not implemented in the CrossView Pro executable, but
in a library that will be loaded at runtime by CrossView Pro. The amount
of windows and dialogs and their contents is kernel dependent.
OnLine Help
When you click on a Help button or when you press the F1 function key
in an active window, the CrossView Pro help system opens at the
appropriate section. From this point, you can also access the rest of the
help system.
Documentation
CrossView Pro has a comprehensive set of documentation for both new
and experienced users. The manual includes an installation guide,
description of debugging with CrossView Pro, error messages, and a
command reference section. The documentation tries to cover a wide
range of expertise, by making few assumptions about the technical
experience of the reader.
17
Chapter 1
18
OVERVIEW
Overview
With CrossView Pro, you may also take advantage of any advanced
capabilities of your target hardware through emulator mode (transparency
mode). In transparency mode you can communicate with the target as if
the host system were a terminal directly connected to the target. You can
enter and leave transparency mode freely without restarting the debugger
or the target system. CrossView Pro therefore does not interfere with the
normal operation of the target hardware. Thus the debugger is a powerful
accessory to the machinelevel debugging that you might do with the
target system alone. The transparency mode is not available for all
execution environments (such as an evaluation board).
19
Chapter 1
110
OVERVIEW
Overview
111
cp166
c166
m166
a166
l166
ar166
d166
dmp166
mk166
Chapter 1
112
C source file
.c
.ic
.icm
.gso
C compiler
c166
.asm
invocation file
assembly source file
.asm
macro preprocessor
m166
assembly file
.src
assembler
a166
list file .lst
relocatable object
module .obj
invocation file
linker l166
link stage
print file .lnl
linked object
module .lno
invocation file
control program
cc166
linker l166
locate stage
map file .map
OVERVIEW
absolute object
module a.out
Motorola S Formatter
srec166
Motorola Srecords
IEEE Formatter
ieee166
IEEE695 load module.abs
CrossView Pro
Debugger
xfw166
Overview
113
ieee166
ihex166
srec166
xfw166
For a full description of all available utility programs see the chapter
Utilities in the C166/ST10 CrossAssembler, Linker/Locator, Utilities Users
Manual.
1.6.1
BEFORE STARTING
Before using CrossView Pro, there are several things that you must do:
Install the CrossView Pro software. Directions for your particular
system are found in the Software Installation chapter.
Configure your execution environment as described in the
Execution Environment addendum.
Compile the program that you want to debug. A brief description
of this process is outlined in the section Building Your Executable
later in this chapter.
For the purpose of getting you started quickly, we have supplied you with
a demo program that you can debug. The demo program is demo.abs.
Chapter 1
114
1.6.2
OVERVIEW
Overview
1.6.3
115
To invoke CrossView Pro, select it from the Windows Start menu or click
on the Debug application button from EDE. CrossView Pro starts up and
opens the command window, source window and other windows.
Breakpoint
Toggle
Local Toolbar
Main
Status Bar
Figure 14: Command Window
Menu Bar
Local
Toolbars
Main Toolbar
Source Window
Status Bar
Chapter 1
116
OVERVIEW
Overview
117
subfield
fieldvalue
comment
optional comment
Chapter 1
118
OVERVIEW
Description
title
cpu_type
register_file
debug_instrument_module
radm
Overview
119
For FLASH programming support the following items can be added to this
list:
Field
Description
flash_monitor
flash_direct_access
flash_device_num
flash_workspace
flash_vendor0
flash_chip0
flash_width0
flash_chips0
flash_base_address0
For the instruction set simulator (ISS) the following items can be added to
this list:
Field
Description
map_iram
map_sfr
map_ram
Chapter 1
120
Field
Description
map_rom
psm_dll_name
OVERVIEW
For the ROM monitor the following items can be added to this list:
Field
Description
bslack
boot
monitor
Overview
121
Field
Description
syscon
init
einit
reserve
reset_period
rs232_reset_pin
rs232_reset_level
rs232_reset_hold_level
rs232_bootstrap_pin
rs232_bootstrap_level
rs232_bootstrap_hold_level
Chapter 1
122
OVERVIEW
For the JTAG/OCDS connection via parallel port, the following items can
be added to this list:
Field
Description
monitor
JtagDriver
RegisterFile
init
PeripheralsStop
Overview
123
Field
Description
ResetDelay
Cable
ChipReset
ClientValue
reserve
For OCDS via DAS the following items can be added to this list:
Field
Description
RegisterFile
init
Chapter 1
124
Field
Description
ResetDelay
DASserver
AccessPort
TerminateServer
reserve
Notes:
Fields not required for the target can be omitted.
CrossView Pro searches for the *.cfg files in the current directory and
in the etc directory.
OVERVIEW
Overview
125
126
Chapter 1
OVERVIEW
Overview
CrossView Pro remembers all previously saved settings. In this case, the
Load Symbolic Debug Info dialog already contains the previously saved
configuration, so you only have to click the Load button to perform your
actions.
127
Chapter 1
128
1.6.4
EXECUTING AN APPLICATION
To view your source while debugging, the Source Window must be open.
To open this window,
From the View menu, select Source | Source lines
Before starting execution you have to reset the target system to its initial
state. The program counter, stack pointer and any other registers must be
set to their initial value. The easiest way to do this is:
Set the Reset target system check box and the Goto main check
box in the Load Symbolic Debug Info dialog box. (See the previous
section) Goto main automatically enables the Reset application
check box.
Depending on your execution environment a target system reset may have
undesired side effects. For this reason, the target system is reset before the
code is downloaded to the target.
If you have not checked these items:
From the Run menu, select Reset Target System
From the Run menu, select Reset Application
Execute a highlevel single step (either into or over) using the
toolbar in the Source Window (or F11/F10).
The first single step executes the startup code and stops at the first line of
code in main(). You should see your programs source code.
OVERVIEW
Overview
129
Breakpoint Coverage
Toggles
Markers
Profiling
Current
Execution Position
Status
Bar
Chapter 1
130
1.6.5
DEBUGGING AN APPLICATION
When debugging your application you probably want to see the calling
sequence of your program, and inspect the contents of variables and data
structures used within your program.
To see the calling sequence of your program the Stack Window must be
open. The stack window shows the functions that are currently on the
stack. To open the stack window,
From the View menu, select Stack
To see the value of the local variables of a function,
OVERVIEW
Overview
131
Chapter 1
132
1.6.6
Nearly every CrossView Pro command can be given using the graphical
user interface. These commands and the debuggers response is logged in
the Command Output Window which is the upper part of the Command
Window. Alternatively, CrossView Pro commands can be entered directly
(without using the menu system) in the command edit field of the
command window.
To open the Command Window:
From the View menu, select Command | CrossView
Figure 111 shows an example of the Command Window. Commands can
be typed into the command edit field (bottom field) or selected from the
command history list (middle field) and edited then executed. The top
field is referred to as the Command Output Window. Each command,
echoed from the command edit field, is displayed with a > prefix.
CrossViews response to the command is displayed below the command.
OVERVIEW
Output Window
Overview
133
1.6.7
Chapter 1
134
1.6.8
OVERVIEW
Overview
1.6.9
135
Chapter 1
136
The EDE screen provides you with a menu bar, a toolbar (command
buttons) and one or more windows (for example, for source files), a status
bar and numerous dialog boxes.
Project Options Compile
Document Windows
Used to view and edit files.
Project Window
Contains several
tabs for viewing
information about
projects and other
files.
Output Window
Contains several tabs to display
and manipulate results of EDE
operations. For example, to view
the results of builds or compiles.
OVERVIEW
If you have more than one TASKING product installed and you want to
change toolchains, do the following:
1. From the Project menu, select Select Toolchain...
The Select Toolchain dialog appears.
Overview
2. Select the toolchain you want. You can do this by clicking on a toolchain
in the Toolchains list box and click OK.
If no toolchains are present, use the Browse... or Scan Disk... button to
search for a toolchain directory. Use the Browse... button if you know the
installation directory of another TASKING product. Use the Scan Disk...
button to search for all TASKING products present on a specific drive.
Then return to step 2.
How to Open an Existing Project
Follow these steps to open an existing project:
1. From the Project menu, select Set Current >.
2. Select the project file to open. For the demo program select the file
demo.pjt, located in the subdirectory xvw in the examples subdirectory
of the C166/ST10 product tree. If you have used the defaults, the file
demo.pjt is in the directory installationdir\examples\xvw .
How to Load/Open Files
The next two steps are not needed for the demo program because the files
addone.asm and demo.c are already open. To load the file you want to
look at:
1. From the Project menu, select Load Files...
The Choose Project Files to Edit dialog appears.
137
Chapter 1
138
2. Choose the file(s) you want to open by clicking on it. You can select
multiple files by pressing the <Ctrl> or <Shift> key while you click on a
file. With the <Ctrl> key you can make single selections and with the
<Shift> key you can select everything from the first selected file to the file
you click on. Then click OK.
This launches the file(s) so you can edit it (them).
Check the directory paths
1. From the Project menu, select Directories...
OVERVIEW
2. Check the directory paths for programs, include files and libraries. You can
add your own directories here, separated by semicolons.
Overview
3. Click OK.
How to Build the Demo Application
The next step is to compile the file(s) together with its dependent files so
you can debug the application.
Steps 1 and 2 are optional. Follow these steps if you want to specify
additional build options such as to stop the build process on errors and to
keep temporary files that are generated during a build.
1. From the Build menu, select Options...
The Build Options dialog appears.
If there are any unsaved files, EDE will ask you in a separate dialog if you
want to save them before starting the build.
139
Chapter 1
140
OVERVIEW
Overview
If you do not have any source files yet, click on the Add new file to
project button in the Project Properties dialog. Enter a new filename
and click OK.
To add existing files to a project by specifying a file pattern click on
the Scan existing files into project button in the Project Properties
dialog. Select the directory that contains the files you want to add to
your project. Enter one or more file patterns separated by semicolons.
The button next to the Pattern field contains some predefined
patterns. Next click OK.
To add existing files to a project by selecting individual files click on
the Add existing files to project button in the Project Properties
dialog. Select the directory that contains the files you want to add to
your project. Add the applicable files by doubleclicking on them or by
selecting them and pressing the Open button.
The new project is now open.
6. From the Project menu, select Load Files... to open the files you want on
your EDE desktop.
EDE automatically creates a makefile for the project. EDE updates the
makefile every time you modify your project.
141
Chapter 1
142
OVERVIEW
3. Compile, assemble, link and locate the modules using one call to the
control program cc166:
cc166 s g Ot ieee demo.c addone.src demo.ilo
o demo.abs
The s option puts the C source text as comments into the output
assembly source files.
The g option instructs the compiler to generate symbolic debugging
information. This option must always be specified when debugging with
CrossView Pro.
Overview
143
The e option removes output files after errors occur. The NOPR
assembler control suppresses list file generation. The TO control has the
same function as the o option of the other tools, and specifies the output
filename. The PR control of the locator specifies the basename of the map
file.
Chapter 1
144
No classes check
The RESERVE control reserves areas used by the several debug monitors.
The SECSIZE control increases the user stack size because the demo
program contains a recursive function. The NOCHECKCLASSES control
tells the locator not to check if all classes have a CLASSES control.
The memory regions 0200h to 0FFFh, 0FCC0h to 0FCDFh and 0FD00h to
0FD4Bh must be reserved by the locator, because this area is used by
several debug monitors. See the addendum for more details on the
execution environment.
As you can see, the tools use temporary files for intermediate results. If
you want to keep the intermediate files you can use the tmp option. The
following command makes this clear.
cc166 s g Ot ieee demo.c addone.src
demo.ilo o demo.abs v0 tmp
OVERVIEW
As you can see, if you use the tmp option, the assembly source files and
linker output file will be created in your current directory also.
Of course, you will get the same result if you invoke the tools separately
using the same calling scheme as the control program.
As you can see, the control program automatically calls each tool with the
correct options and controls.
Overview
145
This command will build demo.abs for the C16x/ST10 architecture using
the file makefile.
To see which commands are invoked by mk166 without actually
executing them, type:
mk166 n
The x option, the EXTEND control and the extended library in the
makefile are used to specify the C16x/ST10.
To remove all generated files type:
mk166 clean
OVERVIEW
146
Chapter 1
CHAPTER
SOFTWARE
INSTALLATION
INSTALLATION
CHAPTER
22
Chapter 2
Software Installation
2.1 INTRODUCTION
This chapter describes additional notes for running the CrossView Pro
debugger under the X Windows environment on UNIX.
Installation of the TASKING CrossView Pro debugger is part of the
installation of the TASKING C Compiler/Assembler toolchain, which is
described in chapter Software Installation of the C CrossCompiler Users
Manual.
23
Chapter 2
24
INSTALLATION
TOPLEVEL
CHILD
XmMainWindow
=> XmDrawingArea
XmScrolledWindow => XmDrawingArea
Dialog:
MODAL
MODELESS
XmBulletinBoard
XmBulletinBoard
Software Installation
25
Menu:
MENUBAR
PULLDOWN
XmMenuShell
XmCascadeButton
Controls:
CHECKBOX
RADIOBUTTON
TEXT
EDIT
LISTBOX
SCROLLBAR
PUSHBUTTON
LISTBUTTON
LISTEDIT
GROUPBOX
ICON
FILESELECTION
ERRORPOPUP
XmToggleButton
XmToggleButton
XmLabel
XmText
XmScrolledWindow => XmList
XmScrollBar
XmPushButton
XmText & XmArrowButton &
XmScrolledWindow => XmList
XmText & XmArrowButton &
XmScrolledWindow => XmList
XmFrame => XmLabel
XmLable with pixmap
XmFileSelectionBox
XmMessageBox
CrossView Pro repaints its windows in the default color as specified with
the Motif widget resource settings. It is possible to overrule this behavior
with a resource setting like: "*XmDrawingArea.background: blue".
CrossView Pro uses a non proportional font in all of its windows. The font
size is selected using the "Desktop Setup dialog". You can use the "font"
resource (*fontList on Motif) to select the font to be displayed in the
menubar and dialogs, it wont affect the font displayed in the CrossView
Pro windows.
The CrossView Pro stack and data windows are implemented using a
XmScrolledWindow widget on Motif.
The following list show the contents of an example appdefaults file
intended for Motif environments. Of course you may adjust the colors and
font to your preferences. Sample appdefaults files are delivered with
the product in the etc directory (app_def.mwm for Motif).
*fontList:
*foreground:
*XmMainWindow.background:
7x13bold
black
white
Chapter 2
26
*XmScrolledWindow*background:
*XmDrawingArea.background:
*XmBulletinBoard.background:
*XmToggleButton*background:
*XmLabel*background:
*XmText*background:
*XmScrollBar*background:
*XmPushButton*background:
*XmFrame*background:
*XmArrowButton*background:
*XmForm.background:
*XmMenuShell*background:
*XmCascadeButton*background:
white
white
DarkSeaGreen
gray
gray
white
gray
gray
SeaGreen
gray
SeaGreen
DarkSeaGreen
SeaGreen
INSTALLATION
7. Restart CrossView Pro and check if windows and dialogs are displayed
correctly.
8. Now you add the saved resources (one by one) back into the
.Xdefaults file and execute xrdb to install them in the server. Restart
CrossView Pro and check the influence of the new resource settings.
Adapt your saved resources when necessary.
CHAPTER
COMMAND
LANGUAGE
LANGUAGE
CHAPTER
32
Chapter 3
Command Language
3.1 INTRODUCTION
The syntax and semantics of CrossView Pros command language is
discussed here. This language is mainly used to enter textual commands in
the command edit field of the Command Window. The mouse and menus
allow you to access most actions without knowing the command language,
although the command language is more powerful. The command
language is also used when evaluating expressions and in commands
associated with assertions, breakpoints and macros. For information about
specific CrossView Pro commands, refer to Chapter 13, Command
Reference.
33
Chapter 3
34
3.3 CONSTANTS
CrossView Pro, like C, supports integer, floating point and character
constants.
Integers
Integers are numbers without decimal points. For example, CrossView Pro
will treat the following as integers:
5
23
9.27 0.23
LANGUAGE
Negative integers, if they appear as the first item on a line, must have
parentheses around the number:
(5)*4
10H
Command Language
35
For the hexadecimal digits a through f you can use either upper or lower
case. The following are all correct hexadecimal representations for decimal
43981:
0xabcd
0xABCD
0abCdH
0AbcDh
You can specify a binary constant using a trailing B or Y (or b or y). The
following are all binary representations for decimal 5:
0101b
101Y
00000101B
57L
0xffL
CrossView Pro uses the same ANSI C integral type promotion scheme as
the C compiler.
Floating Point
A floating point number requires a decimal point and at least one digit
before the decimal point. The following are valid examples of floating
point numbers:
12.34
5.6
7.89
1.234e01
Chapter 3
36
Character
Character constants are single characters or special constants that follow
the C syntax for special characters. Examples of valid character constants
include:
m
\n
LANGUAGE
Code
ASCII
Hex
Function
\b
BS
08
Backspace
\f
FF
0C
Formfeed
\n
NL (LF)
0A
Newline
\r
CR
0D
Carriage return
\t
HT
09
Horizontal tab
\\
5C
Back slash
\?
3F
Question mark
27
Single quote
\"
"
22
Double quote
\ooo
\xhhh
hexadecimal number
Command Language
3.4 VARIABLES
CrossView Pro lets you use variables in the C expressions you type. You
may reference two classes of variables: variables defined in the source
code and special variables.
Variables defined in your source code fall into two categories: local
variables and global variables.
Storage Classes
Variables may be of any C storage class. The size of each class is target
dependent. Consult the C CrossCompiler Users Manual for specific sizes.
You may cast variables from one class to another:
(long) $mychar
Local Variables
You define local variables within a function; their values are maintained on
the stack or in registers. When the program exits the function, you lose
local variable values. This means that you can only reference local
variables when their function is active on the stack.
Local variables of type static retain values between calls. Therefore, you
can reference static variables beyond their functions, but only if their
function is active on the stack.
CrossView Pro knows whether the compiler has allocated a local variable
on the stack or directly in a register and whether the register is currently
on the stack. The compiler may move some local variables into registers
when optimizing code.
If a part of your source code looks like this:
x = 5;
y = x;
and you stopped the program after the assignment to x, and set x to
another value, this may not prevent the second statement from setting y to
5 due to "constant folding" optimizations performed by the compiler.
37
Chapter 3
38
Global Variables
Global variables are defined outside every function and are not local to
any function. Global (nonstatic) variables are accessible at any point
during program execution, after the system startup code has been
executed.
Global variables can be defined static in a module. These variables can
only be accessed when a function in this module is active on the stack, or
when that file is in the Source Window using the e command.
Specifying Variables in C expressions
LANGUAGE
The following table specifies how CrossView Pro treats different variables
in C expressions. The left column is the variables syntax in the expression,
the right column is the CrossView Pro semantics.
Variable Syntax
variable
function#variable
number#variable
:variable
$variable
Command Language
39
In this case CrossView Pro will search the stack for the function main(),
then look outwards from that function for the first occurrence of initval
in scope and report its value. Note that main() must be active, that is,
program execution must have passed through main() and not yet
returned, in order for initval to have a value.
You can also use the Browse... button in the Expression Evaluation dialog
box. This dialog box appears when you click the New Expression button
in the toolbar or select Evaluate Expression... from the Data menu.
Special Variables
CrossView Pro maintains a set of variables that are separate from those
defined in your program being debugged. These special variables reside in
memory on the host computer, not on the target system. They contain the
values of the target processors registers, information about the debuggers
status, and userdefined values. Special variables are case insensitive. Use
the opt command to display and set these variables (without using the
$sign).
The following is a list of the reserved special variables for CrossView Pro:
Reserved Variable
Description
$ARG(n)
$FILE
$IN(function)
$LINE
Chapter 3
LANGUAGE
310
Reserved Variable
Description
$PROCEDURE
$ASMHEX
$AUTOSRC
$CPU
$FP
$MIXEDASM
$MORE
$PC
$PIPELINE
$register
$SP
$SYMBOLS
Command Language
311
Reserved Variable
Description
$SRCLINENRS
$SRCMERGELIMIT
For CrossView Pro, a fixed set of registers is always available. You can add
additional C166/ST10 derivative specific SFRs in a regname.def file. See
the C CrossCompiler Users Manual for more information.
You can configure which (and in which order) registers must appear in the
register window in the Register Window Setup dialog (Settings | Register
Window Setup...).
It is possible to request the address of an SFR by using the address
operator &. The operator may even be used on an SFRBIT for this
purpose. In this case, the bit offset and the SFR where it is located in, are
displayed. Example:
Chapter 3
312
&$mulip
Location of $MULIP is $PSW.5
Operand for & incorrect
&$psw
0xFF10
LANGUAGE
$name="john"
then:
$name=3*4
creates a special variable $name of type (char *). The second statement
creates a special symbol $name and assigns it the value of 12 of type int.
Special variables are just like any other variables, except you cannot
meaningfully take the address of them.
See the startup options in Chapter 4, Using CrossView Pro.
Command Language
313
Chapter 3
314
LANGUAGE
Style
Description
Print in e" floating point notation; needs NO size specifier; default size
is sizeof(double).
Print in e" floating point notation; the size specifier can be sizeof(float)
or sizeof(double); default size is sizeof(expression).
Print in f" floating point notation; needs NO size specifier; default size
is sizeof(double).
Print in f" floating point notation; the size specifier can be sizeof(float)
or sizeof(double); default size is sizeof(expression).
Print in g" floating point notation; needs NO size specifier; default size
is sizeof(double).
Command Language
Style
Description
Print in g" floating point notation; the size specifier can be sizeof(float)
or sizeof(double); default size is sizeof(expression).
Print in the natural" format, based on type; use it for printing variables
that have the same name as an CrossView Pro command.
Print the names of the file, function, and source line at the address.
315
Chapter 3
316
text
text = 0x8200
text/a
Print it as a string
text = "Sample^J"
With format codes, you may view the contents of memory addresses on
the screen. For instance, to dump the contents of an absolute memory
address range, you must think of the address being a pointer. To show
(dump) the memory contents you use the C language indirection operator
*. Example:
*0x4000/2x4
0x4000 = 0x00DB0208 0x5A055498
LANGUAGE
To view the first four elements of the array table from the demo.c
program, type:
table/4d2
table = 1
This command displays in decimal the first four 2byte values beginning at
the address of the array table.
Command Language
317
3.6 OPERATORS
Standard C Operators
CrossView Pro supports the standard C operators in the ANSI defined
order of precedence. The order of precedence determines which operators
execute first.
The semicolon character (;) separates commands on the same line. In this
way, you may type multiple commands on a single line. Comments
delimited by /* and */ are allowed; CrossView Pro simply ignores them.
Order of Precedence
(in descending order)
() [] > .
! ~ ++ + * & (type) sizeof
* // %
+
<< >>
< <= > >=
== !=
&
^
|
&&
||
?: = += = *= /= %= &= ^= |= <<= >>=
Chapter 3
318
Using Addresses
To specify an address, you may use the & operator. To determine the
address of initval, type:
&initval
If you try to use the & operator on a local variable in a register, CrossView
Pro issues an error message and tells you which register holds the variable.
this cause CrossView Pro to echo the message now in for loop, to
display the value of sum in the Command Window, and to continue when
line 60 is encountered. You can also enter this breakpoint and the
associated commands via the Breakpoints dialog box, which you can open
by selecting the Breakpoints... menu item from the Breakpoints menu.
LANGUAGE
Command Language
The period operand assumes the same size and format implied by the
specifier used to view the previous item. Thus if you look at a long as a
char, a subsequent . is considered to be one byte. Use this technique to
alter specified pieces of a larger data item, such as the second highest byte
of a long, without altering the rest of the long. The period operand may
be used in any context valid for other variables.
. is the name of a location. When you use it, it is dereferenced like any
other name. If you want the address of something that is 30 bytes farther
on in memory, do not type .+30 as this takes the contents of dot and
adds 30 to it. Type instead &.+30 which adds 30 to the address of the
period operand.
CrossView Pro compares the value of sum with 5931 when the program
stops at line 60. If sum is less than or equal to 5931, CrossView Pro
continues. Otherwise, CrossView Pro displays the value of sum with 5931
when the program stops at line 60.
You can also use the exp1 ? exp2 : exp3 C ternary operator for conditional
expressions. For example:
$myvar = (5 > 2) ? 1 : 1
319
Chapter 3
320
3.9 FUNCTIONS
In CrossView Pro expressions, you can include functions defined in the
programs code.
Command line function calls are not supported for the C166/ST10.
You can call functions through the Call a Function dialog box. Note that
only the results of the function call are shown. You cannot enter
expressions in this field. If you want to use the results of the function call
in an expression, then type the expression into the Evaluate Expression
dialog box or type in the command into the Command Window (described
in the keyboard method below).
From the Run menu, select Call a Function...
List all functions by clicking the Browse... button.
You can place parameters in the Parameters field of the Call a
Function dialog box, separated by commas, but without the usual
parentheses or select from the dropdown history list.
The Command Window receives the results of the function call.
Type in the expression containing a function call directly into the
Command Window.
To execute a function on the target type the function name and the
arguments as you would do in your C program. For example,
LANGUAGE
do_sub(2, 1)
or:
a = do_add(3,4)
CHAPTER
USING
CROSSVIEW PRO
Chapter 4
CHAPTER
42
USING
4.1 INTRODUCTION
This chapter and the following 8 chapters give you a comprehensive
picture of CrossView Pros features. In order to address the broadest range
of expertise, the contents range from introductory examples to the more
technical aspects and techniques of debugging with CrossView Pro. While
it is not necessary for you to read the chapters straight through, you may
find it especially helpful to do so. All of the examples are from the sample
program demo.c which comes with CrossView Pro. For a complete
description of the commands presented in this chapter, consult the
Command Reference chapter.
Each CrossView Pro command introduced in the text has a matching box
summarizing its syntax and semantics. The command description follows
these general rules:
Items in bold font are the actual CrossView Pro commands: save, set.
Items in italics are names for the things you should type: filename,
commands. In addition, the | symbol means or. For instance, screen |
filename means you can use the word "screen" or a filename in the syntax.
43
Chapter 4
44
USING
45
Chapter 4
46
instructs CrossView Pro to use the COM2 port at 19200 baud. Most
evaluation boards use an auto baud rate detection mechanism and support
19200 baud. See your execution environment in the addendum of this
manual for specific communication information.
When you specify a startup option in CrossView Pro, the option overrules
the corresponding value in the current xvw.ini file.
There are many different options you can invoke when starting up
CrossView Pro. The listing below gives an overview of all startup options.
USING
There are several startup options having to do with the recording and
playing back of CrossView Pro command files. See also Chapter 9,
Command Recording & Playback.
47
Startup Option
Description
a number
argcv "arg[,arg]..."
b number
c number
C cpu
Chapter 4
48
Startup Option
Description
board_seg
Board segment the interface card is using
hw_index
Index of the hardaware (slot) (0,1,...)
port_IO_add
The memory address used to access the
(E)ISA card.
interface_card_ID
Vendor specific CAN host adapter. This
number, in combination with manufacturer,
identifies a unique interface card.
port_id
PC I/O port number or I/O channel used for
accessing the (E)ISA card.
net_number
Locical net number the interface card is
using
interrupt_nr
Interrupt number the CAN interface card is
using
hw_channel
Index of the channel (connector) (0,1,...)
manufacturer
Name of the manufacturer of the CAN
interface card. Together with the
interface_card_ID, a unique interface card
is defined.
Note: The CAN ROM Monitor must be
downloaded first using one of the other
communication methods.
D parallel,port
USING
port
Startup Option
D tcp,host,port
D dev,devicefile
49
Description
Select TCP/IP communication. On UNIX the
standard TCP/IP implementation is used. On
MSWindows the WINSOCK.DLL implementation
is used.
host
port
D isa,ioport,address
easycode
f file
fss_root_dir="path"
G path
L file
n address
orti=file
p file
P file
r file
Chapter 4
USING
410
Startup Option
Description
R file
radm=file
RegServer
RegServerS
s number
sd directory [;directory]...
single_instance
tcfg file
timeout=n_seconds
T [file]
UnregServer
UnregServerS
USM
4.4.1
411
Chapter 4
412
Minimized Window
Breakpoint Toggles
Menu Bar
Dialog Box
Local Toolbar
USING
Menus
Each CrossView Pro window may have a menu associated with it. Under
Microsoft Windows, the active windows menu is displayed in the menu
bar of the desktop.
Depending on your execution environment some menu items are always
grayed out. For example, Communication Setup is grayed out if your
target is an instruction set simulator.
Windows
The debugger supports two types of windows: primary windows and
dialog boxes. Dialog boxes are the windows you access from a primary
window. For the remainder of this manual, the term window" denotes a
primary window.
This manual also uses the term popup window. A popup window is a
primary window that contains supplemental information such as online
help.
CrossView Pro Windows are used to display information and to get user
input through either buttons, commands typed in input fields, or menu
selections. Windows may be moved around the desktop, sized, or
iconized. All windows can be opened from the View menu. The section
on CrossView Pro Windows provides more detail about each window.
A window is considered opened even if it is iconized (under Microsoft
Windows, this is called minimized). A window is considered closed if it
does not exist on the desktop in any form.
Dialog Boxes
Certain menu items or push buttons may call up a dialog box to complete
an action, display information, or get additional data. No other actions can
be performed until the dialog box is closed.
413
Chapter 4
414
4.5.1
MENUS
Each window in CrossView Pro uses the menu as shown in figure 42.
The method of selection of a menu item varies depending on the
windowing system being used. See your Windowing Systems manual for
details of how to do this.
Each window has a hidden control menu (the icon on the topleft of the
window), to manipulate the window. The menu Close command in the
control menu closes the current window. Your implementation of the
windowing system may have additional features. See your documentation
for further details.
USING
4.5.2
WINDOW OPERATION
415
Chapter 4
416
Selecting a Window
At any one time, a particular window is active. Most operations act (by
default) on the active window. The active window is distinguished by
highlighting the title bar. Only one window may be active at a time. There
are several ways to select a window (that is, make a window active).
Open the window from the View menu. If the window is already
open it will be brought to the front.
Click on the windows border (or on any portion of the window in
some windowing systems). It will be brought to the front.
Select the window name from the Window menu. The window will
be made active and is brought to the front. (This option is available
under Microsoft Windows only).
Closing a Window
Windows are closed by selecting Close from the Control menu, or by
clicking a Close button, as shown in figure 44. Selecting this item from
the Command Window will exit CrossView Pro.
Control Menu
Close Button
USING
4.5.3
417
DIALOG BOXES
Radio Button
Check Box
Push Buttons
Chapter 4
418
4.5.4
USING
419
Chapter 4
420
4.5.5
USING
421
Chapter 4
422
4.6.1
COMMAND WINDOW
USING
You can switch between the history list and the command edit field by
hitting the <Tab> key. Hitting the <Esc> key (escape) returns you to an
empty edit field.
The top field is the Command Output Window or the Emulator Output
Window, depending on the type of Command Window you choose. Each
command, echoed from the command edit field, appears with a > prefix.
CrossView Pro displays its response (or the emulators response if the
window is an Emulator Command Window) to the command immediately
following the command. You can use the clear command to clear this
window.
423
Output Window
Chapter 4
424
4.6.2
SOURCE WINDOW
The Source Window offers most of the debugging functions you will need
on a regular basis. It allows you to:
Breakpoint Coverage
Toggles
Markers
Profiling
Current
Execution Position
Status
Bar
USING
425
Chapter 4
426
USING
The xvwedit program is a shell script. You can adapt it to your specific
requirements.
4.6.3
REGISTER WINDOW
Figure 48 shows the Register Window. This window allows you to view
and edit register contents.
427
Chapter 4
428
4.6.4
MEMORY WINDOW
The Memory Window is shown in figure 49. This window allows you to
view and edit the target memory.
Depending on the setting of the Automatically refresh check box in the
Memory Window Setup dialog, CrossView Pro updates the displayed
values every time the program is stopped or only updates the values by
user request. For example, by pressing the Update Memory Window
button located on the toolbar.
USING
To edit the target memory, click on a memory cell and type a new value.
To display another memory region: click on an address cell and type a
new address. CrossView Pro accepts input in symbolic format, so you can
enter expressions instead of just values.
CrossView Pro supports multiple instances of the Memory Window. If your
target supports multiple memory spaces, the Memory Window supports
them all. Refer to the section about memory space keywords to become
familiar with the memory space keywords and associated syntax your
target system uses.
You can specify the way data appears in the Memory Window by opening
the Memory Window Setup dialog. From the Settings menu, select
Memory Window Setup... to open this dialog. The memory contents can
appear in many formats including ASCII character, hexadecimal, decimal,
signed, unsigned, and floating point formats. You can specify the size of
the memory window. You specify the number of memory cells that
appear within the window. The number of cells is fixed in the sense that if
you resize the window the number of cells does not change.
Besides the current value of memory locations, the Memory Window also
displays whether memory locations have been accessed during program
execution. This is called data coverage. An application program may read
from, write to, or fetch an instruction from a memory location. Of course
all combinations may be legal. Although writing data to a memory location
from which an instruction has been fetched is suspicious. All types of
accesss, read, write, fetch or combinations of these, can be shown using
different foreground and background colors. The color combination used
to show "rwx" access are specified in the Desktop Setup dialog. Change
the background color if instructions are fetched from a memory location,
and change the foreground color to show read and write access.
You can display data coverage information in the Memory Window by
clicking on the Coverage button in the Memory Window or by setting the
Display data/code coverage check box in the Memory Window Setup
dialog.
The Memory Window has the ability to highlight memory cells of which
the contents have been changed. Click on the Highlight Value Changes
button in the Memory Window to see the changed cells. With the Freeze
Highlight Reference Values button you can enter a new reference point
for highlighting. All the cells that have been changed since that reference
point are highlighted.
The Memory Window provides a local Toolbar containing the following
buttons:
Fill memory
Fill single memory address
Copy memory
Find memory
429
Chapter 4
430
4.6.5
DATA WINDOW
The Data Window is shown in figure 410. This window allows you to
show the value of monitored expressions and variables.
The Data Window updates the values shown every time the program
stops, and after an o command.
USING
431
Chapter 4
432
USING
To see the value of the local variables of a function, Select Data | Watch
Locals Window from the View menu.
CrossView Pro supports multiple Data Windows. Data Windows either
have the title "Data Window #n" or "All Local Variables". The "All Local
Variables" title indicates the autowatch window if it exists (as explained
above).
4.6.6
STACK WINDOW
The stack records the return addresses of all functions the application has
called, and CrossView Pro can use this information to reconstruct the path
to the current execution position. The Stack Window, shown in figure
411, displays the function calls on the stack with the values of the
parameters passed to them in an easily accessible and understandable
form.
The Stack Window can help you assess program execution and allows you
to view parameter values. The stack window allows you to:
View the stack trace which includes information about function
names, parameter values, source line numbers and stack level.
Easily switch to the call statement of a stack level by clicking on it
once.
Set temporary and permanent breakpoints at any level of the stack,
by doubleclicking on the desired level.
433
Chapter 4
434
4.6.7
TRACE WINDOW
USING
4.6.8
TERMINAL WINDOW
The Terminal Windows, shown in figure 413, let you observe and test the
input and output of your program.
The CrossView Pro Terminal windows provide an interface to exchange
data with the application on the target. This I/O facility can be
implemented in various ways. Using standard I/O stream function calls like
printf() in your source, you can test I/O to and from the target system or
simulator.
The File System Simulation feature redirects I/O to a Terminal Window if
the filename FSS_window:window_name is used in the "open" call,
window_name is the name of a Terminal Window.
A terminal window can be connected to multiple I/O streams of various
types. For example, streams 0, 1 and 2 can be mapped to one terminal
window. An I/O stream, however, can be mapped to one terminal window
only. Each terminal window must have a unique name.
435
Chapter 4
436
You can specify the characteristics of the Terminal Window by opening the
Terminal Window Setup dialog. From the Settings menu, select Terminal
Window Setup... to open this dialog, or click with the right mouse button
in the Terminal Window to bring up a popup menu and select Setup....
You can specify the input and output format of the terminal window. The
input format can be a VT100like terminal. The output format can be a
VT100 terminal, display control codes, decimal, octal or hexadecimal. You
can map linefeeds to carriagereturn linefeeds, wrap at the end of a line,
specify buffered input or specify that the window must be cleared at
system reset and program reset. You can also log the input and output
data to a file.
The default size of a terminal window is 24 lines of 80 characters.
Everything that scrolls outside this window is lost. The visual window size
can be smaller (scrollbars are shown). You can specify another size in the
Terminal Window Setup dialog.
Each terminal window has a local popup menu, which you can activate by
clicking the right mouse button.
USING
Reset clears the contents of the terminal window and it also clears all
attributes set with escape sequences. A Clear just clears the contents of a
terminal window. Reverse changes the foreground and background colors
and Local echo enables echoing back of typed characters in a terminal
window. Setup... opens the Terminal Window Setup dialog.
You can connect an I/O stream to a terminal window in the Connections
tab of the Settings | I/O Simulation Setup... dialog box.
4.6.9
437
Chapter 4
438
USING
4.7.1
ECHOING COMMANDS
4.7.2
MOUSE/MENU/COMMAND EQUIVALENTS
439
Chapter 4
440
4.8.1
4.8.2
USING
You enter help at a topic that explains the current window or dialog. By
clicking on links, you can follow different paths. To return to your starting
point click the Back button or open the Options | Display History
Window and click on the node that you want to return to.
The Contents tab displays a list of main subjects. The Index tab displays
a list of keywords that relate to certain topics. When you click the Find
tab, you can search for a string pattern.
To save time, you can iconize the Help Window and maximize it when
necessary.
CHAPTER
CONTROLLING
PROGRAM
EXECUTION
CHAPTER
PROGRAM EXECUTION
52
Chapter 5
53
Chapter 5
54
5.1.1
PROGRAM EXECUTION
Use the vertical scroll bar to move a line or a page at a time. The
view point stays on the same line until it is no longer visible. It
then stays on the first or last line of the display, depending on the
direction of scrolling.
Click on the desired, unmarked source line.
From the Edit menu, select Find Line... to specify to which
particular line you wish to move.
In the upperleft corner of the Source Window, there are two text fields.
These fields show the line number of the current viewing position and the
address of the first machine instruction for that line. CrossView Pro
updates the Line and Address values each time the viewing position
changes.
You can change the viewing position to the first executable line of a
particular function with the e command. For instance:
e main
will make the first executable line of main() the current viewing position
and display it in the Source window. You may also use the stack depth as
an argument, if you place it before the e:
1 e
This will change the viewing position to stack depth 1, that is, the line that
called the current function.
FUNCTION:
COMMAND:
stack e
e function
To change the viewing position to a specified address, you can use the ei
command. This command is useful for viewing some code in the assembly
window, without changing the program counter, since the execution
position is not changed.
FUNCTION:
COMMAND:
address ei
5.1.2
55
Chapter 5
56
COMMAND:
g line_number
You can also change the execution position to a specified address directly,
although the same warnings apply. To do so, use the gi command. For
instance:
PROGRAM EXECUTION
0x800 gi
FUNCTION:
COMMAND:
address gi
sum = sum + 1;
COMMAND:
line_number P
FUNCTION:
COMMAND:
57
Chapter 5
58
5.2.1
PROGRAM EXECUTION
or:
From the Run menu, select Reset Application
From the Run menu, select Run, or click on the Run/Continue
button.
Type the R command from the Command Window.
This is NOT a target system reset. Refer to the rst command for
information about side effects that may be introduced due to a target
system reset.
After restarting a program, you can stop execution only by a breakpoint,
an assertion or a halt operation from the user.
FUNCTION:
COMMAND:
5.2.2
COMMAND:
5.2.3
SINGLESTEP EXECUTION
When the program stops, you can continue execution, or you can step
through it one line or instruction at a time. This is called singlestep
execution.
59
Chapter 5
510
PROGRAM EXECUTION
Click on the Step Into button in the Source Window or select Step Into
from the Run menu.
Press function key F8 or type the s command in the Command Window.
You have the option of setting the number of lines you want to execute.
For example, to execute 2 lines of the program, type: 2 s.
FUNCTION:
COMMAND:
number s
511
By performing one Step Into action, you can step into the source code for
factorial() . Your Execution and viewing position change to:
factorial#103:
char locvar = x;
CrossView Pro shows you the current function and line number and the C
source code for the current execution position.
Source SingleStep Over
To step over a statement or a function call:
Click on the Step Over button in the Source Window or select the Step
Over from the Run menu.
Press function key F10 or enter the S command in the Command Window.
You have the option of setting the number of lines you want the debugger
to execute. For example, to execute three lines of source, single stepping
over functions, enter: 3 S.
FUNCTION:
COMMAND:
number S
Chapter 5
512
If you try to step over a function that contains a breakpoint or that calls
another function with a breakpoint, CrossView Pro halts at that breakpoint.
Once execution stops, the step over command is complete. Therefore, if
you resume execution by clicking on the Run button or with the C
command, you do not regain control at the entrance to the function with
the breakpoint. You can either single step through the rest of the function,
or select the Run | Return from Function menu item to return to the
line after the point of entry.
5.2.4
PROGRAM EXECUTION
While single stepping through code at the source level is informative, you
might need a lower level approach. CrossView Pro can step through a
program at the assembly language instruction level.
While more timeconsuming than a source level stepthrough, an
instruction level stepthrough allows you to examine how your code has
been compiled. As you advance through the assembly instructions, notice
how CrossView Pro translates data addresses to variable names, and
correlates branch addresses to points in the source code. This makes it
much easier to follow the source at the instruction level.
The default step modes are:
Source lines Window:
Source line step
Disassembly Window:
Instruction step
Source and Disassembly Window:
mode of previous window!
(assumes the step mode of the previous Source Window setting)
Mouse and menu actions:
The Step Into and Step Over buttons, and Run | Step Over and
Run | Step Into menus can be set to step by instructions by
selecting Run | Step Mode | Instruction step from the menu bar.
To change back to stepping by source lines, select Run | Step
Mode | Source line step.
Another way to set the step mode is to select the Source line step
or Instruction step radio button in the Settings | Source
Window Setup dialog box.
513
To control this function from the Command Window, use the Si and si
commands. The Si and the si commands are analogous to the S and s
commands, Si will treat function calls (more precisely, jump to subroutine
instructions) as single statements, while si will enter the function.
FUNCTION:
COMMAND:
number si
FUNCTION:
COMMAND:
number Si
disassembled instruction
Chapter 5
514
PROGRAM EXECUTION
CrossView Pro can search for addresses and functions in the entire
application and for line numbers, and strings in the current source file. A
string search starts from the current viewing position and "wraps around"
the end (or begin) of the current source file. The string search ends when
a matching string is found or when it returns to the starting point.
5.4.1
CrossView Pro searches through all the relevant source code files to find
the one containing the body of the function. The part of the file containing
the function appears in the Source Window.
5.4.2
CrossView Pro allows you to search for a particular string in the current
source file. CrossView Pro searches the Source Window from the current
viewing position. If it finds the string, it moves the viewing position to the
corresponding line. This does not affect the execution position.
To find a string:
Open the Search String dialog box by clicking on the Find Text String
button, or select Search String... from the Edit menu. Click on the Case
Sensitive check box to turn case sensitivity on or off.
You can also highlight a text fragment in the source code and click on the
Find Next Text String button to find that fragment again.
In the Command Window, use the / or ? commands. The / command
searches forwards and the ? command searches backwards. For example,
to find the string initval, enter:
/initval
CrossView Pros searches "wrap around" beyond the top or bottom of the
file if necessary.
FUNCTION:
COMMAND:
/ string
FUNCTION:
COMMAND:
? string
515
Chapter 5
516
5.4.3
PROGRAM EXECUTION
CHAPTER
ACCESSING CODE
AND DATA
CHAPTER
62
Chapter 6
6.1 INTRODUCTION
This chapter discusses topics related to viewing and editing the variables
in your source program and execution environment, including accessing
variables and registers, viewing and modifying the data space, using
monitors, viewing the source file, and disassembling code.
63
Chapter 6
64
FUNCTION:
COMMAND:
variables_name
For variables having the same name as an CrossView Pro command, use
/n as format style code.
Any expression that can be typed into the Command Window can also be
typed in the Expression field of the Expression Evaluation dialog box.
Throughout this discussion, expressions can be typed in either location,
depending on what is convenient.
Viewing Structures
You can also view structures.
By using any of the methods described above, you can print out the entire
structure. For example:
recordvar
and CrossView Pro prints out the structure of recordvar and values of
recordvars fields in correct C notation:
recordvar = struct rec_s {
a = 1;
b = 0x1028 "TASKING";
c = 987654321;
color = blue;
} recordvar
Note that CrossView Pro returns the value in the form field_name = value.
CrossView Pro also displays enumerated types correctly.
Variables will not have meaningful values when you first start CrossView
Pro, since your programs startup code has not been executed.
65
Chapter 6
66
table
table = 0x200
Note that CrossView Pro returns the address in the form array_name =
address.
The debugger can also display the address and value of an individual
element of an array. Enter the name of the array and the number of the
element in brackets. For instance, to find the address and value of the
third element of array table, enter:
table[3]
0x20C = 0
Command
Output
Note that CrossView Pro returns the information in the form address =
value.
Displaying Character Pointers and Character Arrays
The following piece of C code can be accessed in CrossView Pro using the
string format codes:
char text[] = "Sample\n";
char *ptext = text;
text
text = 0x8200
text/a
text = "Sample^J"
Print it as a string
ptext
string = 0x8200
ptext/s
Print it as a string
string = "Sample^J"
&ptext
0x8210
Sizing Structures
With structured variables, it is especially useful to know the size of a
variable.
In the Command Window, you can determine the size of a variable with
the sizeof() function. For instance, to determine the size of the structure
recordvar, enter:
sizeof(recordvar)
24
6.2.2
CHANGING VARIABLES
With CrossView Pro, you can not only view your variables, but change
them. This function allows you to easily test your code by singlestepping
through the program and assigning sample values to your variables. For
instance, to set the variable initval to 100, enter:
initval=100
Note that CrossView Pro returns the values of variables with the syntax:
var_name = value, with any righthand side expression evaluated to a
single value.
Changing variables in the Data Window
To change a variable in the Data Window, follow these steps:
In the Data Window, doubleclick on the variable you wish to edit.
Insitu editing will be activated.
Specify the new value in the edit control and hit the Enter key.
When insitu editing is active, you can use the Tab key to move the edit
field to the next variable value or use the Shift+Tab key combination to
move the edit control to the previous variable.
67
Chapter 6
68
Assigning Structures
CrossView Pro also allows you to assign whole structures to one another.
You can use a simple equation to assign the structures. For instance, to
assign statrec to recordvar, enter:
statrec = recordvar
Assigning Pointers
Assigning to and evaluation of pointers requires some extra attention.
When requesting a pointer variable, its near, far or huge attribute is
taken into account and the variable is evaluated accordingly. For example,
bits 1415 in a near pointer indicate which DPP register contains the data
page value:
pn/t
global short near *pn
pn
pn = 0x4106
pn/1x2
pn = 0x106
$dpp0
$DPP0 = 0x1
$dpp0=10
$DPP0 = 0xA
pn
pn = 0x28106
As you can see, using a display format allows you to see how the pointer
is actually stored in memory. When the value of the indexed DPP is
changed to 10, pointer pn evaluates to to an address in data page 10.
When assigning to pointers, you do not have to bother with the memory
storage representation. You can specify the address the pointer should
evaluate to when assigning a new value:
pf/t
global short far *pf
pf=0x123456
pf = 0x123456
pf/2x2
pf = 0x3456 0x0048
69
Chapter 6
610
6.2.3
THE l COMMAND
assertions
b breakpoints
d directory
p procedures (functions)
registers
special variables
files (modules)
g globals
The l f command (list files) also shows the address where CrossView Pro
placed the first procedure in the module. If the module is a data module
then the address reflects the first items placement.
With all of these l commands you can specify a string:
l g record
and CrossView Pro searches the globals for a match with the same initial
characters; in this case global variables that begin with record.
6.3 EXPRESSIONS
6.3.1
EVALUATING EXPRESSIONS
611
Chapter 6
612
6.3.2
MONITORING EXPRESSIONS
613
through it, and the display updates continually. Even if you are not in
window mode, CrossView Pro still displays the value of initval after
every CrossView command.
FUNCTION:
COMMAND:
m expression
Similarly, if you want twice the value of initval you could type:
m initval*2
Chapter 6
614
To remove initval from your Data Window #1, type the number of the
expression (first item of the Data Window has number 0) and m d
(monitor delete):
0 m d
and CrossView Pro removes initval (in this case, assuming it is the first
variable listed in the window) from the Data Window.
FUNCTION:
COMMAND:
number m d
Since local variables have no meaning beyond their range, CrossView Pro
issues error messages if you try to evaluate local variables beyond their
scope. Some variables also become invisible when the program call
another function. For instance, if you are in main(), monitoring sum, and
main() calls factorial() , the unqualified name sum is no longer
visible inside factorial(). You can get around this problem, however,
by monitoring main#sum instead.
6.3.3
FORMATTING DATA
Dont worry about trying to memorize the list, you probably wont have
occasion to use all these formats. Notice, however, that the /t format code
give information about a particular value. For instance, if you wanted to
find out what the type of initval is, type:
initval/t
global long initval
Please note that the displayed type may not seem to be the same type as
you declared in your source file:
The c166 compiler supports keywords bitword, sfr and sfrbit.
These keywords indicate special cases of the basic types
unsigned int and bit respectively. For the debugger, these
special cases are not distinct. When requesting the type of variable
declared with one of the above keywords, CrossView Pro will show
the basic type.
The near, far and huge keywords are essential attributes to
pointers. The chosen memory model designates the default pointer
attribute. When the type of a pointer variable is requested in
CrossView Pro, the attribute is shown explicitly, because CrossView
Pro does not know about memory models.
You can also take more lowlevel actions, such as finding out which
function contains the hexadecimal address 0x100.
0x100/P
main
CrossView Pro tells you that address 0x100 is in the function main().
6.3.4
DISPLAYING MEMORY
615
Chapter 6
616
Count is the number of times to apply the format style style. Size indicates
the number of bytes to be formatted. Both count and size must be
numbers, although you may use c (char), s (short), i (int), and l (long) as
shorthand for size. Legal integer format sizes are 1, 2, and 4; legal float
format sizes are 4 and 8.
For instance:
initval/4xs
To view the first four elements of the array table from the demo.c
program, type:
table/4d2
table = 1
This command displays in decimal the first four 2byte values beginning at
the address of the array table.
By typing the a space followed by a carriage return you can advance and
see the succeeding values in the same format:
[Enter]
0x11 = 24
120
720
5040
You may recognize that the array table contains the factorials for the
integers 0 through 7.
617
displays the values for the eight elements in the first row of myarr. Typing
the carriage return repeatedly then display subsequent rows in the same
format.
To scroll back in memory, type the ^ (caret) sign:
^
0x9 = 1
FUNCTION:
COMMAND:
6.3.5
The f command lets you specify in which notation CrossView Pro displays
memory addresses. It takes the same arguments as the printf() function
in C.
FUNCTION:
COMMAND:
f ["printfstyleformat"]
For instance, if you wish to display all memory addresses in octal, type:
f "%o"
Chapter 6
618
Note that CrossView Pro keeps track of variable and function names for
you in the disassembled code. You can also disassemble from the current
execution position by using the program counter:
$pc/5i
6.4.1
619
Chapter 6
620
double precision
return value
conventional
parameters
pushed register
parameters
pushed register
automatics
framesize
conventional
automatics
stacksize
temporary
storage
stack pointer
adjust
R0
6.5.1
c166 maintains two types of stack: the system stack and the user stack.
The system stack is used for return addresses (CALL/RET instructions) and
can be accessed via PUSH/POP instructions (using the SP register).
Because the system stack can be very small (internal memory for the
C166/ST10), c166 tries to avoid it as much as possible. Code generator
temporaries are pushed on the user stack. Via the Ou option it is even
possible to let a task switch (interrupt) use the user stack instead of the
system stack. You must specify the size of the system stack size in the
system startup code (SYSCON register), which is the system stack size for
all tasks (the whole application). For the behavior of the C166S v2.0 and
Super10 architectures please refer to their respective users manuals.
The user stack is the so called Cstack. c166 uses R0 as User Stack
Pointer and the [R0]/[R0+] addressing modes perform push/pop
sequences. If data paging is used (medium and large memory model), the
user stack is limited to 16K (one page). In these models, c166 uses DPP1
as userstack page number. The locator combines the user stack areas of
each task to one global user stack area (with cumulated size). A context
switch inherits the user stack pointer (R0) value in the new registerbank
and DPP1 remains unchanged.
6.5.2
The Stack Window shows the current contents of the stack after the
program has been stopped. This window helps you assess program
execution and allows you to view program values. You can also set
breakpoints for different stack levels from this window, as described in the
chapter Breakpoints and Assertions.
The Stack Window displays the following information for each stack level:
The name of the function that was called
All parameters specified to the function
The line number in the source code from which the function was
called
Each stack level shown in the Stack Window is displayed with its level
number first. The levels are numbered sequentially from zero. That is, the
lowest/last pushed level in the function call graph is always assigned zero.
621
Chapter 6
622
When you first see stack information, the lowest level appears against a
darker background than the other lines in the window. The marked line in
the Stack Window is the selected stack level, meaning that this line is
selected for window operations. You can change the selected stack level
by clicking on a different line.
Checking the Stack from the Command Window
The stack information is also accessible from the Command Window with
the t and T commands. The t command reconstructs the programs calling
path. For instance, if you stepped into the function factorial() and
issue a t (trace) command:
t
The numbers to the left indicate the depth of each function on the stack.
The function at the zero stack level is your current function. CrossView
Pro tells you the line number where the function was called
([demo.c:line_nr]) and the value of the argument passed
(num=value). With this information it is fairly easy to reconstruct your
calling path, and see what parameter values your functions have received.
FUNCTION:
COMMAND:
623
FUNCTION:
COMMAND:
You can accomplish the same task by specifying the stack depth instead of
a function name:
l 0
6.5.4
You can directly view the contents of the user stack. Although CrossView
Pro provides several high level methods of tracing functions on the user
stack, you can view its contents directly with the frame pointer special
variable, $fp (which equals R0). For instance, the command:
$fp[0]/4x1
624
Chapter 6
625
6.6.1
FUNCTION:
COMMAND:
number ct
Chapter 6
626
COMMAND:
number ct i
You can view a raw trace with the ct r command. For example:
20 ct r
COMMAND:
number ct r
stack pointer
program counter
current frame pointer
for all targets. For more information, refer to the Command Language
chapter.
6.7.1
You can configure which register set definition with which (and in which
order) registers must be displayed in the Register Window; using the
Settings | Register Window Setup... dialog. Since you can have more
than one Register Window, the last active Register Window will be
configured when you select this menu item.
627
Chapter 6
628
6.7.2
EDITING REGISTERS
CrossView Pro lets you change the contents of registers in a simple and
direct manner.
Follow these steps:
In the Register Window, click on the register value you wish to edit.
Insitu editing will be activated.
Specify the new value in the edit control and hit the Enter key.
If the edited value is not acceptable, the debugger will emit an error
message and reset the old value.
629
Chapter 6
630
When insitu editing is active, you can use the Tab key to move the edit
field to the next register value or use the Shift+Tab key combination to
move the edit control to the previous register. Use the Esc key to cancel
insitu editing. When a register is not in view the contents of the Register
Window will be updated automatically.
You can enter any expression in the Registers Window.
Registers which can be edited symbolically have a special marker just
before the register name. You can click on this marker to activate the
Assign Register Symbolically dialog.
To access registers from the Command Window, use the $ designation and
the register name in the format:
$register = value
CHAPTER
BREAKPOINTS AND
ASSERTIONS
CHAPTER
Chapter 7
7.1.1
CODE BREAKPOINTS
A code breakpoint is set on a line in the code and makes the program
halt exactly before that line executes. When you define a code breakpoint,
you can include four elements:
A count, which is the number of times the breakpoint must be
encountered before it stops the program (default is 1).
A reset count, which is the value assigned to the count after the
program has stopped on a breakpoint (default is 1).
A name, which is the symbolic name you can associate with a
breakpoint.
A list of commands, which will be executed when the program hits
the breakpoint.
73
Chapter 7
74
Breakpoint Coverage
Toggles
Markers
Profiling
Current
Execution Position
Status
Bar
Suppose you want to halt execution after the assignment to a and before
the one to b. A normal code breakpoint does not work here, because
execution stops at the first instruction of the source line. CrossView Pro
provides you with the capability of disassembling the code and inserting
breakpoints at the machine level. You can use the Assembly Source
Window or the Intermixed Source Window to spot the right location.
For more information on machine level breakpoints, see below.
Setting Breakpoints for Multiline Statements
Code breakpoints have a special behavior for multipleline statements,
such as a multipleline if. In an if clause, a line symbol is generated at
the beginning of the list of conditions, and the other lines of the
conditions are generally associated with the first line of the clause. In an
ifthenelse construct, the } character before the else is associated
with the brancharound to the end of the statement.
Consider the following example:
22: if ((a == b)&&
23: (c == d)) {
24: x = 2;
25: } else {
26: y = 3;
27: }
75
Chapter 7
76
If you try to set a code breakpoint at line 23, CrossView Pro sets the
breakpoint on the preceding statement. If you try to set a breakpoint on
line 22, CrossView Pro highlights line 23. If you set a breakpoint on line
25, it hits after the assignment to x, but before the jump to line 27. Notice
that it is not hit unless the if clause is true. In other words, a breakpoint
on line 25 is really a break on the }, not on the else {. The same
behavior applies when the else { statement is on the next source line.
Breakpoints and For Loops and While Loops
The code generated for a C for statement has three parts: the
initialization; the body of the loop; and the increment, test, and branch.
The initialization part and the increment, test, and branch are different
parts of code, but are both associated with the for statement itself. For
example consider:
99: for (i = 0; i < 9; i++) {
100: myfunction(i);
101: }
7.1.2
DATA BREAKPOINTS
77
Chapter 7
78
7.1.3
COMMAND:
CrossView Pro decrements the count each time the breakpoint is hit.
When the breakpoints count reaches 0, CrossView Pro halts the program.
Using
Using
Using
Using
the
the
the
the
When you set a new breakpoint using the mouse, without using the
Breakpoint dialog box, the type is always permanent, the count 1 and the
location corresponds to the current viewing position, if the Source
Window is open. These variables are described in more detail below.
Setting Breakpoints from the Menu
To set a breakpoint from the menu, select Breakpoints... from the
Breakpoints menu to view the Breakpoints dialog box. From this dialog
box, you can define several types of breakpoints.
To set a code break point at line number # of the C source, click the
Add > button and select Code Breakpoint.... Click the Break At...
button, choose a C module (for example demo.c) and click the OK
button. Now you can enter a line number to set the breakpoint at.
Click the Advanced button to get access to various types of breakpoints
and to additional breakpoint options.
79
Chapter 7
710
or
51 b
If you do not specify a line number, a breakpoint will be set at the current
viewing position.
FUNCTION:
COMMAND:
FUNCTION:
COMMAND:
[line_number] b [commands]
To set a data breakpoint, you must specify the break data command,
followed by an address, followed by any commands you want to attach to
the breakpoint. There are three types of data breakpoints:
A data read breakpoint to see if a variable is read from (break data
address, access_type=r command)
A data write breakpoint to watch if a variable is written to (break
data address, access_type=w command)
A data read or write breakpoint to check if a variable is either read
from or written to (break data address, access_type=rw
command)
For example, to set a data breakpoint to watch the lowest byte in memory
of the global variable initval, enter:
break data &initval, access_type=w
This command instructs CrossView Pro to set a data breakpoint that will
halt execution if the program writes to the lowest byte in memory of the
variable initval. Note that you have to specify the variables address,
otherwise the variables value is used.
FUNCTION:
COMMAND:
711
Chapter 7
712
Select one of the Type options: break on read, write, read or write.
Specify a length or an end address. The end address is part of the
range (length is calculated from the end address and vice versa).
FUNCTION:
COMMAND:
7.2.2
TEMPORARY BREAKPOINTS
Enable the Remove when hit check box in the Behavior field.
Click on the Continue button in the Source Window when the
program halts. This removes the temporary breakpoint at the
viewing position and the program continues.
Alternatively, scroll to the line that you want to stop at and click
once (to establish a viewing position). From the Run menu, select
Run to Cursor to continue execution until you reach this
temporary breakpoint.
From the Command Window:
Type break code address, temporary=true to set a temporary
code breakpoint.
Type the C command followed by a line number, to set a temporary
breakpoint at a line number.
For example,
C 51
COMMAND:
7.2.3
BREAKPOINT NAMES
You can associate a symbolic name with a breakpoint. You can then use
this name with the following commands: break set and break delete.
Breakpoint names must be unique and cannot be a number or the word
"all". Allowed characters are az, AZ, 09 and _.
To assign a name to a breakpoint:
Follow these steps:
From the Breakpoints menu, select Breakpoints... to open the
Breakpoints dialog box.
Select a breakpoint to edit and click on the Edit... button.
713
Chapter 7
714
7.2.4
CrossView Pro allows you to set a breakpoints count. The count defines
how many times you encounter the breakpoint before it halts the program.
For example, a breakpoint with a count of 3 means the program stops on
the third hit. Each time the breakpoint is hit, CrossView Pro decrements
the count. When the count reaches 0, CrossView Pro halts the program,
and resets the count to the value of the reset count. The default reset
count is 1.
To set a breakpoints count,
Follow these steps:
From the Breakpoints menu, select Breakpoints... to open the
Breakpoints dialog box.
When you add or edit a breakpoint, click on the Advanced button.
Enter a breakpoints count in the Breakpoint count field.
Enter a reset count in the Reset count field.
From the Command Window,
Use the count= argument with the break command to set both the
current count and the reset count.
Use the curr_count= and/or reset_count= arguments with the
break command to set the current count and the reset count
separately.
For example, suppose you have a breakpoint set at address 0x59 of your
source code. The first time the program halts at address 0x59, enter:
break code 0x59, curr_count=3, reset_count=4
This command sets the breakpoints count to 3 and the reset count to 4.
You can observe a breakpoints current count and reset count when you
list the breakpoints in the Command Window with the l b command.
FUNCTION:
COMMAND:
FUNCTION:
COMMAND:
7.2.5
SEQUENCE BREAKPOINTS
715
Chapter 7
716
In this example, the sequence breakpoint hits when probe point 0 is hit
first, then 1 and 3 are hit in any order, and finally probe point 2 is hit.
FUNCTION:
COMMAND:
FUNCTION:
Delete a breakpoint.
COMMAND:
FUNCTION:
COMMAND:
717
Chapter 7
718
On Windows:
In the list of breakpoints toggle the check box in front of the
breakpoint to enable or disable the breakpoint.
On UNIX:
FUNCTION:
Disable a breakpoint.
COMMAND:
FUNCTION:
Enable a breakpoint.
COMMAND:
719
Chapter 7
720
CrossView Pro does not check the syntax of attached commands until the
breakpoint is hit.
Data breakpoints accept command lists the same way as code breakpoints.
For instance, to set a data breakpoint that monitors the lowest byte in
memory of the value of initval, enter:
break data &initval, access_type=w, commands={initval; C}
Every time the program writes to the lowest byte in memory of the
variable initval, this breakpoint halts the program, prints the value of
initval and continues execution.
For more information on the use of attached commands, see the Patches
and Diagnostic Output and Statistical Information sections later in this
chapter.
7.5.1
stops the program at line 63, checks to make sure the variable initval is
17, and resumes execution if it is. If initvals value does not equal 17,
CrossView Pro prints the value, and the program remains halted.
7.5.2
If the value does not equal 17, the macro prints the value and halts the
program. Otherwise, execution continues.
You can include this macro at any point by attaching it to a breakpoint.
Entering:
721
Chapter 7
722
this is a very efficient way to insert the macro with breakpoints at lines 51
and 63.
7.5.3
Whenever the breakpoint on line 49 is hit, CrossView Pro prints the string
and continues execution.
stops the program on line 51, but does not print a message stating where
the break occurred.
723
Function
Type
bU
temporary
bu
permanent
bB
temporary
bb
permanent
Chapter 7
724
bU
This command breaks when you return to the top level of the call graph.
FUNCTION:
COMMAND:
[stack] bU [commands]
FUNCTION:
COMMAND:
[stack] bu [commands]
FUNCTION:
COMMAND:
[stack] bB [commands]
FUNCTION:
COMMAND:
[stack] bb [commands]
7.8 PATCHES
A patch is a means of using CrossView Pro to change the execution of
your program without recompiling. Patches involve manipulating
breakpoints to skip code, include code, or replace existing code with new
code.
Basically, a patch is a breakpoint with certain associated commands that
enable you to alter program execution. This capability is a useful
debugging tool.
You can associate the commands used to patch code with a breakpoint
through either the Command Window or through the Commands edit box
in the Breakpoint dialog box. The examples below set breakpoints using
CrossView Pro commands typed in the Command Window. You can also
set breakpoints in the Breakpoints | Breakpoints... dialog. In this case
the commands between the brackets are entered into the Command edit
area.
7.8.1
To patch code out of a program, you can set a breakpoint that changes the
execution position. For instance, suppose you want to patch an infinite
loop out of your source.
78:
79:
80:
81:
82:
83:
while (loopvar)
{
sum = sum + 1;
}
sum = sum + 5;
On line 78, place a breakpoint that jumps to line 83, effectively bypassing
the loop. In the Command Window, enter:
78 b {g 83; C}
725
Chapter 7
726
This creates a breakpoint on line 78 that does nothing more than move the
execution position beyond the loop and issue a C command. Remember
that the breakpoint on line 78 is hit before the C statement on that line
executes.
7.8.2
You can also patch code into a program by just including the code in the
breakpoint command. For example, suppose you want to add an equation
with the variable loopvar.
78:
79:
80:
81:
82:
83:
while (loopvar)
{
sum = sum + 1;
}
sum = sum + 5;
This command halts execution at line 78, adds the statement loopvar=0
to the program, and continues execution.
7.8.3
Finally, you can combine the two techniques described above to replace
code in a program. For instance, suppose you want to replace an infinite
loop with new code.
78:
79:
80:
81:
82:
83:
while (loopvar)
{
sum = sum + 1;
}
sum = sum + 5;
The breakpoint halts the program, prints the value of loopvar, and
resumes execution. The Q command suppresses the listing of where the
break occurred. This breakpoint does not affect the source code and no
recompilation is necessary.
Using special variables, you can also keep statistics about your program,
such as how many times a line of code executes or how many times a
variable is accessed.
For example, suppose you want to know how many times line 60
executes. You must define a special variable to keep track of your
statistical data, and set a breakpoint to accumulate the data for you.
First, define the special variable. In the Command Window, enter:
$test = 0
This command defines the special variable $test and sets it to zero. For
convenience, you can also set a breakpoint at the beginning of the
program that initializes $test.
Secondly, set a breakpoint at line 60 that increments $test and continues
execution every time the program hits line 60:
60 b {$test++ ; C}
727
Chapter 7
728
7.10 ASSERTIONS
The Global Active state activates all assertions. Globally activating the
assertion mode, however, does not change how each assertion is marked.
FUNCTION:
COMMAND:
Aa
FUNCTION:
COMMAND:
As
FUNCTION:
COMMAND:
729
Chapter 7
730
Create an assertion.
COMMAND:
a commands
731
Chapter 7
732
To activate an assertion:
Enter assertion_number a a command. For example:
activates assertion 2
2 a a
To suspend an assertion:
Enter the assertion_number a s command. For example:
suspends assertion 2
2 a s
FUNCTION:
Activate an assertion.
COMMAND:
assertion_number a a
FUNCTION:
Suspend an assertion.
COMMAND:
assertion_number a s
Deletes assertion 2.
FUNCTION:
Delete an assertion.
COMMAND:
assertion_number a d
733
Chapter 7
734
5. We want to establish a breakpoint at line 112, the first line of the function
f( ) and attach commands to the breakpoint to activate assertion mode
and continue execution. Change the Line number to 112. Click in the
Command edit area and enter:
A a; C
6. Create an assertion whose only function is to check that the current line
number is still valid for assertion mode. To do this, use the reserved
special variable $LINE, which contains the line number of the current
execution position. In the Assertions dialog box, click on New... and
enter:
if ($LINE >= 120) {A s; 1 x; C}
If the line number exceeds 120, the program is about to leave the function
f( ) and CrossView Pro deactivates assertion mode. Normally, the x
command would make the program stop, but the nonzero value tells
CrossView Pro to execute the rest of the commands in the list, in this case,
C for continue.
You must enter all commands in the Command Window.
1. First set up the assertion you want:
a if (global_val == 17) {x}
2. Now set a breakpoint on the first line of the function factorial() that
will activate assertion mode, and continue execution:
110 b {A a; C}
3. Now create an assertion that does nothing but make sure that the current
line number is still valid for assertion mode. If the line number exceeds
120, you know you have left the function f() and assertion mode should
be suspended.
a if ($LINE >= 120) {A s; 1 x; C}
$LINE is a reserved special variable that CrossView Pro maintains
In this manner you have created an assertion that is only active over a
limited range of source lines.
and CrossView Pro gives the result. To start again, you may want to
reinitialize $numlines to zero:
$numlines = 0
735
Chapter 7
CHAPTER
DEFINING AND
USING MACROS
Chapter 8
CHAPTER
82
MACROS
83
Chapter 8
84
In the Command Window, use the set command followed by the macros
invocation name and the list of commands. Note that the list of commands
must be in (double) quotation marks. For example, the command:
set st "e main; R"
creates a macro call st that tells CrossView Pro to change the viewing
position to be the first executable line in the function main( ) and restart
the program from the beginning. Each time you enter st in the Command
Window, CrossView Pro substitutes the lengthier list of commands in the
definition.
FUNCTION:
Create a macro.
COMMAND:
Note that there is no rule that the macro definition must be shorter than
the commands it represents. For instance, you could substitute break for
the b command, to make CrossView Pros command language more
expressive:
set break "b"
Macros defined using either the command line or the graphic interface are
accessible both from the Command Window and the Toolbox.
MACROS
8.2.1
85
LISTING MACROS
From the Tools menu, select Macro Definitions... to open the Macro
Definitions dialog box. This dialog box contains a scrollable list of the
macros.
To see the current definition of a macro:
Follow these steps:
From the Tools menu, select Macro Definitions... to open the
Macro Definitions dialog box.
Click on the macro that you want to see.
The Commands box shows (a part of) the macro. If you need to see
more, click on the Edit... button.
Type the echo name command in the Command Window. For instance, to
see the definition for the st macro:
echo st
e main; C 56
Command.
Output.
FUNCTION:
COMMAND:
echo name
8.2.2
REDEFINING A MACRO
Chapter 8
86
Now, the st macro changes the viewing position and restarts program
execution, placing a temporary breakpoint at line 56. Be sure you do not
include a space before the exclamation point. Otherwise, CrossView Pro
may interpret the ! as the C not" operator.
8.2.3
You can save all the macros you define in a debugging session in an
external file. This way, you do not lose the definitions when the program
ends.
To save macros to an external file:
Follow these steps:
From the Tools menu, select Macro Definitions... to open the
Macro Definitions dialog box.
Click on the Save as... button. A Save Macro File dialog box opens.
If you want to save a file previously opened, click on the Save
button. This saves the file without opening the Save Macro File
dialog box.
Alternatively, you can use the Autosave check box. When
Autosave is checked, all macros are saved in the current file when
you leave CrossView Pro.
Type the save file command in the Command Window. This command
saves your macros to the file of your choice. For instance:
MACROS
save macro.mac
FUNCTION:
COMMAND:
save filename
8.2.4
You can load saved macros anytime you want to reuse a definition. There
is no limit to the number of times you can load macros.
To load a macro file:
Follow these steps:
From the Tools menu, select Macro Definitions... to open the
Macro Definitions dialog box.
Click on the Load... button and select the macro file you want to
load.
Alternatively, you can use the Autoload check box. When
Autoload is checked, the macros saved in the current file are
loaded at startup.
To reinstate your macro definitions from the Command Window, use:
< filename.mac
You must load a program before you can read a macro definition file.
Autoload will be ignored when the Execute these settings at
CrossView startup check box in the Load Symbolic Debug Info dialog
box is not checked.
For more information on record and playback functions, see the next
chapter, Command Recording & Playback.
87
Chapter 8
88
8.2.5
DELETING MACROS
When you are removing a macro definition in this manner, you must place
an exclamation point after the macro name to prevent CrossView Pro from
expanding the name to its full macro definition. To update your macro
definition files, issue a save command after using unset.
You can remove all existing macro definitions by entering the unset
command by itself. CrossView Pro prompts you for confirmation before
deleting the macros:
MACROS
unset
Do you want to delete all macros?y
FUNCTION:
Delete a macro.
COMMAND:
unset name!
In this case, the argument $1 represents the intended line number. To use
the brk macro, type:
brk(72)
CrossView Pro replaces every instance of $1 with the value 72. For this
example, that means a breakpoint is set at line 72.
89
Chapter 8
810
MACROS
Be sure not to have any space between the command and the exclamation
point. Otherwise CrossView Pro may interpret the ! as the C not operator.
8.5.1
8.5.2
To configure the toolbox, select Toolbox Setup... from the Tools menu to
view the Toolbox Setup dialog box, shown in figure 83. This dialog box
displays the toolbox buttons and an alphabetized list of the current macro
definitions.
To connect a macro to a toolbox button:
Follow these steps:
Click on the button you wish to change
Scroll through the macro list to highlight the desired function
811
Chapter 8
812
8.5.3
MACROS
CHAPTER
COMMAND
RECORDING &
PLAYBACK
CHAPTER
92
Chapter 9
93
Chapter 9
94
Enter the > command with the name of the file to start recording. For
example, enter:
>session.cmd
After you invoke this command, CrossView Pro saves every executed
command, whether using the mouse or manually typed into the Command
Window, to the file session.cmd.
FUNCTION:
COMMAND:
>filename
FUNCTION:
COMMAND:
>!filename
FUNCTION:
COMMAND:
>@filename
FUNCTION:
COMMAND:
>#filename
9.1.1
ENTERING COMMENTS
Every command, whether typed into the Command Window or the result
of a mouse or menu action goes into the recording file. To add comments
to a file recording CrossView Pro commands, enclose text typed in the
Command Window with C comments delimiters, /*" and */". When
logging emulator commands, refer to your emulator documentation for the
appropriate comment characters.
9.1.2
SUSPEND RECORDING
This function acts like the pause button on a tape recorder: the recording
mechanism stays in place, but suspends temporarily. CrossView Pro does
not save to file any commands you enter while you suspend recording,
but the file remains open and ready to accept input. To suspend
recording:
From the Tools menu, select Record | CrossView... or select Record |
Emulator... Click on the Suspend button.
In the Command Window, use the >f o >#f command (for false").
FUNCTION:
COMMAND:
>f
FUNCTION:
COMMAND:
>#f
9.1.3
RESUME RECORDING
FUNCTION:
COMMAND:
>t
95
Chapter 9
96
FUNCTION:
COMMAND:
>#t
9.1.4
This command shows the status of the recording and logging mechanism.
For example, if you enter > you might see:
>
Output logging is OFF
Command recording is ON
Emulator command recording is OFF
Target communication logging is OFF
The > command gives you the status for the different recording
mechanisms. Output logging and target communication logging are
described below.
9.1.5
Closing a file for recording differs from suspending recording in that when
you close a file, you may not add any more commands to it. If you were
to start recording again using the same filename, the old commands in the
file would be deleted. (Note that this does not exclude editing the file
manually by some other means, since the file is saved as ASCII text.)
From the Tools menu, select Record | CrossView... or select Record |
Emulator... Click on the Stop button to stop recording.
97
COMMAND:
>c
FUNCTION:
COMMAND:
>#c
9.1.6
>f
Suspend Recording
l b
sum
Resume Recording
>t
/* This is a comment! */
>c
The saved command file contains simply the commands, without any
output. Note that commands entered while recording was suspended (l b
and sum) do not appear in the file. Carriage returns are not recognized as
commands.
Chapter 9
98
9.2.1
99
Clicking the Execute button or pressing the Enter key executes the next
command.
FUNCTION:
COMMAND:
<filename
FUNCTION:
COMMAND:
<<filename
9.2.2
A playback file can call another playback file in the course of its
execution.
When CrossView Pro creates a command file, it saves all commands in
their textual form, whether entered by the mouse or as text. You must edit
this file to use the < and << commands.
Chapter 9
910
9.2.3
Playback mode stops automatically when CrossView Pro reaches the end
of the command file. If you want to end playback mode before this point,
click the Halt button.
911
4. Copy the .abs file to the temporary directory. This is needed because
CrossView Pro changes its working directory when the N command is
used.
5. The following line executes CrossView Pro in batch mode and waits for it
to finish:
Windows XP/2000:
start /wait c:\c166\bin\xfw166 timeout=120 tcfg sim166.cfg
p session.cmd R session.log
UNIX:
xfw166 timeout=120 tcfg sim166.cfg p session.cmd
R session.log
Chapter 9
912
9.4 LOGGING
Logging means that all output text to a particular window is saved in a file
for later use. Two windows allow logging:
Command Output Window
(upper part of the CrossView Command Window)
Emulator Output Window
(upper part of the Emulator Command Window)
"GDI Accesses" can also be logged. This is the information transferred
between CrossView Pro and the Debug Instrument (DI).
You can control logging from the Tools menu or from the Command
Window.
You can also determine the status of each logging function:
From Tools menu, select Log | Command Input/ Output..., Log |
CrossViewEmulator I/O... or Log | CrossViewGDI Accesses...
If a logging function is is active, the Stop button is enabled. If the Start
and OK buttons are enabled, logging is off.
Enter the >> , >& or >* command in the Command Window.
Each type of logging is described in the following section.
9.4.1
SETTING UP LOGGING
To setup logging:
From the menu system:
From Tools menu, select Log | Command Input/ Output..., Log
| CrossViewEmulator I/O... or Log | CrossViewGDI
Accesses... to open the appropriate dialog box.
Type in the name of the log file or use the Browse... button to
select a filename. The default filename extension is .log.
Each Log dialog box has an Automatically at CrossView startup
check box. This check box instructs CrossView Pro to start
recording the output of a particular window or information stream
upon starting up of CrossView Pro.
Click on the OK button to save the current settings into the
initialization file xvw.ini for following debugging sessions.
Click on the Start button to start logging.
You can open up a log file for CrossView Command Output by using the
>> filename command as in:
>>screen.log
You can force flushing by using the >>! filename command as in:
>>!screen.log
You can open up a log file for Emulator Output by using the >& filename
command as in:
>&target.log
913
Chapter 9
914
You can force flushing by using the >&! filename command as in:
>&!target.log
You can open up a log file for GDI accesses output logging by using the
>* filename command as in:
>*gdi.log
You can force flushing by using the >*! filename command as in:
>*!gdi.log
FUNCTION:
COMMAND:
>>filename
FUNCTION:
COMMAND:
>>!filename
FUNCTION:
COMMAND:
>&filename
FUNCTION:
COMMAND:
>&!filename
FUNCTION:
COMMAND:
>*filename
FUNCTION:
COMMAND:
>*!filename
9.4.3
9.4.4
You can resume and suspend the Logging process from the menu or from
the Command Window:
From Tools menu, select Log | Command Input/ Output..., Log |
CrossViewEmulator I/O... or Log | CrossViewGDI Accesses... to
select the appropriate dialog box.
915
Chapter 9
916
To suspend logging:
Click on the Suspend button.
In the Command Window, use the >>f command for suspending the
logging of the Command Output Window. Type >&f to suspend the
Emulator Output Window. Type >*f to suspend GDI accesses logging.
After you issue this command, CrossView Pro does not save all subsequent
commands and their computer responses.
To resume logging:
Click on the Resume button.
In the Command Window, use the >>t command to resume logging the
Command Output Window. Type >&t to resume the Emulator Output
Window. Type >*t to resume GDI accesses logging. After you issue this
command, CrossView Pro saves all subsequent commands and their
computer responses.
FUNCTION:
COMMAND:
>>f
FUNCTION:
COMMAND:
>>t
FUNCTION:
COMMAND:
>&f
FUNCTION:
COMMAND:
>&t
FUNCTION:
COMMAND:
>*f
FUNCTION:
COMMAND:
>*t
9.4.5
FUNCTION:
COMMAND:
>>c
FUNCTION:
COMMAND:
>&c
917
Chapter 9
918
This command records all your commands (just like the > command) to
the file session, while:
xfw166 fact R session
logs your commands and screen output to the file session (just like the >>
command).
You can also use the Automatically at CrossView startup option in the
Record, Playback, and Log dialogs to immediately start recording, playback
or logging at CrossView Pro startup.
You can also enter record and playback files via EDE. From the Project
menu, select Project Options... Expand the CrossView Pro entry and
select Logging. Enter your record and playback filenames.
919
Chapter 9
CHAPTER
10
I/O SIMULATION
I/O SIMULATION
CHAPTER
102
Chapter 10
10
I/O Simulation
10.1 INTRODUCTION
The CrossView Pro Terminal windows provide an interface to exchange
data with the application on the target. You can use the following I/O
simulation types for this purpose.
File I/O (FIO)
With File I/O you can connect actions to a probe point. Probe points are
breakpoints that do not update the graphical user interface (GUI) and
when they are hit, connected actions are performed and execution
continues. The actions are in this case I/O actions to a file and/or a
terminal window.
File System Simulation (FSS)
With FSS you can use standard stream I/O function calls like printf() in
your source, to test I/O to and from the target system or simulator.
Debug Instrument I/O (DIO)
If you have a debug instrument that supports it, the debug instrument can
perform input and output using GDI callback functions.
103
Chapter 10
104
Streams can be mapped to a terminal window and/or a file that is NOT the
terminal log file. If a stream is mapped to a terminal window and a file the
output will go to the terminal window and also to the file. In case of input
the input will be read from the file. The read input will be echoed on the
connected terminal window.
I/O streams opened by FSS are closed when end of program is reached or
if a program reset occurs. I/O streams opened by CrossView Pro will be
rewound. The windows to which the streams are mapped remain open.
In the I/O Simulation Setup dialog you can connect an I/O stream to a
terminal window before the stream is opened by specifying the stream
type, filename and terminal window name.
I/O SIMULATION
I/O Simulation
105
Choose the Direction: Input if the stream must provide input to the
application, or Output if the stream must be an output stream.
Click on the Apply button to accept the contents and enter another
configuration or click on the OK button to close this dialog box.
Enter the ios_open or ios_wopen command in the Command Window to
open a File I/O stream.
FUNCTION:
COMMAND:
ios_open ["file"[,[mode][,[r][,$xvw_variable]]]]
FUNCTION:
COMMAND:
ios_wopen [["terminal_window"][,$xvw_variable]]
COMMAND:
FUNCTION:
COMMAND:
Chapter 10
106
I/O SIMULATION
COMMAND:
I/O Simulation
107
Chapter 10
108
For example,
FSS
FSS
FSS
FSS
2>&1
1<&4
4<"data.txt"
3>"data.txt"
The first example will redirect output of stream 2 to stream 1. The second
example will retrieve input for stream 1 from stream 4. The third example
will retrieve input for stream 4 from file "data.txt". The fourth example
will redirect output of stream 3 to file "data.txt".
Disabling an FSS stream means in effect connecting the stream to
/dev/null or NUL, causing writes to go into oblivion, and reads to return
EOF.
I/O SIMULATION
I/O Simulation
109
Chapter 10
1010
I/O SIMULATION
The following keyboard mappings, being both control codes and escape
sequences, are supported by the VT100like terminal mode of the terminal
windows:
Key
Character Sequence
and/or Decimal Value
Backspace
8d
TAB
9d
DEL
127d
ESC
27d
Insert
ESC [ 2 ~
Prev/Page Up
ESC [ 5 ~
Next/Page Down
ESC [ 6 ~
Arrow Up
ESC [ A
Arrow Right
ESC [ B
Arrow Left
ESC [ C
Arrow Down
ESC [ D
I/O Simulation
1011
Display Control
The VT100like terminal mode of the terminal windows comprises the
following control codes and escape sequences for displaying:
ASCII
Code
Decimal
Value
Operation
BELL
BS
TAB
LF
10
CR
13
ESC
27
Operation
ESC D
ESC E
ESC M
ESC [ n1 A
Cursor n1 lines up
ESC [ n1 B
ESC [ n1 C
ESC [ n1 D
ESC [ H
Cursor home
ESC [ n1 ; n2 H
Chapter 10
1012
Escape
Sequence
Operation
ESC [ J
ESC [ p1 J
ESC [ K
ESC [ p1 K
I/O SIMULATION
printf("\033[H\033[2J");
fflush(stdout);
Escape
Sequence
Operation
ESC [ n1 @
Insert characters
ESC [ n1 P
Delete n1 characters
ESC [ n1 L
Insert n1 lines
ESC [ n1 M
Delete n1 lines
I/O Simulation
1013
Escape
Sequence
Operation
ESC [ m
ESC [ n1 m
Operation
ESC [ 12 l
Local echo on
ESC [ 12 h
ESC [ ? 7 h
Wrap around on
ESC [ ? 7 l
ESC [ ? 25 h
Cursor on
ESC [ ? 25 l
Cursor off
ESC [ ? 92 l
I/O SIMULATION
1014
Chapter 10
CHAPTER
11
SPECIAL FEATURES
SPECIAL FEATURES
CHAPTER
112
Chapter 11
11
Special Features
113
COMMAND:
o string
Chapter 11
114
SPECIAL FEATURES
CrossView Pro
Within the CrossView Pros Target Settings dialog (Target |
Settings... ), select the CrossView Pro configuration you will use by
selecting a "Target configuration". These target configuration files are
normal ASCII text files. The name of the shared library that contains the
kernel aware code can be specified in the target configuration. The "radm"
configuration item specifies the name of the shared library that contains
the kernel aware code.
The syntax of a target configuration file is:
[! comment] field : fieldvalue
field
fieldvalue
comment
optional comment
Empty lines, lines consisting of only white space are allowed. Comments
start at an exclamationsign (!) and end at the end of the line.
The line for the shared library that supports RTOS aware code could be:
radm: yourrtos.dll
Special Features
Or you can specify the RADM filename on the CrossView Pro command
line with the following option:
radm=osek_radm.dll
You can specify the ORTI filename on the CrossView Pro command line
with the following option:
orti=ORTfilename
The OSEK RADM adds an OSEK/ORTI menu to CrossView Pro that has
several items (each description in the notation <text> is represented in
the syntax of the OSEK Run Time Interface file):
OSEK implementation name (if reading of the ORTI file succeeded)
The OSEK implementation name is specified with <name> in the
<declaration_section> of the ORTI file.
For each <declaration_spec> a sub menu item will be created with the
name represented for <object>. When selecting an object item a
window will appear with all objects from the <information_section> for
the specified <object>. The new created window always contains the
Object column and then the columns represented in the
<object_decl_list> of the specified object.
Info Messages
This menu item lists all expressions from the ORTI file that could not
be evaluated. This could be an expression within the
<declaration_section> represented in the <enum_value_list>. However
evaluating the expressions from the objects in the
<information_section> also could have problems. The problems could
occur when the expression is to difficult to be evaluated or when one
of the variables of the expression is not available when the symbolic
debug info is loaded.
When an expression could not be evaluated it results into N.A. for the
specified window object entry item. When the expression could be
evaluated but the enumerated type could not be found or the specified
type could not be converted correctly this will result into n.a. for the
specified window object entry item.
115
Chapter 11
116
N.A. :
For the second situation you can type the expression in the command
window and CrossView Pro will show a message box with the reason
why the expression could not be evaluated.
About RADM
This menu item shows the supported OSEK/ORTI version and the
RADM version.
11.3 COVERAGE
SPECIAL FEATURES
Special Features
117
ce
FUNCTION:
Enable coverage.
COMMAND:
ce
FUNCTION:
Disable coverage.
COMMAND:
cd
Two dialogs are present to give you coverage information. The code
coverage dialog shows the percentage of executed code within
application, module and function scope. Code coverage information can
also be displayed in the Source Window. The data coverage dialog shows
the data access of HLL variables in the executed program. Data coverage
can also be displayed in the Memory Window. The coverage dialogs can
be opened via the Tools menu.
FUNCTION:
COMMAND:
FUNCTION:
COMMAND:
nC
FUNCTION:
COMMAND:
nU
Chapter 11
SPECIAL FEATURES
118
FUNCTION:
COMMAND:
pC
FUNCTION:
COMMAND:
pU
11.4 PROFILING
You can only use this feature if it is supported by the execution
environment (see the addendum).
Profiling allows you to perform timing analysis on your software. Two
forms of profiling are implemented in CrossView Pro. Both forms of
profiling are fully implemented in the CrossView Pro debugger. You do
not have to recompile your source code to enable the profiling features.
Special Features
119
Chapter 11
1110
FUNCTION:
COMMAND:
SPECIAL FEATURES
COMMAND:
Special Features
1111
FUNCTION:
Enable profiling.
COMMAND:
pe
FUNCTION:
Disable profiling.
COMMAND:
pd
Select the Profiling button in the Source Window to display profile data
in the Source Window. If profiling is not enabled, this button also starts
gathering of profiling data.
Normally both function and code range profiling will slow down the
execution speed of the application being debugged. Therefore, switch off
profiling whenever the timing information is not required.
Chapter 11
1112
SPECIAL FEATURES
The transform data process takes the raw data as input, processes it, and
the result of the transformation, a set of (x, y) pairs, is saved in the
processed data buffer associated with a window. Since the transformations
are described in CXL (CrossView eXtension Language) the user can
program the data transformation that is of most interest for him. For
example, an FFT power spectrum would produce (frequency, power)
pairs.
The generate representation process takes data from the processed data
buffer, (x, y) pairs, as input and generates a display list. This process scales
the data according to the given display window size. This process is coded
in CXL. So, in addition to the scripts provided by TASKING, the user can
write his own representation processes. For example, an FFT power
spectrum is usually represented by a bar graph.
The drawing engine process takes the display list as input and produces
the graph that is displayed in the Data Analysis window. The drawing
engine is part of the CrossView Pro executable and cannot be configured
by the user.
A clear separation between data transformation (the transform data
process) and data presentation (generate representation process) has been
made to increase the reusability of complex data presentation scripts.
Once the scripts are written (a number of frequently used operations are
supplied), the following three steps must be made in order to display data:
1. Set the display mode for the desired window using the graphm
command. For example,
graphm "demo","show_x_t.cxl"
Special Features
"demo" will be shown in the title bar of the window. It is also the name
used to refer to the window.
2. Retrieve data from the target into a buffer using the memget command.
For example,
memget ((int []) 0x0)[$i],128,$buffer
$i is the "iterator" to walk 128 times through the expression (Note: the
For details of the arguments provided to x_t.cxl, see below. Now a used
buffer can be freed using the bufd command (if the target data is not to
be used anymore).
Steps 1. and 2. can be repeated as many times as desired. The display
mode can be changed at any time by issuing a graphm command for the
window to be changed. Using the graphp command, a window can be
positioned anywhere on the screen.
1113
Chapter 11
1114
XT plotting
An xt plot is the most straightforward way of displaying data. Data is
taken from one buffer, each value is taken as the x value and the t value is
increasing linearly. It is displayed as a graph the way it is found in the
buffer (memory). The layout of the scales and the form of the graph (line,
bar, dot) can be selected as shown below.
1. Generating window data pairs:
graph "win_title", "x_t.cxl", $buffer, t_offset, t_increment
generates (t, x) pairs: (t_offset + i * t_increment, $buffer[i]). The
generated data is attached to the specified window.
2. Setting the display mode:
graphm "win_title", "show_x_t.cxl" [, low_x, high_x [, low_y, high_y ] ]
displays lines drawn between successive coordinates specified by the
window data pairs.
graphm "win_title", "show_cross.cxl" [, low_x, high_x [, low_y, high_y ] ]
SPECIAL FEATURES
Special Features
1115
Chapter 11
1116
rectangular
triangular
Hanning
BlackmanHarris
input buffer
F1
SPECIAL FEATURES
F2
F3
2
two_exp
F4
the rest of frame F4
will contain zeros
Special Features
1117
*/
/* Rerun the program when the script is executed */
/* If on the simulator, go to fast mode
*/
/* Step to the main() routine to allow access
*/
/* to the output[] array.
*/
memget output[$i],256,$t /* Its clear now. */
bufa $f,$t,4096 /* Construct an empty time domain history
*/
bufa $f,$t,4096
bufa $f,$t,4096
bufa $f,$t,4096
bufa $f,$t,4096
bufa $f,$t,4096
bufa $f,$t,4096
bufa $f,$t,4096
$color=0
/* Initialize the $color variable to track the graphs */
/* DEFINE THE TIME DOMAIN WINDOW */
graphp "Output time domain",50,25,716,295 /* set window position */
graphm "Output time domain","show_x_t.cxl"
/* set draw method */
graph "Output time domain","x_t.cxl",$t,0,1
/* use the t buffer */
graph_clear_updates "Output time domain"
/* Set Output time domain window update actions:
graph_add_update "Output time domain",memget output[$i],256,$t
/* Get new time domain data from output[] into $t buffer
graph_add_update "Output time domain",graph "Output time
domain","x_t.cxl",$t,0,1
/* This command recalculates and redraws the window
*/
*/
*/
Chapter 11
1118
SPECIAL FEATURES
/* PLACE
WINDOWS
main#141
domain";
*/
*/
*/
*/
*/
*/
Special Features
1119
Chapter 11
1120
There are two ways you can program a FLASH device. CrossView Pro can
program the FLASH device through target memory read/write accesses
(hosttarget communication), or alternatively CrossView Pro can download
a FLASH programming monitor to the target to execute the FLASH
programming algorithm (targettarget communication). The second
method is faster, however you use temporary target memory to store the
FLASH programming monitor and you have to specify a temporary data
workspace for interaction between CrossView Pro and the FLASH
programming monitor.
Most flash devices require a sequence of memory accesses to set the
device in programming mode. These accesses must occur in a given time
interval. So, if the interface between CrossView Pro and the target is rather
slow (for example an RS232 interface) you can better choose to
download a FLASH programming monitor (do not use target memory
accesses).
The Use target memory accesses to program flash devices check box
in the Flash Setup dialog specifies the type of access to the FLASH device.
To setup a FLASH device
SPECIAL FEATURES
From EDE:
1. From the Project menu, select Project Options...
The Project Options dialog appears.
2. Expand the Application | FLASH Setup entry.
3. Specify OnChip Flash or specify an External Flash Chip.
From CrossView Pro:
1. From the Target menu, select FLASH Setup...
The FLASH Setup dialog appears.
2. Click Add... to specify a FLASH device.
The Add FLASH Device dialog appears.
3. In the Device type box, doubleclick on the name of the manufacturer
of the device.
4. Select a flash device.
Special Features
1121
5. Click on the Base address edit field and enter the start address of the
memory range that will be covered by the FLASH device.
6. In the Chip width field select the width of the FLASH device.
7. In the Number of chips field, enter the number of FLASH devices that
are located in parallel. For example, if you have two 8bit devices in
parallel attached to a 16bit data bus, enter 2.
8. Click OK.
The FLASH Setup dialog appears again and the new device is shown in
the list.
9. Specify the data workspace address used by the FLASH programming
monitor. This address may not conflict with the addresses of the FLASH
devices.
10. Click OK.
The FLASH device is now known to CrossView Pro.
Type the fa and fw commands on the command line, for example:
fa AM29F040,0xFFE00000,8,2
fw 0x10000
FUNCTION:
COMMAND:
fa device_name,base_address,chip_width[,nr_of_chips]
FUNCTION:
COMMAND:
fw [address]
Chapter 11
1122
SPECIAL FEATURES
Special Features
1123
11.7.1 CONFIGURATION
CrossView Pro can be instructed to automatically refresh one or more
windows of the debugger periodically while running in background mode.
You can use the Background Mode Setup dialog for specifying the desired
set of windows to be refreshed.
From the Settings menu, select Background Mode Setup... to open the
Background Mode Setup dialog.
A distinction has been made between updating the Source lines window
and updating the Disassembly window. Updating the Disassembly window
may be to timeconsuming, so you may want to disable its updating in
Background mode, while still keeping the Source lines window
uptodate when that is displayed on screen.
Use the u command to toggle the updating of windows in background
mode.
FUNCTION:
COMMAND:
[interval] u [d|k|r|cd|ck|cr|s|a|mem|t]
Chapter 11
1124
SPECIAL FEATURES
Special Features
1125
FUNCTION:
COMMAND:
COMMAND:
[count] CB [linenumber]
This will start the application under debug to run continuously (as with
the C command), and switch CrossView Pro from Halted to Background
Mode. count is assigned to the breakpoint at the current execution
position as the number of times to hit this breakpoint before execution to
stop. linenumber specifies the source line to place a temporary
breakpoint.
The mouse pointer changes to an arrow with a small watch face
underneath. This indicates that CrossView Pro is now in background
mode. Some commands are treated a little different in this mode, because
they can otherwise influence the running program badly. Commands that
need information from the stack (like bU, bu, bb or bB) are not allowed
because that information is not reliable. Other commands require great
care, for example the o command.
For example if you type the g while in background mode you will see:
xvw% g 56
Command "g" is not allowed while the emulator is
running in background.
Chapter 11
1126
SPECIAL FEATURES
COMMAND:
st
COMMAND:
wt
Special Features
In this example sum is a long (4 bytes). You must be sure that sum
remains at that address while the program is running.
The values you get this way are only valid under specific conditions. Local
variables from the function main normally meet these conditions.
1127
Chapter 11
1128
11.7.8 ASSERTIONS
SPECIAL FEATURES
CHAPTER
12
DEBUGGING NOTES
DEBUGGING NOTES
CHAPTER
122
Chapter 12
12
Debugging Notes
123
DEBUGGING NOTES
124
Chapter 12
CHAPTER
13
COMMAND
REFERENCE
Chapter 13
CHAPTER
132
REFERENCE
13
Command Reference
133
Chapter 13
134
exp
clear
number ct
REFERENCE
e [func | file]
Enter function func or file file or view current viewing
position.
stack e
[addr] ei
f ["printfstyleformat"]
Change default address display format.
gus {on|off}
Suppress or reactivate CrossView Pro window updating.
L
Command Reference
135
l {a|b|d|f|g|k|l|L|m|p|r|s|S} [string]
List assertions, breakpoints, directories, files, globals, kernel
state data, labels (on module scope), all Labels, memory map
(of application code sections), procedures, registers, special
variables, Symbol tables. If given, only those starting with
string.
l [func]
l stack
nC
nU
pU
[exp] T
Trace the stack for exp number of levels, list local variables.
[exp] t
td
Disable tracing.
te
Enable tracing.
ce
Chapter 13
136
m exp
num m d
REFERENCE
pe
Command Reference
137
Chapter 13
138
update "window"
Update the window specified.
a cmds
exp a {a|d|s}
Activate, delete, suspend assertion exp.
B
[line] b [cmds]
Set breakpoint at source line line, and associate command list
cmds with breakpoint.
[stack] bB [cmds]
Set temporary breakpoint at beginning of function at stack
level stack and associate command list cmds.
[stack] bb [cmds]
Set breakpoint at beginning of function at stack level stack
and associate command list cmds.
REFERENCE
Command Reference
139
num bena
[addr] bI [cmds]
Set temporary breakpoint at machine instruction and
associate command list cmds.
[addr] bi [cmds]
Set breakpoint at machine instruction and associate command
list cmds.
count bINST [cmds]
Set temporary breakpoint after count machine instructions
and associate command list cmds.
count binst [cmds]
Set breakpoint after count machine instructions and associate
command list cmds.
break [type] where [, option]...
Universal breakpoint command. Several types of breakpoints
are available. The meaning of where depends on the selected
type. Breakpoint options must be separated by commas.
time bTIM [cmds]
Set temporary breakpoint after time number of seconds and
associate command list cmds.
time btim [cmds]
Set breakpoint after time number of seconds and associate
command list cmds.
[stack] bU [cmds]
Set a temporary uplevel breakpoint at stack level stack and
associate command list cmds.
[stack] bu [cmds]
Set uplevel breakpoint at stack level stack and associate
command list cmds.
Chapter 13
1310
Dy
REFERENCE
[cpu] ec
g line
address gi
q [y]
qs
rst
[exp] S
Command Reference
1311
[exp] s
[exp] Si
[exp] si
st
[interval] u [d|k|r|s|a|mem|t]
Toggle updating of the appropriate window when the target
runs in the background. You can specify the update interval,
in seconds. If interval is zero, never update automatically.
This command is not available for all execution
environments.
ubgw [s|a|k|r|d|mem|t|all]
Refresh the appropriate window, or all open windows, when
the target runs in the background. This command is not
available for all execution environments.
use [path]...
Clear source directory search path or use the specified path
to search for source files.
wt
[exp] x
<<file
>file
>{t|f|c}
Set recording file status, true (t), false (f) or closed (c).
Chapter 13
REFERENCE
1312
>
>#file
>#{t|f|c}
Set emulator recording file status, true (t), false (f) or closed
(c)
>@file
>@{t|f|c}
>>file
>>{t|f|c}
Set logging file status, true (t), false (f) or closed (c)
>>
>&file
>&{t|f|c}
>&
>*file
>*{t|f|c}
Set GDI accesses log file status, true (t), false (f) or closed (c)
13.2.6 MACROS
echo string Display macro expansion of string.
save file
set
Command Reference
1313
unset macro!
Delete definition of macro macro.
macro!
Chapter 13
1314
dn file
fa device_name,base_address,chip_width[,nr_of_chips]
Add FLASH device to list of configured FLASH devices.
REFERENCE
fc device_number
Check the manufacturer and device identifiers of a FLASH
device.
fd device_number
Delete FLASH device.
fl
fp device_number
Get protection status of a FLASH device.
fpe device_number
Protect FLASH device.
fpd device_number
Unprotect FLASH device.
Command Reference
1315
fw [address]
Specify workspace address of FLASH programming monitor.
load [file]
N [file]
n [addr]
o [cmd]
! [commandline]
Execute shell command commandline or invoke new shell.
13.2.10
13.2.11
I
HELP COMMANDS
Print information about debugger state.
Chapter 13
1316
13.2.12
SEARCH COMMANDS
/[string]
?[string]
"string"
Print string.
REFERENCE
The rest of this chapter provides the detailed descriptions of the CrossView
Pro commands.
Command Reference
expression
Function
Print the value or address of an expression.
From the Data menu, select Evaluate Expression... Enter an expression
and optionally select a display format. You may set up a monitor, which
instructs the debugger to evaluate a particular expression each time the
program stops, from the Source Window by selecting text there and by
clicking on the Watch Expression button.
Enter the expression in the Command Window. You may specify in which
format you want CrossView Pro to display the answer.
Description
In the Command Window, the syntax for this command is:
exp [/ format |@ format]
Print the value or address of exp with format format. A / (slash) is used to
print the value of exp and a @ (commercial at) is used to print the address
of exp. If format is not supplied, the natural (/n) format of the expression
is used.
Formats have the syntax:
[count] style [size]
count is the number of times to apply the format style and defaults to 1.
style may be one of:
a c D O U X d o u x E F G e f g i I n P p s t
See Chapter 6, Accessing Code and Data, and section 3.5 Formatting
Expressions in Chapter 3, Command Language, for details on each of the
format styles.
size indicates the number of bytes to be formatted. Rather than a number
for the integer type styles, size can also be: c for char, s for short, i for int,
and l for long.
The default action, if no modifier is specified, is to print the value of exp
using the /n (normal) format.
1317
Chapter 13
1318
CrossView Pro will set special variable $s_aux to the result of the function
call to func with the variables t and s passed as parameters. If you type:
$s_aux/x4
Print the value of the special variable $s_aux as four hex bytes; you could
also use: $s_aux/xl.
REFERENCE
Command Reference
line
Function
Display the C source line numbered line in the current source file.
From the Edit menu, select Find Line... Enter the line number and click
on the Find button. Alternately, you may click on the desired source line
in the Source Window.
Enter the line number in the Command Window. The syntax is:
line
Description
The current viewing position becomes line.
Example
To display the twelfth line in the current source file, type:
12
e, p, P
1319
Chapter 13
1320
string
Function
Echo a string to the terminal.
Enter the string to the Command Window.
Description
A string may contain standard C escapes, such as \n for a newline. The
syntax for a string in the Command Window is:
"string"
Example
This function can be useful for labelling breakpoints. For example, to
insert a breakpoint at line 12 and have a message printed when that line is
reached, enter:
12 b {"At the twelfth line\n"; C}
When CrossView Pro reached line 12, the message At the twelfth line"
will be printed and the program will continue. If you only type:
"Debug"
REFERENCE
Q, expression
Command Reference
!
Function
Instruct CrossView Pro to interpret a command literally, ignoring any
macro definitions of the same name. Also, enter a shell command.
The syntax for this command is:
[ string ] !
or:
! [ string ]
Description
This command is useful whenever string should be treated literally and not
as a potential macro invocation. It can be used, for example, in executing
an CrossView Pro command whose name has been defined as a macro.
Example
To enter the host environment under a new shell, type:
!
1321
Chapter 13
1322
/
Function
Search down (forward) for a string.
To search for a string in the Source Window, select Search String... from
the Edit menu and select the up radio button. To repeat your search click
on the Find Next Text String button.
The command line syntax is:
/ [ string ]
Description
The search begins with the line after the current line. If the string is found
the viewing position is changed to the line containing the string. The
execution position is not affected. If you do not specify a string to search
for, CrossView Pro will look for the most recent specified string.
Searches wrap around to the beginning of the file. Regular expressions are
not recognized.
Example
To look for the next occurrence of Random in the current file, beginning
with the line after the current line, type:
REFERENCE
/Random
?, Z
Command Reference
?
Function
Search up (backward) for a string.
To search for a string in the Source Window, select select Search String...
from the Edit menu and select the down radio button. To repeat your
search click on the Find Next Text String button.
The command line syntax is:
? [ string ]
Description
The search begins with the line before the current line. If string is found,
the current line is changed to point to the line containing the string. The
execution position is not affected. If you do not specify string, CrossView
Pro searches for the previouslyspecified string again.
Searches wrap around to the end of the file. Regular expressions are not
recognized.
Example
To look for the previous occurrence of Random in the current file,
beginning with the line above the current line, type:
?Random
/, Z
1323
Chapter 13
1324
<
Function
Continuous command playback. Read commands continuously from a file.
To setup command playback, select Playback | CrossView... from the
Tools menu. Enable the Continuous playback check box and click on
the Execute button.
The command line syntax is:
< file
Description
All the commands in file will be read and executed. If a playback file
contains either a < or << command, playback switches to the newly
specified file and returns to the original file. The first playback file
determines the type of playback: continuous or single step.
Record and playback options can also be specified via command line
parameters.
If the execution of commands from the playback file is interrupted with
the Halt button, CrossView Pro will begin reading the remainder of
commands in file using single step playback (see the << command.)
Example
REFERENCE
To read and execute the commands found in the file command.cmd, type:
<command.cmd
<<, >, I
Command Reference
<<
Function
Singlestep command playback.
To setup command playback, select Playback | CrossView... from the
Tools menu. Disable the Continuous playback check box and click on
the Execute button.
The command line syntax is:
<<file
Description
Commands will be played back one at a time. Each command will be
loaded sequentially into the entry field of the Command Window. The
command can then be edited and executed. If a playback file contains
either a < or << command, playback switches to the newly specified file
and returns to the original file. The first playback file determines the type
of playback: continuous or single step.
The carriage return will execute the current command and stop at the next
one.
If a playback file contains either a < or << command, playback switches to
the newly specified file and does not return to the original file. Record and
playback options can also be specified via command line parameters.
Example
To read and execute the commands found in the file command.cmd, type:
<< command.cmd
<, >, I
1325
Chapter 13
1326
>
Function
Record CrossView Pro commands to a file.
To start recording or toggle the state of the command recording
mechanism, select Record | CrossView... from the Tools menu. Type or
select a file to record commands in and click on the Start button to start
recording. To suspend recording click on the Suspend button. To resume
recording click on the Resume button. To stop recording click on the
Stop button.
The command line syntax is (note that the greater than sign must be typed
as shown):
> [ ! ] [ file | t | f | c ]
Description
CrossView Pro will start recording commands in a file if file is specified,
otherwise, turn recording on (t), off (f), or close (c) the recording file.
Specifying a different file while recording is on will cause the old output
file to be closed and all successive commands will be sent to the new file.
If no arguments are given, the state of the recording mechanism will be
displayed.
REFERENCE
Command Reference
1327
Chapter 13
1328
>@
Function
Record CrossView Pro and emulator commands to a file.
To start recording or toggle the state of the command recording
mechanism, select Record | CrossView... from the Tools menu. Type or
select a file to record commands in, select Include emulator commands
and click on the Start button to start recording. To suspend recording
click on the Suspend button. To resume recording click on the Resume
button. To stop recording click on the Stop button.
The command line syntax is (note that the greater than sign must be typed
as shown):
>@ [ ! ] [ file | t | f | c ]
Description
CrossView Pro will start recording commands in a file if file is specified,
otherwise, turn recording on (t), off (f), or close (c) the recording file.
Specifying a different file while recording is on will cause the old output
file to be closed and all successive commands will be sent to the new file.
If no arguments are given, the state of the recording mechanism will be
displayed.
REFERENCE
Command Reference
1329
Chapter 13
1330
>#
Function
Record emulator commands to a file.
To start recording or toggle the state of the command recording
mechanism, select Record | Emulator... from the Tools menu. Type or
select a file to record commands in and click on the Start button to start
recording. To suspend recording click on the Suspend button. To resume
recording click on the Resume button. To stop recording click on the
Stop button.
The command line syntax is (note that the greater than sign must be typed
as shown):
># [ ! ] [ file | t | f | c ]
Description
CrossView Pro will start recording emulator commands in a file if file is
specified, otherwise, turn recording on (t), off (f), or close (c) the
recording file. Specifying a different file while recording is on will cause
the old output file to be closed and all successive commands will be sent
to the new file. If no arguments are given, the state of the recording
mechanism will be displayed.
REFERENCE
Command Reference
1331
Chapter 13
1332
>>
Function
Log Command Window screen output. All Command Window input and
output will be saved to a file.
To create a log of Command Window screen output, select Log |
Command Input/Output... from the Tools menu. Type or select a file to
log to and click on the Start button to start logging. To suspend logging
click on the Suspend button. To resume logging click on the Resume
button. To turn off logging click on the Stop button.
The command line syntax is:
>> [ ! ] [ file | t | f | c ]
Description
Start logging the commands typed and their output in a file if file is
specified, otherwise, turn logging on (t), off (f), or close (c) the log file.
Specifying a different file while logging is on will cause the old output file
to be closed and all successive Command window output will be sent to
the new file. If no arguments are given, the state of the recording and
logging mechanism is displayed.
The optional ! forces flushing of the output after every write.
REFERENCE
Command Reference
To stop recording the screen output and close the file, type:
>>c
>, >&, I, q
1333
Chapter 13
1334
>&
Function
Log communications between debugger and emulator.
To save debugger/emulator communications, select Log |
CrossViewEmulator I/O... from the Tools menu. Type or select a file to
log to and click on the Start button to start logging. To suspend logging
click on the Suspend button. To resume logging click on the Resume
button. To turn off logging click on the Stop button.
The command line syntax is:
>& [ ! ] [ file | t | f | c ]
Description
Start hosttoexecution environment communication logging in a file if file
is specified; otherwise, turn logging on (t), off (f), or close (c) the log file.
This feature is most often used to diagnose problems with CrossView Pro
itself.
The optional ! forces flushing of the output after every write.
The commands captured cannot be played back the way commands
recorded by the > command can. The log file is also closed as a side effect
of the q command.
REFERENCE
Command Reference
>, >>, q
1335
Chapter 13
1336
>*
Function
Log GDI accesses.
To save GDI accesses, select Log | CrossViewGDI Accesses... from the
Tools menu. Type or select a file to log to and click on the Start button to
start logging. To suspend logging click on the Suspend button. To resume
logging click on the Resume button. To turn off logging click on the Stop
button.
The command line syntax is:
>* [ ! ] [ file | t | f | c ]
Description
Start GDI accesses logging in a file if file is specified; otherwise, turn
logging on (t), off (f), or close (c) the log file. This feature is most often
used to diagnose problems with the Debug Instrument.
The optional ! forces flushing of the output after every write.
The commands captured cannot be played back the way commands
recorded by the > command can. The log file is also closed as a side effect
of the q command.
Example
REFERENCE
To open the file gdi.log and start logging GDI accesses in this file, type:
>*gdi.log
>, >>, q
Command Reference
^
Function
Display contents of preceding memory location based on the size of the
last data item displayed.
The command line syntax is:
^ [ format ]
Description
Use previous format or format, if supplied. Formats have the syntax:
[count] style [size]
count is the number of times to apply the format style and defaults to 1.
style may be one of:
a c D O U X d o u x E F G e f g i I n P p s t
See Chapter 6, Accessing Code and Data, and section 3.5 Formatting
Expressions in Chapter 3, Command Language, for details on each of the
format styles.
size indicates the number of bytes to be formatted. Rather than a number
for the integer type styles, size can also be: c for char, s for short, i for int,
and l for long.
This command is most often used in combination with exp/format to look
at the value of some variable or memory location.
Example
To display the variable aux as two octal values of length two, type:
^ aux/2o2
To show the eight bytes before aux in hexadecimal format, next type:
^2x4
expression
1337
Chapter 13
1338
A
Function
Toggle the state of the assertion mode.
To activate or suspend assertion mode, select Assertions... from the
Breakpoints menu, and enable or disable the Assertion Mode Active
check box.
The command line syntax is:
A[a|s]
Description
Activate (A a) or suspend (A s) overall state of the assertion mechanism. If
no operand is given, toggle the state.
Example
To activate the assertion mechanism, type:
A a
REFERENCE
Command Reference
a
Function
Define or modify an assertion.
From the Breakpoints menu, select Assertions... to open the Assertions
dialog box. Click the New... button to define an assertion. Select an
assertion and click the Edit... button to modify an assertion.
The command line syntax is:
exp a { a | d | s }
a cmds
Description
The a command is used to invoke two different commands. The syntax for
each command is distinct. The first version allows modification of the state
of the assertion specified by the expression exp. (The assertion can be
activated (a a), deleted (a d) or suspended (a s).) The second version
creates a new assertion with the given command list cmds. Using the
mouse, you can create a new assertion or toggle the state of an existing
one from the Assertions dialogue box.
Suspended assertions continue to exist, but are not active. Deleted
assertions must be explicitly redefined in order to be made active again.
The commands for every active assertion are executed after every source
statement is executed. The x command in an assertion command list
forces an exit from assertion mode.
This command is not allowed when the target runs in the background.
Example
To suspend assertion 3, type:
3 a s
1339
Chapter 13
1340
REFERENCE
A, l, x
Command Reference
B
Function
List all of the currently defined breakpoints.
From the Breakpoints menu, select Breakpoints... to open the
Breakpoints dialog box.
The command line syntax is:
B
Description
Breakpoints are listed with numbers associated with them. These numbers
can be used to delete individual breakpoints.
break, b, bb, bB, bi, bI, bu, bU, R, C, D, l
1341
Chapter 13
1342
b
Function
Set a code breakpoint.
From the Breakpoints menu, select Breakpoints... to open the
Breakpoints dialog box. Click the Add > button and select Code
Breakpoint... to open the Add Code Breakpoint dialog. Enter the name of
the source module or click the Break At... button to select a source
module and enter a line number.
Alternatively, you can set a code breakpoint directly in the source by
clicking on a green breakpoint toggle next to the source line.
The command line syntax is:
[line] b [commands]
Description
You can attach a list of CrossView Pro commands with the breakpoint. If
no line is given, set the breakpoint at the current viewing position.
When the breakpoint is hit execution is halted. By default the current
execution position, function, line number, and source statement are
displayed. Next, any commands associated with the breakpoint are
executed. The Q command can be used to suppress the output from the b
command.
REFERENCE
Example
To set a breakpoint at the current line, type:
b
To set a breakpoint at line 10 that will list all global variables and halt
execution, type:
10 b {l g}
break, bd, bD, bdis, bena, bb, bB, bi, bI, bt, bti, btI, bu, bU, Q
Command Reference
bB
Function
Set a temporary breakpoint at the beginning of a function.
In the Stack Window, click on the desired function and select Stack
Breakpoint | At Function Entry from the Breakpoints menu.
The command line syntax is:
[ stack ] bB [ cmds ]
Description
The function is designated by the stack level stack. If no function is
specified, CrossView Pro uses the current function (stack level 0), and
associates the list of CrossView Pro commands cmds with the breakpoint.
Breakpoints set in the Stack Window are always temporary, meaning they
will be deleted after the first time you reach them. A breakpoint set in this
manner will not be visible in the Source Window.
When the breakpoint is hit, execution is halted; the breakpoint is then
removed. By default the current execution position, function, line number,
and source statement are displayed. Next, any commands associated with
the breakpoint are executed. The Q command can be used to suppress the
output from the bB command.
This command is not allowed when the target runs in the background.
Example
To set a temporary breakpoint at the beginning of the current function
which prints a stack trace, type:
bB {T}
break, b, bb, bd, bD, bi, bI, bt, bti, btI, bu, bU, Q
1343
Chapter 13
1344
bb
Function
Set a permanent breakpoint at the beginning of a function.
In the Stack Window, click on the desired function and select Stack
Breakpoint | At Function Entry from the Breakpoints menu. To make
the stack breakpoint permanent, select Breakpoints... from the
Breakpoints menu, select the desired breakpoint and click on the Edit...
button. The Edit Code Breakpoint dialog appears. Click on the
Advanced>> button and disable the Remove when hit check box.
The command line syntax is:
[ stack ] bb [ cmds ]
Description
Set a breakpoint at the beginning of the function designated by the stack
level stack. Otherwise, use the current function (stack level 0), and
associate the list of CrossView Pro commands cmds with the breakpoint.
When the breakpoint is hit, execution is halted. By default the current
execution position, function, line number, and source statement are
displayed. Next, any commands associated with the breakpoint are
executed. The Q command can be used to suppress the output from the
bb command.
REFERENCE
This command is not allowed when the target runs in the background.
Example
To set a breakpoint at the beginning of the current function, which prints a
stack trace, type:
bb {T}
break, b, bB, bd, bD, bi, bI, bt, bti, btI, bu, bU, Q
Command Reference
bc
Function
Set a breakpoints count and reset count.
From the Breakpoints menu, select Breakpoints... , select the
breakpoint for which you want to set the count and reset count and click
on the Edit... button. The Edit Code Breakpoint dialog appears. Click on
the Advanced button and enter a breakpoint count.
The command line syntax is:
[ number ] bc [ count ] [ reset_count ]
Description
Set the count and reset_count for the breakpoint with breakpoint number
number. When no arguments are given, the breakpoint at the current
viewing position is set to a count of 1 and a reset count of 1. If no
breakpoint is present at the current viewing position, the message "No
such breakpoint" appears.
Each time a breakpoint is hit, CrossView Pro decrements the count. When
the count reaches 0, execution is halted and the count is reset to the
reset_count.
This command is not allowed when the target runs in the background.
Example
To set a breakpoints count and reset count to 1 for the breakpoint at the
current viewing position, type:
bc
To set the count to 3 and the reset count to 4 for the breakpoint whose
breakpoint number is 2, type:
2 bc 3 4
break, C
1345
Chapter 13
1346
bCYC
Function
Set a temporary cycle count breakpoint.
From the Breakpoints menu, select Breakpoints... to open the
Breakpoints dialog box. Click the Add > button and select Cycle
Breakpoint... to open the Add Cycle Breakpoint dialog. Click the
Advanced button and enable the Remove when hit check box.
The command line syntax is:
count bCYC [cmds]
Description
Set a temporary breakpoint after the specified cycle count. count can be
any expression evaluating to a number. The list of CrossView Pro
commands cmds are executed when the breakpoint is hit.
When the breakpoint is hit, execution is halted; the breakpoint is then
removed. By default the current execution position, function, line number,
and source statement are displayed. Next any commands associated with
the breakpoint are executed. The Q command can be used to suppress the
output from the bCYC command.
Example
REFERENCE
To set a temporary breakpoint after 4 clock cycles and list all global
variables, type:
4 bCYC {l g}
Command Reference
bcyc
Function
Set a permanent cycle count breakpoint.
From the Breakpoints menu, select Breakpoints... to open the
Breakpoints dialog box. Click the Add > button and select Cycle
Breakpoint... to open the Add Cycle Breakpoint dialog. Enter a cycle
count and click the OK button.
The command line syntax is:
count bcyc [cmds]
Description
Set a permanent breakpoint after the specified cycle count. count can be
any expression evaluating to a number. The list of CrossView Pro
commands cmds are executed when the breakpoint is hit.
When the breakpoint is hit, execution is halted. By default the current
execution position, function, line number, and source statement are
displayed. Next any commands associated with the breakpoint are
executed. The Q command can be used to suppress the output from the
bcyc command.
Example
To set a cycle count breakpoint after 4 clock cycles and list all global
variables, type:
4 bcyc {l g}
1347
Chapter 13
1348
bD
Function
Set a read and/or write data breakpoint over a range of addresses.
From the Breakpoints menu, select Breakpoints... to open the
Breakpoints dialog box. Click the Add > button and select Data
Breakpoint... to open the Add Data Breakpoint dialog. Enter an address
or click the Address... button to select a symbol to use as the address.
Click the Advanced button. Enter an address in the End adress field or
click the Browse... button to select a symbol to use as the end address.
Click the OK button to add the data breakpoint.
The command line syntax is:
exp1 bD { r | w | b } exp2 [cmds]
Description
Set a read, write, or both (read and write) data breakpoint in the address
range exp1 to exp2 and associate the list of CrossView Pro commands
cmds with the breakpoint.
REFERENCE
Command Reference
This breakpoint will be hit only if any address in the range of addresses is
read from.
To set a data breakpoint for the address range 10 to 10f hex (256 bytes)
that will list all global variables, type:
0x10 bD b 0x10f {l g;}
This breakpoint will be hit if any memory locations within the range
1010f hex are either read from or written to.
break, b, bb, bB, bd, bi, bI, bt, bti, btI, bu, bU, Q
1349
Chapter 13
1350
bd
Function
Set a read and/or write data breakpoint at an address.
From the Breakpoints menu, select Breakpoints... to open the
Breakpoints dialog box. Click the Add > button and select Data
Breakpoint... to open the Add Data Breakpoint dialog. Enter an address
or click the Address... button to select a symbol to use as the address.
Click the OK button to add the data breakpoint.
The command line syntax is:
exp bd { r | w | b } [cmds ]
Description
Set a read, write or both (read and write) data breakpoint at the address
specified by exp and associate the list of CrossView Pro commands cmds
with the breakpoint.
REFERENCE
Command Reference
Note that the breakpoint only acts on the lowest byte in memory of this
variable.
To set a breakpoint at address 10 hex that will list all global variables,
type:
0x10 bd b {l g}
This breakpoint will be hit if address 10 hex is either read from or written
to.
break, b, bb, bB, bD, bi, bI, bt, bti, btI, bu, bU, Q
1351
Chapter 13
1352
bdis
Function
Disable code breakpoint.
From the Breakpoints menu, select Breakpoints... On Windows toggle
the check box in front of the breakpoint to enable or disable the
breakpoint. On UNIX select the breakpoint and click the Enable or
Disable button.
The command line syntax is:
number bdis
Description
Disable the code breakpoint associated with the given number.
This does not delete the code breakpoint. It disables the code breakpoint
until you enable it again with the bena command.
This command does not work on data breakpoints, only on code
breakpoints
Example
To disable code breakpoint number 3, type:
REFERENCE
3 bdis
break, b, bena, D
Command Reference
bena
Function
Enable code breakpoint.
From the Breakpoints menu, select Breakpoints... On Windows toggle
the check box in front of the breakpoint to enable or disable the
breakpoint. On UNIX select the breakpoint and click the Enable or
Disable button.
The command line syntax is:
number bena
Description
Enable the code breakpoint associated with the given number, which was
previously disabled by the bdis command.
This command does not work on data breakpoints, only on code
breakpoints
Example
To enable code breakpoint number 3, type:
3 bena
break, b, bdis, D
1353
Chapter 13
1354
bI
Function
Set a temporary lowlevel breakpoint at a machine instruction.
From the Breakpoints menu, select Breakpoints... to open the
Breakpoints dialog box. Click the Add > button and select Code
Breakpoint... to open the Add Code Breakpoint dialog. Edit the Break
At... field. In the Advanced dialog enable the Remove when hit check
box.
The command line syntax is:
[addr] bI [cmds]
Description
Set a temporary breakpoint at the machine instruction at address addr, or
the current viewing positions address if addr is not specified; the list of
CrossView Pro commands cmds are executed when the breakpoint is hit.
Make sure that addr is the start address of a machine instruction,
otherwise the results are unpredictable. When the breakpoint is hit
execution is halted. By default the current execution position, function,
line number, and source statement are displayed. Next any commands
associated with the breakpoint are executed. The Q command can be used
to suppress the output from the bI command.
REFERENCE
Example
To set a temporary breakpoint at the current viewing positions address,
type:
bI
To set a temporary breakpoint at address 100 that will print the addresses
of the next five source statements, type:
100 bI {P 5}
break, b, bb, bB, bd, bD, bi, bt, bti, btI, bu, bU, Q
Command Reference
bi
Function
Set a permanent lowlevel breakpoint at a machine instruction.
From the Breakpoints menu, select Breakpoints... to open the
Breakpoints dialog box. Click the Add > button and select Code
Breakpoint... to open the Add Code Breakpoint dialog. Edit the Break
At... field. In the Advanced dialog disable the Remove when hit check
box.
Alternatively, you can place a breakpoint in the intermixed window or
assembly window by double clicking on the desired instruction.
The command line syntax is:
[addr] bi [cmds]
Description
Set a permanent breakpoint at the machine instruction at address addr, or
the current viewing positions address if addr is not specified; the list of
CrossView Pro commands cmds are executed when the breakpoint is hit.
Make sure that addr is the start address of a machine instruction,
otherwise the results are unpredictable. When the breakpoint is hit
execution is halted. By default the current execution position, function,
line number, and source statement are displayed. Next any commands
associated with the breakpoint are executed. The Q command can be used
to suppress the output from the bi command.
Example
To set a breakpoint at the current viewing positions address, type:
bi
To set a breakpoint at address 100 that will print the addresses of the next
five source statements, type:
100 bi {P 5}
break, b, bb, bB, bd, bD, bI, bt, bti, btI, bu, bU, Q
1355
Chapter 13
1356
bINST
Function
Set a temporary instruction count breakpoint.
From the Breakpoints menu, select Breakpoints... to open the
Breakpoints dialog box. Click the Add > button and select Instruction
Breakpoint... to open the Add Instruction Breakpoint dialog. Type a
value in the Instruction count field and enable the Remove when hit
check box in the Advanced dialog.
The command line syntax is:
count bINST [cmds]
Description
Set a temporary breakpoint after the specified count number of machine
instructions have been executed. count can be any expression evaluating
to a number. The list of CrossView Pro commands cmds are executed
when the breakpoint is hit.
When the breakpoint is hit, execution is halted; the breakpoint is then
removed. By default the current execution position, function, line number,
and source statement are displayed. Next any commands associated with
the breakpoint are executed. The Q command can be used to suppress the
output from the bINST command.
REFERENCE
Example
To set a temporary breakpoint after execution of 5 instructions and list all
global variables, type:
5 bINST {l g}
Command Reference
binst
Function
Set a permanent instruction count breakpoint.
From the Breakpoints menu, select Breakpoints... to open the
Breakpoints dialog box. Click the Add > button and select Instruction
Breakpoint... to open the Add Instruction Breakpoint dialog. Type a
value in the Instruction count field and disable the Remove when hit
check box in the Advanced dialog.
The command line syntax is:
count binst [cmds]
Description
Set a permanent breakpoint after the specified count number of machine
instructions have been executed. count can be any expression evaluating
to a number. The list of CrossView Pro commands cmds are executed
when the breakpoint is hit.
When the breakpoint is hit, execution is halted. By default the current
execution position, function, line number, and source statement are
displayed. Next any commands associated with the breakpoint are
executed. The Q command can be used to suppress the output from the
binst command.
Example
To set a permanent breakpoint after execution of 5 instructions and list all
global variables, type:
5 binst {l g}
1357
Chapter 13
1358
break
Function
Universal breakpoint command.
From the Breakpoints menu, select Breakpoints... to
add/remove/enable/disable breakpoints.
The general command line syntax is:
break [type] where [, option]...
Description
This is a universal breakpoint command.
type can be one of: code | data | instructions | cycles | time |
sequence | set | delete | enable | disable. The type can be
abbreviated. So, t|ti|tim|time are the same. When the type field is not
specified the type defaults to code.
Depening on the type field the where field will evaluate to an address,
count, name, breakpoint number or a sequence.
The available options are listed below.
Code breakpoints
Syntax:
REFERENCE
Command Reference
1359
Chapter 13
1360
REFERENCE
enabled[=bool]
Enable or disable a breakpoint.
curr_count=expr
Set current count.
reset_count=expr
Set reset count.
count=expr
Set current and reset count of a breakpoint.
Command Reference
access_type=r | w | rw
Set the access type of a data breakpoint: read (r), write (w) or
read/write (rw).
addr=expr
Set the (start)address for a code or data breakpoint.
value=expr
set the value for a data breakpoint.
method=hardware | software | none
Set the breakpoint method.
probe_point[=bool]
Treat the breakpoint as a probe point. When a probe point is hit, the
associated commands are executed and program execution is
continued. Probe points do not update CrossView Pro windows.
size=expr
Length of a data or code breakpoint (end_addr = begin_addr+size1).
end_addr=expr
The end address of a range is inclusive.
end_value=expr
The end value is inclusive.
value_is_absolute[=bool]
For instructions and cycles breakpoints only, the specified value is an
absolute count, breakpoint will hit when count has value, otherwise
repeat every number of instructions.
commands={ commands }
Set breakpoint commands.
timer_unit=seconds | ticks
The specified timer value is in seconds or ticks.
1361
Chapter 13
1362
bool
1 | 0 | true | false
True/false, case insensitive.
expr
Appropriate CrossView expression.
Example
To set a code breakpoint at an address range, type:
break code code:0x10, end_addr=code:0x1f
To set a cycle count breakpoint and treat the value as an absolute count,
type:
break cycles 1000, value_is_absolute
REFERENCE
Chapter 7, Breakpoints.
Command Reference
bt
Function
Set a task aware code breakpoint.
From the Breakpoints menu, select Breakpoints... to open the
Breakpoints dialog box. Click the Add > button and select Code
Breakpoint... to open the Code Breakpoint dialog. Fill in the Task ID
field.
The command line syntax is:
[line] bt "TaskId" [cmds]
Description
Set a task aware code breakpoint at the specified source line and associate
the list of CrossView Pro commands cmds with the breakpoint. If no line is
given, set the breakpoint at the current viewing position. The TaskId is the
identification of the task as displayed in the Tasks Window or specified by
the l k command.
When the breakpoint is hit, execution is halted. By default the current
execution position, function, line number, and source statement are
displayed. Next, any commands associated with the breakpoint are
executed. The Q command can be used to suppress the output from the
bt command.
Example
To set a breakpoint for task 4 at the current viewing position, type:
bt "4"
To set a breakpoint for task 4 at line 10, which lists all global variables,
type:
10 bt "4" {l g}
break, b, bb, bB, bd, bD, bi, bI, bti, btI, bu, bU, l, Q
1363
Chapter 13
1364
btI
Function
Set a temporary lowlevel task aware breakpoint at a machine instruction.
From the Breakpoints menu, select Breakpoints... to open the
Breakpoints dialog box. Click the Add > button and select Code
Breakpoint... to open the Code Breakpoint dialog. Edit the Break At...
field and fill in the Task ID field. In the Advanced dialog enable the
Remove when hit check box.
The command line syntax is:
[addr] btI "TaskId" [cmds]
Description
Set a temporary task aware breakpoint at the machine instruction at
address addr, or the current viewing positions address if addr is not
specified; the list of CrossView Pro commands cmds are executed when
the breakpoint is hit. The TaskId is the identification of the task as
displayed in the Tasks Window or specified by the l k command.
REFERENCE
To set a temporary breakpoint for task 4 at address 0xF00 and print the
message, type:
0xF00 btI "4" {"breakpoint triggered:
address 0xF00, task 4"}
break, b, bb, bB, bd, bD, bi, bI, bt, bti, bu, bU, l, Q
Command Reference
bti
Function
Set a permanent lowlevel task aware breakpoint at a machine instruction.
From the Breakpoints menu, select Breakpoints... to open the
Breakpoints dialog box. Click the Add > button and select Code
Breakpoint... to open the Code Breakpoint dialog. Edit the Break At...
field and fill in the Task ID field. In the Advanced dialog disable the
Remove when hit check box.
The command line syntax is:
[addr] bti "TaskId" [cmds]
Description
Set a permanent task aware breakpoint at the machine instruction at
address addr, or the current viewing positions address if addr is not
specified; the list of CrossView Pro commands cmds are executed when
the breakpoint is hit. The TaskId is the identification of the task as
displayed in the Tasks Window or specified by the l k command.
Make sure that addr is the start address of a machine instruction,
otherwise the results are unpredictable. When the breakpoint is hit
execution is halted. By default the current execution position, function,
line number, and source statement are displayed. Next any commands
associated with the breakpoint are executed. The Q command can be used
to suppress the output from the bti command.
Example
To set a breakpoint for task 4 at the current viewing positions address,
type:
bti "4"
To set a breakpoint for task 4 at address 0xF00 and print the message,
type:
0xF00 bti "4" {"breakpoint triggered:
address 0xF00, task 4"}
break, b, bb, bB, bd, bD, bi, bI, bt, btI, bu, bU, l, Q
1365
Chapter 13
1366
bTIM
Function
Set a temporary time breakpoint.
From the Breakpoints menu, select Breakpoints... to open the
Breakpoints dialog box. Click the Add > button and select Timer
Breakpoint... to open the Add Timer Breakpoint dialog. Enter a value in
the Time field and enable the Remove when hit check box in the
Advanced dialog.
The command line syntax is:
time bTIM [cmds]
Description
Set a temporary breakpoint after the specified time (in seconds). time can
be any expression evaluating to a number. The list of CrossView Pro
commands cmds are executed when the breakpoint is hit.
When the breakpoint is hit, execution is halted; the breakpoint is then
removed. By default the current execution position, function, line number,
and source statement are displayed. Next any commands associated with
the breakpoint are executed. The Q command can be used to suppress the
output from the bTIM command.
REFERENCE
Example
To set a temporary breakpoint after 0.5 seconds and list all global
variables, type:
0.5 bTIM {l g}
Command Reference
btim
Function
Set a permanent time breakpoint.
From the Breakpoints menu, select Breakpoints... to open the
Breakpoints dialog box. Click the Add > button and select Timer
Breakpoint... to open the Add Timer Breakpoint dialog. Enter a value in
the Time field and disable the Remove when hit check box in the
Advanced dialog.
The command line syntax is:
time btim [cmds]
Description
Set a permanent breakpoint after the specified time (in seconds). time can
be any expression evaluating to a number. The list of CrossView Pro
commands cmds are executed when the breakpoint is hit.
When the breakpoint is hit, execution is halted. By default the current
execution position, function, line number, and source statement are
displayed. Next any commands associated with the breakpoint are
executed. The Q command can be used to suppress the output from the
btim command.
Example
To set a permanent breakpoint after 0.5 seconds and list all global
variables, type:
0.5 bTIM {l g}
1367
Chapter 13
1368
bU
Function
Set a temporary uplevel breakpoint (to finish the function at a specific
stack level).
In the Stack Window, doubleclick on the desired function. Alternately,
you can click on the desired function in the Stack Window and select
Stack Breakpoint | After Call to Function from the Breakpoints menu.
The command line syntax is:
[ stack ] bU [ commands ]
Description
This command sets a temporary uplevel breakpoint immediately after the
call to the function designated by the stack number stack, otherwise the
currently viewed function is used. Associate the list of CrossView Pro
commands commands with the breakpoint.
When the breakpoint is hit execution is halted. By default the current
execution position, function, line number, and source statement are
displayed. Next any commands associated with the breakpoint are
executed. The Q command can be used to suppress the output from the
bU command.
REFERENCE
Breakpoints set in the Stack Window are always temporary, meaning they
will be deleted after the first time you reach them. A breakpoint set in this
manner will not be visible in the Source Window.
This command is not allowed when the target runs in the background.
Example
To set a temporary uplevel breakpoint immediately after the call to the
currently viewed function, type:
bU
Command Reference
After stopping, this command will cause CrossView Pro to print out the
functions local variables and arguments.
break, b, bb, bB, bd, bD, bi, bI, bt, bti, btI, bu, Q
1369
Chapter 13
1370
bu
Function
Set a permanent uplevel breakpoint (to finish the function at a specific
stack level).
Click on the desired function in the Stack Window and select Stack
Breakpoint | After Call to Function from the Breakpoints menu. To
make the stack breakpoint permanent, select Breakpoints... from the
Breakpoints menu, select the desired stack breakpoint and click on the
Edit... button. The Edit Code Breakpoint dialog appears. Click on the
Advanced>> button and disable the Remove when hit check box.
The command line syntax is:
[ stack ] bu [ commands ]
Description
Set a permanent uplevel breakpoint immediately after the call to the
function designated by the stack number stack, otherwise the currently
viewed function is used. Associate the list of CrossView Pro commands
commands with the breakpoint.
REFERENCE
Command Reference
break, b, bb, bB, bd, bD, bi, bI, bt, bti, btI, bU, Q
1371
Chapter 13
1372
bufa
Function
Append the contents of one buffer to another buffer.
The command line syntax is:
bufa target_buffer_name,added_buffer_name[,size_limit]
Description
Add the contents of buffer added_buffer_name to buffer
target_buffer_name. If size_limit is specified, buffer target_buffer_name
will be trimmed down to the specified size (keeping size_limit elements of
the tail of the buffer).
Example
To append the contents of $buffer to buffer $all_data, and keep the
last 1024 elements, type:
bufa $all_data,$buffer,1024
REFERENCE
Command Reference
bufd
Function
Free a used buffer.
The command line syntax is:
bufd buffer_name
Description
Discard the specified buffer (if the target data is not to be used anymore).
Example
To discard buffer $buffer, type:
bufd $buffer
1373
Chapter 13
1374
C
Function
Continue using the current value of the program counter.
In the Source Window, click on the Run/Continue button. You can also
select Run from the Run menu.
The command line syntax is:
[ exp ] C [ line ]
Description
If exp is specified and you are stopped at a breakpoint, then the
breakpoint count is set to this value. If line is specified, a temporary
breakpoint is set at that line number. Note that this temporary breakpoint
will overwrite any existing breakpoint at that line.
The C command can be used in the command lists of breakpoints to
resume execution automatically.
This command is not allowed when the target runs in the background.
Example
To continue execution from the current target program counter, type:
C
REFERENCE
break, bc, g, R, CB
Command Reference
CB
Function
Continue execution in background using the current value of the target
program counter.
The command line syntax is:
[ exp ] CB [ line ]
Description
If exp is specified and you are stopped at a breakpoint, then the
breakpoint count is set to this value. If line is specified, a temporary
breakpoint is set at that line number. Note that this temporary breakpoint
will overwrite any existing breakpoint at that line.
The CB command can be used in the command lists of breakpoints to
resume execution automatically.
This command is not allowed when the target runs in the background.
Not available for all execution environments.
Example
To continue execution from the current target program counter, type:
CB
g, R, C, st, wt
1375
Chapter 13
1376
cd
Function
Disable, turn off, gathering of coverage information.
From the Tools menu, select Coverage if this item was set.
The command line syntax is:
cd
Description
If coverage is supported by your version of CrossView Pro, this command
disables the coverage system. Normally, you should disable coverage if
you are not interested in the coverage results, as this will often improve
the performance of the execution environment.
Example
To disable coverage, type:
cd
REFERENCE
Command Reference
ce
Function
Enable, turn on, gathering of coverage information.
From the Tools menu, select Coverage if this item was not set.
The command line syntax is:
ce
Description
If coverage is supported by your version of CrossView Pro, this command
enables the coverage system. Normally, you should disable coverage if
you are not interested in the coverage results, as this will often improve
the performance of the execution environment.
Example
To enable coverage, type:
ce
1377
Chapter 13
1378
clear
Function
Clear the Command Output Window.
The command line syntax is:
clear
Description
Use this command if you want to clear the output window part of the
Command Window.
Example
To clear the Command Output Window, type:
REFERENCE
clear
Command Reference
covinfo
Function
List coverage information.
From the Tools menu, select Code Coverage..., make your changes and
select the Update button.
The command line syntax is:
covinfo [[all | module_or_function_name][,filename]]
Description
If coverage is supported by your version of CrossView Pro and coverage is
enabled, this command lists the coverage information. Without arguments
(same as all) this command lists the coverage information of all modules
and functions.
Instead of listing the results you can also save the results in a file with
extension .cov.
Normally, you should disable profiling if you are not interested in the
profiling results, as this will often improve the performance of the
execution environment.
Example
To list the coverage information of all modules and functions to the output
window, type:
ce
covinfo
1379
Chapter 13
1380
cproinfo
Function
List cumulative profiling results or add or remove functions from the list of
profiled functions.
From the Tools menu, select Cumulative Profiling Setup..., make your
changes and click the OK button. Select Cumulative Profiling Report...
to see the cumulative profiling report.
The command line syntax is:
cproinfo [all[,filename] | {add | remove } function]
Description
If profiling is supported by your version of CrossView Pro and profiling is
enabled, this command lists the cumulative profiling results. Without
arguments (same as all) this command lists the cumulative profiling
information of all functions.
Instead of listing the results you can also save the results in a file with
extension .cpr.
Normally, you should disable profiling if you are not interested in the
profiling results, as this will often improve the performance of the
execution environment.
REFERENCE
Example
To list the cumulative profiling results of all functions to the output
window, type:
pe
cproinfo
Command Reference
proinfo, pd, pe
1381
Chapter 13
1382
ct
Function
Display a Cexecution trace.
From the View menu, select Trace | Source Level. The Trace Window
displays the most recently executed lines of code every time program
execution is stopped. CrossView Pro automatically updates the Trace
Window each time execution is halted, as long as the window is open.
The command line syntax is:
number ct
Description
Display a Cexecution trace in the Command window, corresponding to
the last number of machine instructions executed. Since the ct command
relies on the emulators trace buffer, the ct command will not be
implemented on some emulators.
For each executed line of code, the Trace Window displays:
The name of the source file
The name of the function
The line number and corresponding source code
REFERENCE
The window shows all the code executed since the the last time the
program halted.
This command is not allowed when the target runs in the background.
Not available for all execution environments.
Example
To display, in the Command window, the last C statements (corresponding
to the last ten machine instructions) executed, type:
10 ct
ct i, ct r
Command Reference
ct i
Function
Display a disassembled trace.
From the View menu, select Trace | Instruction Level. The Trace
Window displays the most recently executed lines of code every time
program execution is stopped. CrossView Pro automatically updates the
Trace Window each time execution is halted, as long as the window is
open.
The command line syntax is:
number ct i
Description
Display a disassembled trace in the Command window, corresponding to
the last number of machine instructions executed.
Since the ct i command relies on the emulators trace buffer, the ct i
command will not be implemented on some emulators (or implemented
differently).
This command is not allowed when the target runs in the background.
Not available for all execution environments.
Example
To display in the Command window the last 20 disassembled instructions
executed, type:
20 ct i
ct, ct r
1383
Chapter 13
1384
ct r
Function
Display a raw trace.
From the View menu, select Trace | Raw. The Trace Window displays the
most recently executed lines of code every time program execution is
stopped. CrossView Pro automatically updates the Trace Window each
time execution is halted, as long as the window is open.
The command line syntax is:
number ct r
Description
Display a raw trace in the Command window, corresponding to the last
number of trace frames. This command merely shows the contents of the
emulators trace buffer.
Since the ct r command relies on the emulators trace buffer, the ct r
command will not be implemented on some emulators.
This command is not allowed when the target runs in the background.
Not available for all execution environments.
Example
REFERENCE
ct, ct i
Command Reference
cxl
Function
Execute a CXL script.
The command line syntax is:
cxl "script"
Description
Execute CXL script script. The filename of the CXL script must be enclosed
in double quotes.
For use with simulation scenarios, you can supply the cxl command to a
cycle count probe point.
Example
To execute CXL script myscript.cxl , type:
cxl "myscript.cxl"
1385
Chapter 13
1386
cxl_reset
Function
Reset variable of one or all CXL scripts.
The command line syntax is:
cxl_reset ["script"]
Description
Reset all variables of the CXL script script that are executed The filename
of the CXL script must be enclosed in double quotes. If you omit the script
argument, CrossView Pro resets all variables of all scripts.
For use with simulation scenarios, you can supply the cxl_reset command
to a cycle count probe point.
Example
To reset all variables that are executed by the CXL script myscript.cxl ,
type:
cxl_reset "myscript.cxl"
REFERENCE
Command Reference
D
Function
Delete all currently defined breakpoints.
From the Breakpoints menu, select Breakpoints... to open the
Breakpoints dialog box. Click on the Remove All button.
The command line syntax is:
D[y]
Description
D deletes all currently defined breakpoints. Dy does not ask for
confirmation.
break, B, d
1387
Chapter 13
1388
d
Function
Delete a specific breakpoint.
To delete a code breakpoint directly from the C source, click on the red
breakpoint toggle next to the corresponding, source line in the Source
Window.
Otherwise, select Breakpoints... from the Breakpoints menu to open the
Breakpoints dialog box. Select the breakpoint you want to remove and
click on the Remove button.
The command line syntax is:
[ number ] d
Description
Delete the breakpoint associated with the given number. If no number is
given, delete the breakpoint at the current line. If there is no breakpoint at
the current line, a B command will be executed to display all breakpoints.
Whenever a breakpoint is deleted the remaining breakpoints are
renumbered starting at 0.
Example
REFERENCE
break, b, bb, bB, bd, bD, bi, bI, bt, bti, btI, bu, bU, B, D
Command Reference
dcmp
Function
Compare a file with the downloaded application.
From the File menu, select Compare Application... Specify an
application file and click on the Compare button.
The command line syntax is:
dcmp [file[,[number_of_hits][,d]]
Description
Compare an application file with the memory contents and display
differing memory addresses or addresses and values. If you have already
loaded an application you can invoke this command without specifying a
file name. You can limit the number of differences by specifying a
number_of_hits. The value 0 means there is no limit on the number of
differences.
This command is not allowed when the target runs in the background.
Example
To compare the currently loaded application, there is no limit on the
number of differences and the contents of differing memory addresses are
not displayed, type:
dcmp
To compare the currently loaded application and stop when the number of
differences equals 10, type:
dcmp ,10
1389
Chapter 13
1390
REFERENCE
dn
Command Reference
di_state
Function
Open, save/restore, close a debug instrument state.
From the Target menu, select Save/Restore Target State...
The command line syntax is:
di_state open state_name
di_state save state_name, number
di_state restore state_name, number
di_state close state_name, delete
Description
Before a state can be saved, restored or closed it must be opend first. To
open a state use the di_state open state_name command. When opened
successfully the name is added to the available state names list.
With the di_state save command you can now save the state of the debug
instrument with the specified state_name and number. With di_state
restore you can restore a previously saved state of the debug instrument
with the specified state_name and number.
Use di_state close to close a state. The delete flag can be 1 to delete the
state or use 0 to keep the state.
This feature is only available when it is supported by the debug
instrument.
Example
To open and save a state, type:
di_state open S1
di_state save S1, 0
1391
Chapter 13
1392
dis
Function
Disassemble a range of memory.
From the View menu, select Source | Disassembly or Source | Source
and Disassembly to open the Disassembly or Source and Disassembly
window respectively.
The command line syntax is:
dis address [, {address | #count} [,i]]
Description
Disassemble a range of memory. The output is interleaved with source
lines when i is specified. You can enter valid expressions as well for
address and count.
Example
To disassemble 4 instructions starting at 3 bytes behind the start address of
the function main., type:
dis main+3,#4
REFERENCE
dis main+3,#initval+1
dump, expression
Command Reference
dn
Function
Download a file.
From the File menu, select Download Application... to download the
image part of the file to the execution environment.
The command line syntax is:
dn [ file ]
Description
Download the image part of the specified file to the execution
environment. If no file is specified, use the file specified when CrossView
Pro was invoked, and from which the symbolic information was read
during startup, or the file specified in either the N command or the Load
Symbolic Debug Info dialog.
Downloading a file only copies an image part into target memory. It will
not cause CrossView Pro to reread symbolic information.
This command is not allowed when the target runs in the background.
Example
To download the current file, type:
dn
I, N
1393
Chapter 13
1394
dump
Function
Dump a range of memory.
From the View menu, select Memory | New to open a Memory Window.
The command line syntax is:
dump address [, [address | #count] [, [style [width ]] [, filename [,a]]]
Description
The dump command can dump memory as hexadecimal data or as C
variables. You can enter valid C expressions as well for address and count.
You can also dump Motorola S records or Intel hex records. Also, you can
specify a filename in which the dump is to be written or appended.
style can be one of:
a c D O U X d o u x E F G e f g n P p R r s t I M
Style I dumps Intel hex and style M specifies Motorola S records output.
See Chapter 6, Accessing Code and Data, and section 3.5, Formatting
Expressions, in Chapter 3, Command Language, for details on each of the
other format styles. The R and r style are only available for targets that
support the fractional type.
REFERENCE
Example
To dump the first byte of the function main., type:
dump main
Command Reference
To dump the resulting value bytes of the address of main binary anded
with 3, type:
dump main+1,#main&3
dis, expression
1395
Chapter 13
1396
e
Function
Establish viewing position
From the File menu, select Open Source... to view a file. In the Source
Window, click on the Find Symbol button to find a function, or select
Find Symbol... from the Edit menu.
In the Stack Window click once on the function to be examined.
The command line syntax is:
e [ file | function ]
stack e
Description
The e option invokes two distinct commands. The first version establishes
the viewing position to be the first line of file, the first executable line of
the function function or the current viewing position if no argument is
given.
The second version establishes the viewing position to be the line at stack
level stack in the stack trace. (See the t command.)
The stack e command is not allowed when the target runs in the
background.
REFERENCE
Command Reference
?, /, ei, L, p, P, t
1397
Chapter 13
1398
eC
Function
Start execution on current CPU and switch to another CPU.
The command line syntax is:
cpu_number eC
Description
Start execution on the current CPU and switch to CPU cpu_number.
This command can only be issued when the currently selected CPU is in
debug mode.
Example
To start execution on the current CPU and select the CPU indicated by
number 1, type:
1 eC
REFERENCE
ec
Command Reference
ec
Function
Select a CPU or show current CPU number.
The command line syntax is:
[cpu_number] ec
Description
The ec command allows you to select a CPU in your current Execution
Environment if your target has multiCPU support.
This command can only be issued when the currently selected CPU is in
debug mode.
Example
To view the current CPU selection, type:
ec
eC
1399
Chapter 13
13100
echo
Function
Display the definition of a macro name without executing the macro.
From the Tools menu, select Macro Definitions... to view the definition
of a macro.
The command line syntax is:
echo text
Description
Perform macro expansion on text without executing. This allows you to
see how a macro is expanded. It is particularly informative when macros
call other macros.
Example
If you type:
echo macro(3)
REFERENCE
Command Reference
ei
Function
Establish viewing position at a specified address.
From the Edit menu, select Find Address...
The command line syntax is:
[addr] ei
Description
The ei command establishes the viewing position to be at the instruction
specified.
This command is useful for viewing some code in the assembly window,
without changing the program counter, since the execution position is not
changed.
Example
To view the current viewing position, type:
ei
?, /, e, L, p, P, t
13101
Chapter 13
13102
et
Function
Select the specified tasks context.
In the Tasks Window click once on the task to be examined.
The command line syntax is:
et "TaskId"
Description
Select the specified tasks context. The TaskId is the identification of the
task as displayed in the Tasks Window or specified by the l k command.
The current execution position, function, line number, and source
statement are displayed. All other windows, except for the Kernel
Windows, are updated accordingly.
Subsequent CrossView Pro commands use the context of the selected task.
For example, the t command shows a stack trace of the selected task.
Example
To select task 4, type:
et "4"
REFERENCE
Command Reference
f
Function
Set default address printing format
The command line syntax is:
f [ " printfstyleformat " ]
Description
Set the default address printing format, using a printf format
specification.
If there is no argument, the format defaults to %x, which prints an address
in hexadecimal.
This command is intended to allow users to see memory addresses in
decimal, octal or a format of their choosing.
Example
To display addresses in octal, type:
f "%o"
expression
13103
Chapter 13
13104
fa
Function
Add a FLASH device.
From the Target menu, select FLASH Setup...
Click Add... to specify a FLASH device.
The command line syntax is:
fa device_name,base_address,chip_width[,nr_of_chips]
Description
Add a flash device to the list of configured flash devices. This command
also checks whether the device address range overlaps with already
configured flash devices. device_name is a unique name for the flash
device. base_address is the start address of the memory range that will be
covered by the flash device. chip_width is the width of the flash device in
bits. number_of_chips is the number of flash devices you want to use in
parallel.
Example
To add flash device AM29F040 with base address 0xFFE00000, chip width
8 and number of chips 2, type:
fa AM29F040,0xFFE00000,8,2
REFERENCE
Command Reference
fc
Function
Check a FLASH device.
From the Target menu, select FLASH Setup...
Click Check ID.
The command line syntax is:
fc device_number
Description
Check the manufacturer and device identifiers of a flash device. Each
device has a unique manufacturer and device identification value. With
this command you can check if the flash device on the target board
matches the device you have selected.
The manufacturer value is 0x01 for AMD devices and 0x1F for Atmel
devices. The device identifier value of the AMD flash device AM29F040 is
0xA4. The fc command first checks the manufacturer identification. If this
succeeds, the device identification is checked. If the retrieved identifiers
do not match, this command issues an error. If the flash device on the
target board can be identified it will report the name of this flash device.
Use the fl command to see a numbered list of flash devices.
Example
To check the manufacturer and device id of flash device number 1, type:
fc 1
13105
Chapter 13
13106
fd
Function
Delete a FLASH device.
From the Target menu, select FLASH Setup...
Select a device and click Remove.
The command line syntax is:
fd device_number
Description
Delete a flash device from the list of configured flash devices.
Use the fl command to see a numbered list of flash devices.
Example
To delete flash device number 0, type:
fd 0
REFERENCE
fa, fc, fl
Command Reference
13107
fl
Function
List FLASH devices.
From the Target menu, select FLASH Setup...
Device name
AM29F040
AT29C010
Address
0xFFE00000
0x2000000
Width
8
8
Chips
2
1
Chapter 13
13108
fp
Function
Get protection status of a FLASH device.
From the Target menu, select FLASH Setup...
Select a device and click Protection > Get status.
The command line syntax is:
fp device_number
Description
Get the protection status of the specified flash device. A flash device that
supports a protection mechanism can be protected or not. Use the fpe or
fpd command to enable or disable the protection.
Use the fl command to see a numbered list of flash devices.
Example
To get the protection status of flash device number 0, type:
fp 0
REFERENCE
Command Reference
fpd
Function
Unprotect a FLASH device.
From the Target menu, select FLASH Setup...
Select a device and click Protect > Disable.
The command line syntax is:
fpd device_number
Description
A flash device that supports a protection mechanism can be protected or
not. With this command you can disable (clear) the protection.
Use the fl command to see a numbered list of flash devices.
Example
To unprotect flash device number 0, type:
fpd 0
13109
Chapter 13
13110
fpe
Function
Enable protection of a FLASH device.
From the Target menu, select FLASH Setup...
Select a device and click Protection > Enable.
The command line syntax is:
fpe device_number
Description
A flash device that supports a protection mechanism can be protected or
not. With this command you can enable (set) the protection.
Use the fl command to see a numbered list of flash devices.
Example
To protect flash device number 0, type:
fpe 0
REFERENCE
Command Reference
FSS
Function
File System Simulation redirection.
The command line syntax is:
FSS { < | > }{&stream | "file"}
Description
Redirect a File System Simulation stream to a file or another stream.
Redirection to a file can be needed when a stream is only mapped to a
window and you want it to be mapped to a file also.
Example
To redirect the output of stream 2 to stream 1, type:
FSS 2>&1
13111
Chapter 13
13112
FSS_stdio_close
Function
Close a stream previously opened by FSS_stdio_open.
The command line syntax is:
FSS_stdio_close streamnumber
Description
Close the stream indicated by streamnumber.
Example
To close stream 1, type:
FSS_stdio_close 1
REFERENCE
FSS_stdio_open.
Section 10.3, File System Simulation in Chapter I/O Simulation.
Command Reference
13113
FSS_stdio_open
Function
Redirect the output of a stream to a file.
The command line syntax is:
FSS_stdio_open filename,rwdirection,streamnumber
Description
Redirect the stream indicated by streamnumber to the file filename.
rwdirection can be an r for readonly, w for writable, or rw for
read/write.
Example
To redirect stream 1 (output, so w for writable) to the file myfile.out,
type:
FSS_stdio_open
myfile.out,w,1
FSS_stdio_close.
Section 10.3, File System Simulation in Chapter I/O Simulation.
Chapter 13
13114
fw
Function
Specify workspace address of FLASH programming monitor.
From the Target menu, select FLASH Setup...
Specify the Flash workspace address.
The command line syntax is:
fw [address]
Description
You can specify to CrossView Pro to download a FLASH programming
monitor to the target to perform the actual flashing. With the fw command
you specify the data workspace address used by the FLASH programming
monitor. This address determines the data address only and the code
address has a fixed location.
The flash workspace has a size of 0x1100 bytes and is used for interaction
between CrossView Pro and the flash monitor.
Without any address the fw command shows the current flash workspace
address value.
Note that the address you specify must not be in the memory range of the
FLASH devices.
REFERENCE
Example
To specify the load address of the data used by the flash programming
monitor on address 0x10000, type:
fw 0x100000
fa, fc, fl
Command Reference
g
Function
Change the program counter to a new execution position.
Click on a source line and select Jump to Cursor from the Run menu.
The command line syntax is:
g line
Description
This command changes the program counter so that line becomes the
current execution position. Line must be a line in the current function.
This command changes only the program counter. It does not cause the
target to begin execution.
Exercise caution when changing the execution position. Oftentimes, each
line of C source code is compiled into several machine language
instructions. Moving the program counter to a new address in the middle
of a series of related assembly instructions is sometimes risky. Moreover,
even though you change the program counter, registers and variables may
not have the expected values if parts of the code are bypassed.
This command is not allowed when the target runs in the background.
Example
To change the program counter so that the next instruction to be executed
corresponds to line 127, type:
g 127
C, gi, R
13115
Chapter 13
13116
gi
Function
Change the program counter to a new execution position.
Click on a source line and select Jump to Cursor from the Run menu.
The command line syntax is:
address gi
Description
This command changes the program counter so that address becomes the
current execution position.
This command changes only the program counter. It does not cause the
target to begin execution.
Exercise caution when changing the execution position. The Jump to
Cursor menu item is not available in the source lines window mode to
prevent problems by skipping pieces of C code which are required to be
executed. Moving the program counter to a new address in the middle of
a series of related assembly instructions is sometimes risky. Moreover, even
though you change the program counter, registers and variables may not
have the expected values if parts of the code are bypassed.
This command is not allowed when the target runs in the background.
REFERENCE
Example
To change the program counter so that the next instruction to be executed
corresponds to address 0x0800, type:
0x0800 gi
C, g, R
Command Reference
graph
Function
Create Data Analysis window and execute CXL script.
The command line syntax is:
graph "window","script"[,arg]...
Description
Create Data Analysis window window and execute CXL script script. The
display list produced by the script is shown in the specified window.
Arguments arg are passed as global variables to the script. Each argument
is treated as an expression. Arguments starting with a "$" refer to an
acquisition buffer. In all other cases arg is evaluated as an expression and
will be casted to type double.
If for example register $R1 should be passed as argument to the script you
must write "0+$R1" to avoid that $R1 is recognized as an acquisition
buffer.
Example
To transform the contents of buffer $buffer to displayable data in
window demo using CXL script x_t.cxl, type:
graph "demo","x_t.cxl",$buffer,0,1
13117
Chapter 13
13118
graph_add_update
Function
Add a command to the sequence of update commands.
For the supplied scripts only. From the Settings menu, select Data
Analysis Window Setup... Enter a new window name and click New.
Click Configure... to open the Data Analysis Window Setup dialog.
The command line syntax is:
graph_add_update "window",command
Description
Set the sequence of update commands for Data Analysis window window
manually. These update commands are executed when the Update button
on the Data Analysis window is pressed or when the update command is
issued.
Prior to adding update commands, you have to remove all update
commands with the graph_clear_updates command.
Example
REFERENCE
graph_clear_updates, update.
Section 11.5, Data Analysis, in Chapter Special Features.
Command Reference
graph_clear_updates
Function
Clear the sequence of update commands.
The command line syntax is:
graph_clear_updates "window"
Description
Clear the sequence of update commands for Data Analysis window
window. This is needed prior to adding new update commands with the
graph_add_update command.
Example
To retrieve data and show it in window demo, type:
graph_clear_updates "demo"
graph_add_update "demo",memget data[$i],100,$buffer
graph_add_update "demo",graphm "demo","show_x_t.cxl"
graph_add_update "demo",graph "demo","x_t.cxl",$buffer,0,1
update "demo"
graph_add_update, update.
Section 11.5, Data Analysis, in Chapter Special Features.
13119
Chapter 13
13120
graph_close
Function
Close a Data Analysis window.
The command line syntax is:
graph_close "window"
Description
With the graph_close command you can close the named window.
Example
To close window demo, type:
graph_close "demo"
REFERENCE
graph, graphm.
Section 11.5, Data Analysis, in Chapter Special Features.
Command Reference
graph_debug
Function
Debug Data Analysis graph window.
The command line syntax is:
graph_debug expression
Description
If expression evaluates to a nonzero value, this value is an ORed value of
two flags:
1 (bit 0) the "graphical data window debugging mode" will be
enabled, showing all communication between the scripts and the
windows in the command window. This can be useful when
developing scripts.
2 (bit 1) When errors occur during script processing, these errors
are logged to the command window. The total error count (per
script) is now shown in a popup window rather than logged in the
command window. The errors themselves remain logged in the
command window.
Other bits (when value & 3 equals zero, for example 4) are ignored and
treated like zero. No parameters result in value 1. A value of zero turns off
all debugging.
graph, graphm, graphmn.
Section 11.5, Data Analysis, in Chapter Special Features.
13121
Chapter 13
13122
graphm
Function
Set Data Analysis window display mode.
The command line syntax is:
graphm "window","script"[,arg]...
Description
The graphm command sets the representation script for the specified
window. Depending on the script, the arguments may vary.
Several scripts are supplied with the product that you can use with the
graphm command. See section Supplied Data Analysis Window Scripts in
Chapter Special Features for more information.
Example
To set the display mode for window demo using CXL script
show_x_t.cxl and show "demo" in the title bar of the window, type:
graphm "demo","show_x_t.cxl"
REFERENCE
Command Reference
graphmn
Function
Set Data Analysis window display mode.
The command line syntax is:
graphmn "window","script"[,arg]...
Description
The graphmn command works similar to the graphm command, but it
does not update the graph window. This can be useful where a graph
and a graphm command are followed by each other, preventing the
redrawing of the same graphics twice.
Example
To set the display mode for window demo using CXL script
show_x_t.cxl and show "demo" in the title bar of the window, type:
graphmn "demo","show_x_t.cxl"
13123
Chapter 13
13124
graphp
Function
Position Data Analysis window on the screen.
The command line syntax is:
graphp "window",left_top_x,left_top_y,width,height
Description
With the graphp command you can position the named window at the
specified screen coordinates.
Example
To put window demo at position (0,0) on the screen with a size of
100x100, type:
graphp "demo",0,0,100,100
REFERENCE
graph, graphm.
Section 11.5, Data Analysis, in Chapter Special Features.
Command Reference
gus
Function
Suppress or reactivate window updating.
The command line syntax is:
gus {on | off}
Description
With gus on the GUI updating suppress feature is enabled. This means
that the graphical windows are no longer updated. To reactivate the
window updating use the gus off command.
Example
To suppress the updating of CrossView windows, type:
gus on
13125
Chapter 13
13126
I
Function
Print out information about the state of CrossView Pro.
The command line syntax is:
I
Description
Print out information about the state of CrossView Pro, including: the
CrossView Pro version number, the execution environment version
information, the name of the program being debugged (and the number of
its files and functions), the state of the assertion mechanism, the state of
output recording, the state of command recording, the state of target
communication recording and the state of search case sensitivity.
The state of the assertion mechanism tells how many assertions have been
defined and whether the overall assertion mechanism is active or
suspended; it does not tell whether any individual assertions are active or
suspended.
REFERENCE
Command Reference
if
Function
Conditional command execution.
The command line syntax is:
if ( expression ) { cmds } [ { cmds } ]
Description
If expression evaluates to a nonzero value, execute the first group of
commands. Otherwise, the second group of commands, if present, will be
executed. This command is nestable.
Leave a space between if and exp. if(a==b) parses as a function call.
The if statement is used primarily within breakpoint command lists.
Example
If you type:
if (a=b) {5t} {C}
CrossView Pro will trace back five levels on the stack if a is equal to b.
Otherwise, CrossView Pro will continue.
The command line:
if (wait>1000) {wait;l r}
will print the value of wait and list all registers if the value of wait
exceeds 1000.
13127
Chapter 13
13128
ios_close
Function
Close a File I/O stream.
From the Settings menu, select I/O Simulation Setup... Select a stream in
the Connections tab and click on the Delete button.
The command line syntax is:
ios_close {stream | "file"}
Description
You can specify either a filename or a stream number.
Example
To close stream number 1, type:
ios_close 1
To close file data.txt and close 1 stream that is mapped to this file, type:
ios_close "data.txt"
Only 1 stream is closed, even if multiple streams are attached to this file.
The command displays which stream number has been closed.
REFERENCE
ios_open, ios_wopen
Command Reference
13129
ios_open
Function
Open a File I/O stream.
From the Settings menu, select I/O Simulation Setup... Open the File
I/O tab and click on the Configure... button. Attach a stream (with a file)
to a probe point.
The command line syntax is:
ios_open ["file"[,[mode][,[r][,$xvw_variable]]]]
Description
This command is useful to connect a file to a stream at the command line
of CrossView. CrossView returns a stream number which is opened with
this command in the $xvw_variable and displays it too.
The filename is optional. When the filename is omitted and such a newly
opened stream receives data and is not shown in any opened terminal
window a new window will be opened that interacts with this stream.
Furthermore the mode can be specified when a I/O stream is opened:
read, write or append:
r+
Truncate file to zero length or create file for writing. The file
pointer is positioned at the beginning of the file.
w+
Open file for reading and writing. The file is created if it does
not exist, otherwise it is truncated. The file pointer is
positioned at the beginning of the file.
Open file for writing. The file is created if it does not exist.
The file pointer is positioned at the end of the file.
a+
Open file for reading and writing. The file is created if it does
not exist. The file pointer is positioned at the end of the file.
Chapter 13
13130
All modes can have a b appended, indicating binary access. The b can
be positioned before or after the +. This mode affects the ios_read and
ios_write commands. The ios_read command writes host data to target
memory. In binary mode MAUs (minimum addressable units) are filled
with a number of bytes that fits in 1 MAU. For example, a MAU with a size
of 24 bits will be filled with 24/8= 3 bytes. Otherwise the least significant 8
bits of a MAU will be filled with 1 byte and the highest 16 bits will be
filled with zeros. The ios_write command writes target memory to the
host. In binary mode for each MAU the number of bytes to be written
equals the number of bytes that fits in 1 MAU. For a MAU size of 24 bits
CrossView Pro will write 3 bytes to the host. If the mode is not binary
CrossView Pro will write the least significant 8 bits (1 byte) of each MAU
to the host.
CrossView Pro opens all files by default in w+ mode, overwriting the
opened file if it already exists.
The optional r specifies to rewind to the beginning of the file when the
end of file is reached.
$xvw_variable is a user special variable in CrossView Pro which holds the
value of the newly opened stream number. This variable can also be used
in the read and write commands to read from or write to the file.
Example
To open a new File I/O stream, type:
ios_open
REFERENCE
To open file data.txt and assign the new stream number to $ios_nr,
type:
ios_open "data.txt",,,$ios_nr
To open file data.txt in readonly mode and wrap around when end of
file is reached, type:
ios_open "data.txt",r,r,$ios_nr
Command Reference
ios_read
Function
Read binary data from an I/O stream.
The command line syntax is:
ios_read {stream | "file"},address,number_of_maus[,x]
Description
You can specify a File I/O stream number or a filename. address is the
memory location where the read data will be stored. number_of_maus is
the length of the data to be read in MAUs (minimum addressable units).
The optional ,x specifies that the read data should be interpreted as
hexadecimal values. The hexadecimal format is a whitespace separated
(no TAB) hexadecimal string without the 0x prefix.
If the stream was opened in binary mode (see ios_open), MAUs are filled
with a number of bytes that fits in 1 MAU. For example, a MAU with a size
of 24 bits will be filled with 24/8= 3 bytes. Otherwise the least significant 8
bits of a MAU will be filled with 1 byte and the highest 16 bits will be
filled with zeros.
Example
To read 16 minimum addressable units from stream 4, type:
ios_read 4,0x100,16
13131
Chapter 13
13132
ios_readf
Function
Formatted read from an I/O stream (scanf). Store the data at the location
defined by the expression.
The command line syntax is:
ios_readf {stream | "file"},"format",expression
Description
You can specify a File I/O stream number or a filename. format is a format
specifier as used in the scanf C library function. expression can be any
CrossView Pro expression.
Valid format specifiers are:
%d
%x
%c
%s
%f
Decimal.
Hexadecimal (without 0x prefix).
Char.
String.
Float.
Example
To read a hex value from stream 4 and store it the value of program
variable ch1, type:
REFERENCE
ios_readf 4,"%x",&ch1
To read a hex value from stream 4 and store it in register R2, type:
ios_readf 4,"%x",$R2
To read two hex values from stream $istrm and assign them to program
variable ch1 and target register R2, type:
ios_readf $istrm,"%x %x",&ch1,$R2
Command Reference
ios_rewind
Function
Move File I/O file pointer to the beginning of the file.
From the Settings menu, select I/O Simulation Setup... Open the File
I/O tab and click on the Configure... button. Attach a stream to a probe
point. In the New Stream dialog enable the Wrap around check box.
The command line syntax is:
ios_rewind {stream | "file"}
Description
With ios_rewind the file pointer is moved to the beginning of the file.
Example
To move the file pointer of the file connected to stream 4 to the beginning
of the file, type:
ios_rewind 4
To move the file pointer of the file connected to stream $istrm to the
beginning of the file, type:
ios_rewind $istrm
13133
Chapter 13
13134
ios_wopen
Function
Open a File I/O stream and map the stream to a terminal window.
From the Settings menu, select I/O Simulation Setup... Open the File
I/O tab and click on the Configure... button. Attach a stream (which is
only connected to a terminal window) to a probe point.
The command line syntax is:
ios_wopen [["terminal_window"][,$xvw_variable]]
Description
When the name matches the name of an existing terminal window the
newly opened stream is mapped to this terminal window.
$xvw_variable is a user special variable in CrossView Pro which holds the
value of the newly opened stream number. This variable can also be used
in the read and write commands to read from or write to the
terminal_window.
You can close the opened stream with ios_close.
Example
REFERENCE
To create a new terminal window and map the newly created stream to it.
The name of the new terminal window will be like #x., type:
ios_wopen ,$ios_nr
To open a new stream and if there is a terminal window with the name
"My terminal" map stream to it, otherwise create a new terminal and name
it "My terminal"., type:
ios_wopen "My terminal",$ios_nr
ios_open, ios_close
Command Reference
ios_write
Function
Write binary data to an I/O stream.
The command line syntax is:
ios_write {stream | "file"},address,number_of_maus[,x]
Description
You can specify a File I/O stream number or a filename. address is the
memory location where the data will be read from. number_of_maus is
the length of the data to be written in MAUs (minimum addressable units).
The optional ,x specifies that the data should be interpreted as
hexadecimal values. The hexadecimal format is a whitespace separated
(no TAB) hexadecimal string without the 0x prefix.
If the stream was opened in binary mode (see ios_open), for each MAU
the number of bytes to be written equals the number of bytes that fits in 1
MAU. For a MAU size of 24 bits CrossView Pro will write 3 bytes to the
host. If the mode is not binary CrossView Pro will write the least
significant 8 bits (1 byte) of each MAU to the host.
Example
To write 16 minimum addressable units to stream 4, type:
ios_write 4,0x100,16
13135
Chapter 13
13136
ios_writef
Function
Formatted write to an I/O stream (printf).. The data is obtained from the C
expression, for example a variable.
The command line syntax is:
ios_writef {stream | "file"},"format",expression
Description
You can specify a File I/O stream number or a filename. format is a format
specifier as used in the printf C library function. expression can be any
CrossView Pro expression.
Valid format specifiers are:
%d
%x
%c
%s
%f
Decimal.
Hexadecimal (without 0x prefix).
Char.
String.
Float.
Example
To write the hex value of program variable ch1 to stream 4, type:
ios_writef 4,"%x",ch1
REFERENCE
To write the hex values of program variable ch1 and target register R2 to
stream 4, type:
ios_writef 4,"%x %x",&ch1,$R2
Command Reference
L
Function
Synchronize the viewing and execution positions.
To synchronize the positions manually, click on the Find PC button in the
Source Window or select Find PC from the Edit menu.
The command line syntax is:
L
Description
This command synchronizes the viewing and execution positions. It also
lists the current file, function and line number of the current program
counter. The viewing position is always moved to match the execution
position.
The L command is synonymous with a 0 e command and does not affect
the execution position.
This command is not allowed when the target runs in the background.
Example
To synchronize the viewing and execution positions, then list current file,
function, and line number, type:
L
e, l
13137
Chapter 13
13138
l
Function
List.
In general, the dialog box in which you define a feature also contains a
list.
The command line syntax is:
l { a| b| d| f| g| k| l| L| m| p| r| s| S} [string]
l [func]
l stack
Description
In the first case above, list one of the following: assertions, breakpoints,
directories, files, globals, kernel state data, labels (on module scope), all
Labels, memory map (of application code sections), procedures, registers,
special variables, Symbol tables. If string is present, then list only those
items that start with string.
In the second case, list the values of all parameters and locals of the
function func. Without a function, this command lists all parameters and
locals of the current function in view.
REFERENCE
In the third case, list all parameters and locals of the function at depth
stack.
The l f and l m commands also show the address of the modules first
procedure. The l m command is identical to l f, list files, but the list of
files is sorted on ascending segment addresses. func must be a function
on the stack or the current function.
Command Reference
13139
Display tasks.
Display mailboxes.
Display queues.
Display pipes.
Display semaphores.
Display events.
Display HISRs (Highlevel Interrupt Service Routines)
Display signals.
Display timers.
Display partition memory.
Display dynamic memory.
Display resources.
Display miscellaneous information.
Example
To list defined assertions and the state of the assertion mechanism, type:
l a
Data is displayed using the normal (/n) format. To list all the parameters
and locals of the function fcn, type:
l fcn
To list queue information for the current tasks (only if your configuration
supports it), type:
l k q
L, et
Chapter 13
13140
load
Function
Load a programs symbol file and download the image part.
From the File menu, select Load Symbolic Debug Info... This dialog
allows you to specify the file.
The command syntax is:
load [filename]
Description
This command performs the N and dn commands sucessively.
Downloading a file only copies the image part into target memory (dn). It
will not cause CrossView Pro to reread symbolic information (N). The
load command does both.
This command is not allowed when the target runs in the background.
Example
To load the symbol table of file demo.abs in CrossView Pro and
download the image part, type:
load demo.abs
REFERENCE
dn, N
Command Reference
M
Function
List the data currently being monitored.
Refer to the Data Window. Each time the program stops, the debugger
evaluates all monitored expressions and displays the results in the Data
Window.
The command line syntax is:
M
Description
List all C expressions being monitored by CrossView Pro. The listing
associates a unique number with each expression. This number is used to
specify the deletion of monitored data.
m
13141
Chapter 13
13142
m
Function
Monitor (watch) an expression. (Also delete a monitor.)
From the Source Window, doubleclick on an expression. A new monitor
is created in the Data Window or the Expression Evaluation dialog is
opened if the Bypass Expression Evaluation Dialog check box in the
Data Display Setup dialog is not set. If the latter is the case, click on the
Add Watch button to create a new monitor in the Data Window. To
remove an existing monitor, select the monitor in the Data Window and
click on the Delete Selected Data Item button.
The command syntax is:
m exp
number m d
Description
The m command has two distinct functions. The first monitors the given
expression. The second deletes the monitoring of the expression specified
by number.
REFERENCE
Data monitoring takes place whenever the program stops execution, that
is, for a breakpoint, assertion, single step, or user interrupt (ctrlC). In
window mode, the values of all currently monitored data are displayed in
the Data window. Each piece of monitored data has a unique identifying
number that is used when deleting it.
Example
To monitor the value of the variable myvar, type:
m myvar
Command Reference
M, b, a, s, R, C
13143
Chapter 13
13144
mcp
Function
Memory copy.
From the Memory Window, click on the Copy Memory button to open
the Copy Memory dialog. Enter the start address and the end address
(inclusive) of the memory region you want to copy. Enter the destination
address and click on the OK button.
The command syntax is:
addr_start mcp addr_end, addr_dest
Description
The mcp command copies a block of target memory starting at address
addr_start to destination address addr_dest. The size of the memory block
is defined as: addr_end addr_start + 1. The data item located at address
addr_end is included in the copy.
If your target supports multiple memory spaces then it is legal to copy data
between different memory spaces. Of course addr_start and addr_end
must be located in the same memory space. This command does not have
any effect on code breakpoints.
Example
REFERENCE
mF, mf
Command Reference
memget
Function
Retrieve data from the target into a buffer.
The command line syntax is:
memget expr,count,buffer_name
Description
The memget command is used to retrieve data from the target system and
to store the data in the acquisition buffer buffer_name. Data in the
acquisition buffer is of type double. CrossView Pro will automatically
handle data conversion based upon the type of expression expr.
Expression expr contains the iterator "$i" which initially starts at 0 and
increments to count1.
Notation convention:
"expr<$i{n}>" means "expr in which all instances of "$i" are substituted
by "n".
To correctly retrieve the data from the target CrossView Pro needs to know
the start address, the size of the data elements, and the number of items to
fetch. The number of items to fetch from the target is specified by count.
The following algorithm is used to fill the acquisition buffer:
addr0
= (char *) &expr<$i{0}>
addr1
= (char *) &expr<$i{1}>
delta
= addr1 addr0
elem_size = sizeof(expr<$i{0}>)
type
= Ctype(expr<$i{0}>)
for (i = 0; i < count; i++)
{
value = read elem_size MAUs from address addr0 + (i * delta)
buffer[i] = convert_to_double(type, value);
}
13145
Chapter 13
13146
Example
1. C structure access.
struct
{
double re,
im;
int f;
} data[100];
2. Memory access.
To retrieve 18 integer values from memory starting at address 0x100 and
store these in acquisition buffer $buffer:
memget ((int[]) 0x100)[$i],3*6,$buffer
REFERENCE
Command Reference
mF
Function
Memory single fill.
From the Memory Window, click on the Fill Single Memory Address
button to open the Single Fill Memory dialog. Enter the start address the
memory region you want to fill. Enter one or more expressions separated
by commas and click on the OK button.
The command syntax is:
addr mF expr [,expr]...
Description
The mF command fills target memory with data. The value defined by exp
is written to address addr in target memory. Multiple exps separated by
commas may be entered. Each exp is written to a subsequent MAU.
If your target supports multiple memory spaces then addr may refer to any
memory space.
If the sizeof a given exp occupies more than one MAU, only the least
significant MAU will be written to memory. This command does not have
any effect on code breakpoints.
Example
To store value 0x12 at memory location 0x400 and value 0xAB at location
0x401, type:
0x400 mF 0x12, 0xAB
mcp, mf
13147
Chapter 13
13148
mf
Function
Memory fill, repeating the specified pattern until the specified region is
filled.
From the Memory Window, click on the Fill Memory button to open the
Memory Fill dialog. Enter the start address and end address (inclusive) of
the memory region you want to fill. Enter one or more expressions
separated by commas and click on the OK button.
The command syntax is:
addr_start mf addr_end, expr [,expr]...
Description
The mf command fills a block of target memory with a pattern. The
memory region starting at address addr_start and ending at address
addr_end is filled with the pattern defined by exp [,exp]. Multiple exps
separated by commas may be entered. Each exp is written to a subsequent
MAU.
The specified pattern is repeated until the end address of memory region
is reached.
REFERENCE
If your target supports multiple memory spaces then addr may refer to any
memory space.
If the sizeof a given exp occupies more than one MAU, only the least
significant MAU will be written to memory. This command does not have
any effect on code breakpoints.
Example
To store values 0x01 and 0x02 at succeeding memory locations in the
range 0x400 to 0x404, type:
0x400 mf 0x404, 0x01, 0x02
Command Reference
13149
mcp, mf
Chapter 13
13150
ms
Function
Memory search.
From the Memory Window, click on the Find Memory button to open the
Search Memory dialog. Enter the start address and end address (inclusive)
of the memory region you want to search. Enter one or more search
patterns separated by commas and click on the OK button.
The command syntax is:
addr_start ms addr_end, expr [,expr]...
Description
The ms command searches for a pattern within a block of target memory.
The memory region starting at address addr_start and ending at address
addr_end (inclusive) is searched for the pattern defined by exp [,exp].
Multiple exps separated by commas may be entered. Each exp corresponds
to a subsequent MAU.
If your target supports multiple memory spaces then addr may refer to any
memory space.
This command does not have any effect on code breakpoints.
REFERENCE
Example
Suppose the memory range 0x400 to 0x4ff was filled using the following
commands:
0x400 mf 0x4ff, 0
0x400 mf 0x404, 1, 2
To search for the values 0x01 and 0x02 at memory locations in the range
0x400 to 0x4ff, type:
0x400 ms 0x4ff, 0x01, 0x02
Command Reference
mcp, mF, mf
13151
Chapter 13
13152
N
Function
Load a programs symbol file.
From the File menu, select Load Symbolic Debug Info... This menu
item allows you to specify the file.
The command syntax is:
N [[path]filename[.abs]]
Description
Load the symbol table of the specified file in CrossView Pro. If no filename
is given, the file being debugged is reloaded. In this case only the
breakpoints set by the user are removed. Monitors, I/O simulation streams,
assertions and CrossView Pro local variables remain active.
If a new file (different filename) is loaded, all breakpoints, monitors, I/O
simulation streams, assertions and CrossView Pro local variables are
removed.
REFERENCE
dn
Command Reference
n
Function
Set address bias
From the File menu, select Load Symbolic Debug Info... In the Load
Symbolic Debug Info dialog you can edit the Code address bias field.
The command syntax is:
n [ addr ]
Description
Set address bias of overlay files to addr. If no address is given, then
display current bias.
If a program is to be loaded at a different address than that indicated in
the linked and located (absolute object) file, then the address information
in the debuggers symbol file will be incomplete, since it does not know
where the program is actually going to be loaded. This command will
normalize the addresses by adding the bias to every address.
Example
To add a bias of 1000 to every address in the code, type:
n 1000
13153
Chapter 13
13154
nC
Function
Set the viewing position to the next covered block of statements.
Use the scroll bar and click on the desired line.
The command line syntax is:
nC
Description
If code coverage is supported by your version of CrossView Pro, this
command enables you to skip to the next block of statements that have
been executed while the program was running on the target.
Example
To move the cursor to the next executed block, type:
nC
REFERENCE
nU, pC, pU
Command Reference
nU
Function
Set the viewing position to the next not covered block of statements.
Use the scroll bar and click on the desired line.
The command line syntax is:
nU
Description
If code coverage is supported by your version of CrossView Pro, this
command enables you to skip to the next block of statements that have
not been executed while the program was running on the target.
Example
To move the cursor to the next not executed block, type:
nU
nC, pC, pU
13155
Chapter 13
13156
o
Function
Enter emulator mode.
From the View menu, select Command | Emulator. If you know the
emulatorlevel command language, you can communicate directly with the
emulator from this window.
The command line syntax is:
o string
Description
Pass string to emulator and show the emulator response.
The o command lets you communicate with the emulator directly via
emulator commands.
Do not issue oneshot transparency emulator commands that result in
large output (or otherwise require intervention other than a carriage return
to terminate output). Instead, enter transparency mode first, then issue the
command.
Example
To send the string map to the emulator, type:
REFERENCE
o map
Command Reference
opt
Function
Set or display specific options.
Option values can be changed in various dialogs and menus.
The command line syntax is:
opt [ option_name [= option_value]]
Description
If no arguments are passed, all options with their current value are listed.
By specifying an options name, the current value of that option is
displayed. By specifying an option name followed by a valid value, the
option is set to that new value.
The options are a subset of CrossViews socalled "special variables". See
Chapter 3, Command Language, for a list of all special variables.
Example
To display all options, type:
opt
13157
Chapter 13
13158
P
Function
Print source lines, including machine addresses.
In the Source Window, the machine address of the line at the current
viewing position is displayed in the address field in the upper left corner.
The command line syntax is:
[ line ] P [ exp ]
Description
Print exp lines of source starting at line line, including machine addresses.
If exp is omitted, print one line. If line is omitted, start from the current
viewing position.
Example
To print source lines 4, 5, 6, 7 and 8 (displaying machine addresses) of the
current source file, type:
4 P 5
REFERENCE
Command Reference
p
Function
Print source lines.
C source is displayed in the Source Window.
The command line syntax is:
[ line ] p [ exp ]
Description
Print exp lines of source starting at line line. If exp is omitted, print one
line. If line is omitted, start from the current viewing position.
Example
To print source lines 4, 5, 6, 7 and 8 of the current source file, type:
4 p 5
13159
Chapter 13
13160
pC
Function
Set the viewing position to the previous covered block of statements.
Use the scroll bar and click on the desired line.
The command line syntax is:
pC
Description
If code coverage is supported by your version of CrossView Pro, this
command enables you to skip to the previous block of statements that
have been executed while the program was running on the target.
Example
To move the cursor to the previous executed block, type:
pC
REFERENCE
nC, nU, pU
Command Reference
pd
Function
Disable, turn off, profiling.
From the Tools menu, select Profiling if this item was set.
The command line syntax is:
pd
Description
If profiling is supported by your version of CrossView Pro, this command
disables the profiling system. Normally, you should disable profiling if you
are not interested in the profiling results, as this will often improve the
performance of the execution environment.
Example
To disable profiling, type:
pd
pe
13161
Chapter 13
13162
pe
Function
Enable, turn on, profiling.
From the Tools menu, select Profiling if this item was not set.
The command line syntax is:
pe
Description
If profiling is supported by your version of CrossView Pro, this command
enables the profiling system. Normally, you should disable profiling if you
are not interested in the profiling results, as this will often improve the
performance of the execution environment.
Example
To enable profiling, type:
pe
REFERENCE
pd
Command Reference
proinfo
Function
List profiling results.
From the Tools menu, select Profiling Report...
Make your changes and select the Update button.
The command line syntax is:
proinfo [[all | module_or_function_name][,filename]]
Description
If profiling is supported by your version of CrossView Pro and profiling is
enabled, this command lists the profiling results. Without arguments (same
as all) this command lists the profiling information of all modules and
function.
Instead of listing the results you can also save the results in a file with
extension .pro.
Normally, you should disable profiling if you are not interested in the
profiling results, as this will often improve the performance of the
execution environment.
Example
To list the profiling results of all modules and functions to the output
window, type:
pe
proinfo
cproinfo, pd, pe
13163
Chapter 13
13164
prst
Function
Reset the application being debugged to initial conditions. That is, set the
program counter to the start address of the application.
From the Run menu, select Reset Application.
The command line syntax is:
prst
Description
The program counter is set to the start address of the application being
debugged. This command does NOT perform a hardware reset of the
target system. That is, no registers are modified except for the program
counter.
This command is not allowed when the target runs in the background.
REFERENCE
R, rst
Command Reference
pU
Function
Set the viewing position to the previous not covered block of statements.
Use the scroll bar and click on the desired line.
The command line syntax is:
pU
Description
If code coverage is supported by your version of CrossView Pro, this
command enables you to skip to the previous block of statements that
have not been executed while the program was running on the target.
Example
To move the cursor to the previous not executed block, type:
pU
nC, nU, pC
13165
Chapter 13
13166
Q
Function
Quiet breakpoint reporting.
The command line syntax is:
Q
Description
If this appears as the first command in a breakpoints command list, the
debugger does not make the usual announcement of:
function: line number: source file
when the breakpoint is hit.
The purpose of this command is to allow quiet breakpoint reporting. For
example, to check the value of a variable without cluttering the screen
with text.
Example
If you type the following:
21 b {Q; var1}
REFERENCE
CrossView Pro will set a breakpoint at line 21. When that breakpoint is hit,
CrossView Pro will print the value of var1, but will not print the current
function, line number, and source file.
b
Command Reference
q
Function
Quit a debugging session.
From the File menu, select Exit.
The command line syntax is:
q[s|y]
Description
CrossView Pro will prompt you if you really want to quit if you do not
specify anything. Note that the current desktop settings are NOT saved
then!
Typing q s saves the current desktop settings and quits the debugger
without confirmation.
Typing q y does not save the current desktop settings and quits the
debugger without confirmation.
Inside a command line procedure call it will just quit from this.
When the target runs in the background CrossView Pro will first stop the
target.
13167
Chapter 13
13168
R
Function
Reset program and begin execution from initial conditions.
From the Run menu, select Reset Application and then Run.
The command line syntax is:
R
Description
Reset the application being debugged and begin execution from initial
conditions. The program counter is set to the start address of the
application being debugged. This command does NOT perform a
hardware reset of the target system. That is, no registers are modified
except for the program counter.
This command is not allowed when the target runs in the background.
REFERENCE
C, g, prst
Command Reference
rawmemget
Function
Retrieve data from the target into a buffer.
The command line syntax is:
rawmemget address,type,count,buffername [,interleave]
Description
The rawmemget command is used to retrieve data from the target system
and to store the data in the acquisition buffer buffername. Data in the
acquisition buffer is of type double. CrossView Pro will automatically
handle data conversion based upon the type of the data. It reads count
elements of type type from the target starting at address address into the
buffer.
interleave indicates the distance between successive elements. The default
value is sizeof(type).
Example
To retrieve 18 integer values from memory starting at address 0x100 and
store these in acquisition buffer $buffer:
rawmemget 0x100,int,3*6,$buffer
13169
Chapter 13
13170
rst
Function
Reset target system to initial conditions.
From hte Run menu, select Reset Target System.
The command line syntax is:
rst
Description
The target is initialized according to the powerup sequence for the
processor. Almost all registers, including the system stack pointer and
program counter are initialized.
A target system reset may have undesired side effects. To be sure that the
application code is correct, a download must be performed after a target
system reset.
This command is not allowed when the target runs in the background.
REFERENCE
R, prst
Command Reference
S
Function
Single step C statements, stepping over function calls.
To step over a function, click on the Step Over button in the Source
Window. You can also select Step Over from the Run menu. Check the
Step Mode menu item in the Run menu: Source line step must be
selected.
The command line syntax is:
[ exp ] S
Description
If you try to step over a call to a function which contains a breakpoint (or
which calls another function with a breakpoint) then the breakpoint will
be hit.
Stepping over a function means that CrossView Pro treats function calls as
a single statement and advances to the next line in the source. This is a
useful operation if a function has already been debugged or if you do not
want to take the time to step through a function line by line.
When multiple statements are present on one line, they are all executed by
this single step.
This command is not allowed when the target runs in the background.
Example
To step one C statement, type:
S
C, s, si, Si
13171
Chapter 13
13172
s
Function
Single step C statements, stepping into function calls
To step into a function (single step), click on the Step Into button in the
Source Window. You can also select Step Into from the Run menu. Check
the Step Mode menu item in the Run menu: Source line step must be
selected.
The command line syntax is:
[ exp ] s
Description
Single step exp (default is 1), C statements, stepping into function calls.
Stepping into a function means that CrossView Pro enters the function and
executes its prologue machine instructions halting at the first C statement.
When the end of the function is reached, CrossView Pro brings you back
to the line after the function call. The debugger changes the source code
file displayed in the Source Window, if necessary.
This command is not allowed when the target runs in the background.
Example
REFERENCE
C, S, si, Si
Command Reference
save
Function
Save macros.
From the Tools menu, select Macro Definitions... to open the Macro
Definitions dialog box. From this dialog box, you can save macros with
the Save button. To save macro definitions in a file other than the current
one, click on the Save as... button.
The command line syntax is:
save file
Description
Save all currently defined macros in the specified file. This file is in the
format of a sequence of set commands, and thus can be loaded by
reading it as a playback file. See the < and << commands.
An existing save file with the same name will be overwritten.
Example
To save the definitions of the currently defined macros in the file
mac.sav, type:
save mac.sav
13173
Chapter 13
13174
set
Function
Definition and display of macros.
To create a macro, select Macro Definitions... from the Tools menu.
Click on the New... button and add a new macro.
The command line syntax is:
set [ name [ "cmds" ] ]
Description
The set command allows for definition and display of macros. If name and
cmds are supplied, a macro entry is made associating the name with the
commands. If only name is supplied, the body of the specified macro is
displayed.
If no arguments are supplied the names of all currently defined macros are
displayed. Macro definitions must contain the body of the macro in double
quotation marks.
Macros may take arguments. In the body of a macro formal arguments are
referred to as $n, where n is the argument number starting from 1.
REFERENCE
To define macro to be a macro which lists the registers then enters the
function given by its first argument, type:
set macro "l r; e $1"
Command Reference
13175
Chapter 13
13176
Si
Function
Single step machine instructions, stepping over subroutine calls
From the Run menu, select Step Mode | Instruction step. Then click on
the Step Over button in the Source Window, or select Step Over from the
Run menu.
The command line syntax is:
[ exp ] Si
Description
Single step exp (default is 1) machine instructions, stepping over
subroutine calls.
If you try to step over a call to a subroutine which contains a breakpoint
(or which calls another subroutine with a breakpoint) then the breakpoint
will be hit.
The next instruction to be executed is shown as a disassembled
instruction, not as a C statement.
This command is not allowed when the target runs in the background.
Example
REFERENCE
C, s, S, si, R
Command Reference
si
Function
Single step machine instructions, stepping into subroutine calls
From the Run menu, select Step Mode | Instruction step. Then click on
the Step Into button in the Source Window, or select Step Into from the
Run menu.
The command line syntax is:
[ exp ] si
Description
Single step exp (default is 1), machine instructions, stepping into
subroutine calls.
The next instruction is shown as a disassembled instruction, not as a C
statement.
This command is not allowed when the target runs in the background.
Example
To step one machine instruction, type:
si
C, s, S, Si, R
13177
Chapter 13
13178
st
Function
Stop the execution of the target immediately.
The command line syntax is:
st
Description
This command stops the running process immediately.
Not available for all execution environments.
REFERENCE
CB, wt
Command Reference
T
Function
Stack trace with local variables
The command line syntax is:
[ exp ] T
Description
Produce a trace of functions on the stack and show local variables. Only
the first exp levels of the stack trace will be displayed. If exp is omitted, all
of the levels of the stack trace (up to 20) will be printed.
This command works independently of the Stack Window.
This command is not allowed when the target runs in the background.
Example
To print out a stack trace of 20 levels with corresponding local variables,
type:
T
To print out the top five levels of the stack trace with corresponding local
variables, type:
5 T
e, l, t
13179
Chapter 13
13180
t
Function
Stack trace.
From the View menu, select Stack. The Stack Window shows the current
situation in the stack after the program has been stopped. It displays the
following information for each stack frame:
The name of the function that was called
The value of all input parameters to the function
The line number in the source code from which the function was
called
The command line syntax is:
[ exp ] t
Description
Produce a trace of functions on the stack.
exp specifies the number of levels of the stack trace to be displayed. If
omitted, up to 20 levels of the stack trace will be printed.
Each stack level shown in the Stack Window is displayed with its level
number first. The levels are numbered sequentially from zero. That is, the
lowest/last level in the function call chain is always assigned zero.
REFERENCE
This command is not allowed when the target runs in the background.
Example
To print out a stack trace of 20 levels, type:
t
To print out the top five levels of the stack trace, type:
5 t
e, l, T
Command Reference
td
Function
Disable, turn off, trace.
From the Tools menu, select Trace if this item was set.
The command line syntax is:
td
Description
If trace is supported by your version of CrossView Pro, this command
disables tracing (both instruction level, high level and raw). Trace is
automatically disabled when you close the Trace Window.
Example
To disable tracing, type:
td
te
13181
Chapter 13
13182
te
Function
Enable, turn on, trace.
From the Tools menu, select Trace if this item was not set.
The command line syntax is:
te
Description
If trace is supported by your version of CrossView Pro, this command
enables tracing (both instruction level, high level and raw). Trace is
automatically enabled when you open a Trace Window.
Example
To enable tracing, type:
te
REFERENCE
td
Command Reference
u
Function
Toggle the updating of the appropriate window when the target runs in
the background.
The command line syntax is:
[interval] u [d|k|r|s|a|mem|t]
Description
The following windows can be updated:
d (Data), k (Stack), r (Register),
s (Source), a (Assembly), mem (Memory), t (Trace)
With interval you can specify the update interval (in seconds). If interval
is zero, no window is automatically updated.
The updating of the Data Window is ON at startup, the others are OFF
If all windows are being updated and/or many monitor commands are
active it will increase the load on the communication between CrossView
Pro and the target.
This command is not available if the background mode is not supported
(check the addendum).
Example
To toggle the updating of the Register Window, type:
u r
CB, ubgw
13183
Chapter 13
13184
ubgw
Function
Update the appropriate window when the target runs in the background.
From the View menu, select Background Mode and select one of the
refresh options.
The command line syntax is:
ubgw [ s | a | k | r | d | mem | t | all ]
Description
The following windows can be updated:
s (Source), a (Assembly), k (Stack), r (Register), d (Data), mem
(Memory), t (Trace), all (all open windows)
Without an argument, the ubgw command refreshes all windows selected
by the background mode (u command).
The ubgwall command refreshes all open windows.
This command is not available if the background mode is not supported
(check the addendum).
Example
REFERENCE
Command Reference
unset
Function
Delete a macro definition.
From the Tools menu, select Macro Definitions... to open the Macro
Definitions dialog box. Highlight the name of the macro and click on the
Delete button.
The command line syntax is:
unset [ name !]
Description
The unset command deletes a macro. If name is supplied, the specified
macro is deleted. If no arguments are supplied, all currently defined
macros are deleted after CrossView Pro confirms your intent.
It is important to understand that macro expansion takes place for all
names. Therefore if you wish to pass the name of a macro to a command,
for example unset, you must escape it with !, to keep from expanding
the name.
Example
To delete all macros, type:
unset
CrossView Pro will first ask for confirmation. To delete all the macro
definitions at the same time, click on the Delete all button in the Macro
Definitions dialog box.
To delete the macro named macro, type:
unset macro!
13185
Chapter 13
13186
update
Function
Update a Data Analysis window.
Click on the Update Data Analysis Window button in a Data Analysis
window.
REFERENCE
graph_clear_updates "demo"
graph_add_update "demo",memget data[$i],100,$buffer
graph_add_update "demo",graphm "demo","show_x_t.cxl"
graph_add_update "demo",graph "demo","x_t.cxl",$buffer,0,1
update "demo"
graph_add_update, graph_clear_updates.
Section 11.5, Data Analysis, in chapter Special Features.
Command Reference
use
Function
Change source directories runtime.
From the Target menu, select Settings... to open the Target Settings
dialog box. Click on the Configure... button and specify the names of the
directories containing your source files. Relative paths are allowed.
The command line syntax is:
use [ path ]...
Description
The use command changes the source directories. Without a path this
command empties the search path, except for the path . (current
directory). If one or more paths are supplied, this command adds the,
semicolon separated, paths to the list of searched directories. Relative
paths are allowed.
Example
To clear the source directory path, type:
use
To search for source files in the directory /project/src and in the src
directory relative to your current directory, type:
use
ld
/project/src;../src
13187
Chapter 13
13188
wt
Function
Wait for the completion of the target.
The command line syntax is:
wt
Description
This command can only be used if the target runs in the background
mode.
This command waits for the running process to stop.
Waiting can be interrupted by typing ctrlC. The target continues to run
without interruption. It could be that some informational messages from
the target are displayed in the command window. They can be ignored.
Not available for all execution environments.
REFERENCE
CB, st
Command Reference
x
Function
Force an exit from assertion mode.
The command line syntax is:
[ exp ] x
Description
Normally this command stops execution immediately, but if exp is present
and its value is nonzero, then CrossView Pro finishes executing the entire
command list of the current assertion.
Example
To define an assertion to stop the program when the value of global
variable myvar exceeds 10, type:
a if (myvar > 10) {x}
a, A, l
13189
Chapter 13
13190
Z
Function
Toggle case sensitivity in searches
From the Edit menu, select Search String... to open the Search String
dialog box. This dialog contains the Case Sensitive check box.
The command line syntax is:
Z
Description
Toggle case sensitivity in searches. The initial state of this toggle depends
on information in the currently loaded absolute file. Use the I command to
find out the state of the case sensitivity.
This command affects everything: file names, function names, variables
and string searches.
REFERENCE
/, ?
CHAPTER
14
ERROR MESSAGES
Chapter 14
CHAPTER
142
ERRORS
14
Error Messages
143
Chapter 14
144
ERRORS
Error Messages
145
Chapter 14
146
ERRORS
Error Messages
147
Chapter 14
148
ERRORS
Error Messages
149
Chapter 14
1410
ERRORS
Error Messages
1411
Chapter 14
1412
ERRORS
Error Messages
1413
Chapter 14
1414
Must supply b or f
The color command requires a value of f for foreground or b for
background to modify the screen color.
Must supply r,w or b
Both the data range (bD) and data (bd) breakpoint commands require the
type of data modification to generate a break condition. Use r for read, w
for write, and b for both read/write. Please see chapter Command
Reference for more information.
Must supply data to be monitored
You did not specify a variable or expression to the m monitor command.
Please provide a variable or expression to be monitored, for example, m
myvar.
ERRORS
The time out value specified was negative. Please specify a legal timeout
value or use the default.
No child process
The CrossView Pro internal data structure containing user information
about child processes is not as expected. Please contact the TASKING
Technical Support staff for assistance.
No current file
Undefined special variable, $file; probably due to debugging where no
symbols are present.
Error Messages
1415
Chapter 14
1416
ERRORS
Error Messages
1417
Chapter 14
1418
ERRORS
Error Messages
1419
Chapter 14
1420
ERRORS
Error Messages
1421
Chapter 14
1422
ERRORS
Error Messages
1423
Chapter 14
1424
ERRORS
CrossView Pro on VMS can not establish the running environment. If the
condition persists, please contact your system administrator, or call the
TASKING Technical Support staff for assistance.
VMS error : cannot establish virtual keyboard
CrossView Pro on VMS can not establish the running environment. If the
condition persists, please contact your system administrator, or call the
TASKING Technical Support staff for assistance.
Error Messages
1425
Chapter 14
1426
ERRORS
Error Messages
1427
ERRORS
1428
Chapter 14
CHAPTER
15
GLOSSARY
Chapter 15
CHAPTER
152
GLOSSARY
15
Glossary
A
absolute file. The IEEE695 file (.abs) that contains symbolic debug
information and the final executable code of the target system.
active window. The window last selected by the user in CrossView Pro
that commands operate on as a default. An active windows title appears in
a different color (on color monitors) or inverse video (on monochrome).
assertion. A command or set of commands to be executed before every
line of source code, assessing the application state on validity. Assertions
are especially useful in tracking down hard to find bugs when other
methods fail. Individual assertions may either be active or suspended. See
also assertion mode.
assertion mode. A mode of CrossView Pro operation under which
assertions will be executed. Before CrossView Pro executes a source line
of code, it assesses all assertions active. Since CrossView Pro is single
stepping, breakpoints will not be effective. As long as there is at least one
assertion active, CrossView Pro operates in assertion mode. A program
running in assertion mode will be stopped when an asserted command
executes the x (exit assertion mode) command.
B
background mode. A target dependent feature in CrossView Pro that lets
the execution environment run and at the same time allows you to enter a
reduced set of CrossView Pro commands, for example to monitor memory
contents.
153
Chapter 15
154
C
Ctrace window. A CrossView Pro window keeping a record of the most
recently executed C or machine statements.
cache. Some microprocessors keep a copy of the most recently executed
instructions in onchip memory to speedup execution.
GLOSSARY
Glossary
coverage. With code coverage the source line is marked for each source
code line that is executed. Through code coverage you can find executed
and nonexecuted areas of the application program. Data coverage
allows you to verify which memory locations, i.e. which variables, are
accessed during program execution. Additionally, you can see stack and
heap usage. The availability of this feature depends on the execution
environment.
cycle count breakpoint. A breakpoint that halts program execution after
a specified number of CPU cycles. A cycle count breakpoint can have a
command list.
current function. The function that is currently being executed. The
current function is always at level 0 on the stack. Also stored in the
CrossView Pro special variable $PROCEDURE.
D
data breakpoint. A breakpoint that halts program execution when a
particular memory address (or an address within a particular range) is
written to, read from, or both. A data breakpoint may have a command list
and a count.
data coverage. See coverage.
data monitoring. CrossView Pro allows you to monitor expressions and
variables in the Data window. CrossView Pro updates their values
whenever execution stops.
data window. A CrossView Pro window displaying the values of
monitored expressions.
diagnostic output. Program output designed for debugging purposes.
With CrossView Pro, probe points and data monitoring can be used for
diagnostic output, eliminating the need for intrusive and annoying printf
calls compiled into code.
disassembly window. A CrossView Pro window showing a part of the
disassembled program space. It also displays other information such as the
current execution position, viewing position and installed breakpoints.
dot operand. The period character "." used in an expression to represent
the last value CrossView Pro calculated. The dot operand is useful as
shorthand.
155
Chapter 15
156
E
embedded system. Computer(s) executing an application program built
to run in (semi) realtime. An embedded system usually is part of a larger,
noncomputer system, hence the term "embedded." The TASKING product
line is designed for embedded systems programming.
emulator. A device used to monitor and control various aspects of a
microprocessors operation. An emulator usually is built around two chips,
the target microprocessor and a controlling chip. The controller chip can
start and stop the target chips program execution, and can examine and
change registers and memory. An emulator can be connected via a probe
to a hardware prototype to fully emulate the behavior of the target chip.
See ROM monitor.
execution position. The source line to be executed next. See viewing
position.
F
File System Simulation (FSS). A facility to redirect all C library file I/O
operations on the target, to the host system via CrossView Pro. File system
simulation is often used to provide input to an application for which no
hardware I/O is available yet and to log test results.
format. The manner in which CrossView Pro displays addresses and data;
for instance, hexadecimal, character and octal are different formats. You
may include special format codes when specifying variables.
GLOSSARY
H
hardware breakpoint. See breakpoint.
help window. A window explaining the use of CrossView Pro windows
and dialogs and summarizing the syntax and function of CrossView Pro
commands.
history mechanism. A facility for modifying and executing previous
CrossView Pro commands.
Glossary
host system. The computer system on which CrossView Pro is run. The
host system is connected to the target system, usually with an RS232
cable.
I
image part. This is the downloadable part of the absolute file that
contains the executable code of the target program. See also absolute file.
instruction count breakpoint. A breakpoint that halts program
execution when a number of instructions have been executed. An
instruction count breakpoint can have a command list.
interrupt key. The key that interrupts ongoing processes. On many
systems this is ctrlC.
I/O Simulation. A technique to intercept input and output for debugging
purposes. I/O Simulation is often used for testing a program before the
actual input and output hardware devices are present. See also stream.
L
local variable. A variable that can only be referenced from within its
defining function.
lowlevel breakpoint. A code breakpoint placed on an individual
machine instruction. Lowlevel breakpoints can be set with the break
code address command.
M
macro. A usercreated shorthand for a CrossView Pro command
sequence. Macros can accept parameters and can be saved to a file.
main(). The function where a C programs execution begins. See also
system startup code.
MAU. See minimum addressable unit.
157
Chapter 15
158
O
object language. A representation for target machine instructions, with
the ability to represent either relocatable or absolute address locations.
online help. A complete summary of all CrossView Pro commands and
individual descriptions available while CrossView Pro is running.
online tutorial. A playback file supplied with CrossView Pro that
demonstrates CrossView Pros capabilities.
output buffer. The location in memory where CrossView Pro directs I/O
simulation output. See also I/O Simulation.
GLOSSARY
P
patch. A technique to alter program flow (without recompiling the source
code) with CrossView Pro commands and/or C expressions. With
CrossView Pro, it is possible to use breakpoints to alter program flow by
patching in new code or moving the execution position around existing
code.
popup window. A window that appears in certain situations that
overlaps the current display. Popup windows usually contain information
(like a command definition) that need not be continuously displayed.
probe. A part of an emulator that can be inserted in place of the target
chip in the actual embedded systems hardware.
probe point. A special kind of breakpoint. When a probe point
breakpoint is hit, the associated commands are executed and program
execution is continued.
Glossary
profiling. For each source code line that is executed, the timing
information is given.
Q
quiet command. A Q instruction at the start of the command list of a
breakpoint suppressing the default display of function: line number:
source file.
R
record & playback. The ability to save CrossView Pro commands (and, if
desired, Command window output) to a file. CrossView Pro can play back
simple text files consisting solely of CrossView Pro commands.
register window. A CrossView Pro window showing the contents of the
target microprocessors registers.
reserved special variables. Special variables ($LINE, $PROCEDURE,
$FILE) whose values CrossView Pro maintains to reflect the current status
of the debugging session. See also special variables.
ROM monitor. A program which supervises or controls, at an elementary
level, the overall operation of an embedded system. Because of the limited
hardware features of most boards containing ROM monitors, some
CrossView Pro features may not be supported. See also emulator.
RS232 cable. A cable that exchanges asynchronous data between the
host and target systems.
S
scope. The extent to which a variable can be referred to. Global variables
are always in scope; local variables are only in scope when their defining
function is the current function.
select. To make a window active.
sequence breakpoint. A breakpoint that halts program execution when
breakpoints are hit in a specified sequence. A sequence breakpoint can
have a command list.
159
Chapter 15
1510
GLOSSARY
Glossary
T
target communication. The lowlevel communication between the host
and the target system. For the most part, CrossView Pro handles target
communications, allowing the programmer to concentrate on the
highlevel information.
target microprocessor. The chip on which the target program runs.
target system. The targeted microprocessor where the embedded
application runs.
terminal window. A CrossView Pro window containing all the input and
output streams directed to the screen. CrossView Pro can display several
windows at a time.
timer breakpoint. A breakpoint that halts program execution after a
specified number of seconds or timer ticks. A timer breakpoint can have a
command list.
trace buffer. A targetresident buffer that contains the most recent
instructions executed by the target microprocessor. CrossView Pro uses this
buffer to deduce a Ctrace.
transparency mode. The mode in which CrossView Pro passes user
input directly to the emulator. Transparency mode is often used when
setting up memory maps.
1511
Chapter 15
1512
U
uplevel breakpoint. A code breakpoint set at the return from a
function at a specified stack depth.
GLOSSARY
viewing position. The line of source code currently being viewed. This
line contains the dashed line cursor. Some commands operate by default
on the viewing position. The viewing position and the execution position
are initially the same, but you may adjust each individually.
APPENDIX
INTERPROCESS
COMMUNICATION
APPENDIX
INTERPROCESS COMMUNICATION
A2
Appendix A
Interprocess Communication
1 COM INTERFACE
1.1 INTRODUCTION
CrossView Pro provides a COM object interface on MSWindows
platforms. The purpose of the COM object interface is to make the
commandline interface of the command window available to the outside
world. Simultaneously, a callback mechanism is provided which allows the
outside world to tap into events that occur within CrossView Pro (for
example a breakpoint hit message). This is achieved by a COM connection
point interface to which multiple programming languages can connect.
The CrossView Pro COM object can be used in programming languages
like Python, Visual C++ or Visual Basic. Applications that are COM clients
can also make full use of the CrossView Pro COM object interface. COM is
a binary reusable object technology, linked tightly to MSWindows. COM
is closely related to ActiveX and Automation. ActiveX consists of a set of
predefined interfaces to be implemented in a COM object and used to
create plugable GUI components. Automation is a similar set of predefined
COM interfaces, but with a wider range of applications than ActiveX.
1.2.1
RUNTIME ENVIRONMENT
1.2.2
A3
Appendix A
A4
INTERPROCESS COMMUNICATION
C cpu
D device_type,opt1[,opt2]
Specifies communications parameters such as communication
port and baud rate.
G path
ini
1.2.3
STARTUP DIRECTORY
The startup directory of CrossView Pro determines where the xvw.ini file
is written. When CrossView Pro is invoked via its COM interface on
MSWindows, the startup directory is usually C:\WINNT\system32 . You
can change the location of the xvw.ini file with the G command line
option. This feature is useful when you are using two different CrossView
Pro instances simultaneously.
Interprocess Communication
A5
1.3.1
Command line options are passed to CrossView Pro via the Init()
method. It is necessary to call the Init() method before you can use the
CrossView Pro COM object. CrossView Pro does not start as COM object,
until after you have actually called the Init() method. If you do not
need to pass any options, invoke Init() with an empty string.
Registering the server
Before you can use the COM object, you must register it in the
MSWindows Registry. Run CrossView Pro from the command line as
follows:
xfw166 RegServer
Similarly, you can remove the COM object from the Registry:
xfw166 UnregServer
To avoid the popup message when registering, two more command line
options are available that are useful when you use batch files:
RegServerS
UnregServerS
Appendix A
A6
1.3.2
METHODS
INTERPROCESS COMMUNICATION
This section lists the methods that are supported by the CrossView Pro
COM objects default interface ICommandLine. The data types and return
values are expressed as COM base types. For example, BSTR is a
widecharacter UNICODE string type, which is the same type as Visual
Basic strings.
Init()
void Init(BSTR CommandlineOptions)
SequenceNumber
A number that is unique for each command. You can use this
number to distinguish the output in the events stream. If you
do not use this, specify a value of 0.
Interprocess Communication
Result
Returns:
ExecuteNoWait
BOOLEAN ExecuteNoWait(BSTR Command,
long SequenceNumber)
Queues a command for execution and returns TRUE of FALSE after the
command has been passed but before it is executed.
Command
SequenceNumber
A number that is unique for each command. You can use this
number to distinguish the output in the events stream. If you
do not use this, specify a value of 0.
Returns:
Halt
void Halt(void)
1.3.3
IMPLEMENTATION DETAILS
A7
Appendix A
INTERPROCESS COMMUNICATION
A8
1.4 EVENTS
CrossView Pro provides an events source, into which a client can tap via a
COM connection point. Examples of events are "reporting which
breakpoint has been hit" and "symbols have been loaded". Currently the
following events are defined. Each event is terminated by a newline
character. Prepare your client for new events, basically by ignoring
unrecognized ones.
CommandInterpreterBusy
The debuggers command interpreter is executing a command line, or a
GUI operation is in progress. A command line can comprise multiple
target execution commands, so arbitrary Running and Stopped events may
occur before the command line has been finished. An example for using
this event is the disabling of menu entries in your tool.
You can send multiple CommandInterpreterBusy events without the
CommandInterpreterReady counterpart. New commands can be send to
the debugger after this event has been issued, but they will be queued
until the debugger is ready for new command input.
Interprocess Communication
CommandInterpreterReady
The entire command line or GUI operation has either been executed
completely or aborted. You can send multiple CommandInterpreterReady
events without the CommandInterpreterBusy counterpart.
CommandCanceledByUser
The entire command line or GUI operation has can been canceled by the
user, usually via the Halt button.
In case of DDE, the CrossView Pro command queue will be emptied. The
command queue of all other IPCs, for example COM, will be preserved.
This has been designed for the multicore debugger which relies on
commands submitted by the multicore debug system always being
executed, even if the user hits the Halt button.
Note that every command can be canceled this way, even when asking a
variables value. Often no value will be returned at all, because Halt
aborted the evaluation.
HaltButtonPressed
Tells that the user has pressed the Halt button. This is necessary because
in CrossView Pro Halt means stop executing the current command line. If
an external client needs to know this too, the Halt button must be
reported explicitly. If not, only when the Halt button actually is hit during
a command line execution, cancellation is the case, and reported via an
event. If the command line just finished, nothing is being done, so needs
to be canceled, hence no cancellation is reported either.
An example would be a client interpreting breakpoint hits and issuing
continue commands to resume execution. If the halt button should also
stop the client from doing this, the HaltButtonPressed event must be used.
Running
Started executing the target.
RunningInBackground
Started target execution in background mode. This is usually a mode in
which a restricted set of operations can be performed, for example read
from a memory location.
Stopped cause
Stopped target execution. The cause is reported. Possible causes:
A9
Appendix A
A10
INTERPROCESS COMMUNICATION
STEP
BREAKPOINT "name"
Breakpoint name was hit. This includes cycle breakpoints,
time elapsed or number of instructions types. Breakpoints
that the user has set are reported as well.
Nameless breakpoints are reported using as name #number#,
where number is the CrossView Pro administration number.
If no name or number is known, NAMELESS BREAKPOINT
will be used.
ASSERTION number
Assertion number was hit.
UNKNOWN The process has stopped. The cause is unknown or cannot
be described with one of the previous reasons.
One of the causes may be that the user presssed the Halt
button.
More causes may be added in the future.
Reset
Hardware reset command has been executed by the debugger.
ResetProgram
Software reset of the program command has been executed by the
debugger.
ViewedLineNrChanged number
The line being displayed changed to the specified one. If the source
window is closed, or the cursor is not in a file but somewhere in
assembly, this event will not be sent.
SourceFileChanged "filename"
The debugger displays an other source file. An empty file name "" will be
sent if no source is being displayed at all.
DidLoadSymbols "filename"
The symbols of an application have been loaded.
Interprocess Communication
DidAddSymbols "filename"
An applications symbols have been added to the ones already
present.
DidDownloadImage "filename"
The code and data image of an application has been downloaded into
target memory.
DestroyedAllSymbols "filename"
The symbol table of the application filename has been destroyed.
BreakpointsChanged
The list of breakpoints changed (for example when a breakpoint was
added).
AssertionsChanged
Either the list of assertions or assertion mode changed (for example when
an assertion was added). Note that the assertion numbering can be entirely
altered when an assertion is removed.
MenuEntrySelected "idstring"
The menu entry idstring was selected by the user. Only menu entries
created with the AddDDEMenuEntry or AddCOMMenuEntry command are
reported.
CmdAnnotatedOutput<\n>
annotatedoutput
Provides the command window output in an annotated form.
The first line indicates the error status and says OK, ERROR or NOT
EXECUTED. The second line has the form SEQ:sequence_number, where
the sequence number is either 0 or the number specified with the
command. Although the sequence number is optional (it may be omitted
in some commands) this line is always present. The next lines are either
output or error messages. A label indicates the type (OUTPUT or ERROR)
and the number of lines that follow.
A11
Appendix A
A12
Example
INTERPROCESS COMMUNICATION
ERROR
SEQ: 9284
OUTPUT:1
Hello World
ERROR:1
No such name: xy
The reason behind this event is the inevitable merging of all data streams
into one when TCP/IP server is provided next to for example the DDE
server.
Quit
The debugger is about to terminate. This is not necessarily the last event.
nor is it guaranteed that a CommandInterpeterReady event was send
before. The quit event may not be send at all, due to technical restrictions.
1.5.1
PYTHON EXAMPLES
To use COM objects for Python, you must first install the Python
interpreter and the Win32COM extensions. You can use the Python
interpreter distributed with the TASKING EDE. Or you can download the
Python interpreter from http://www.python.org (May 2001) or use
win32all.exe from http://aspn.activestate.com/ASPN/
Downloads/ActivePython/Extensions/Win32all (May 2001).
Synchronous Calls
Replace all occurences of Xfw<targ> in the example below by the name
of your CrossView Pro executable to make the text applicable.
#
# Example without events callback
#
import win32com.client
# Python 1.4 requires "import ni" first.
Interprocess Communication
class Xfw<targ>:
"Xfw<targ> via COM wrapper class"
def __init__(self, cmdline_options = ""):
try:
self.COMobject = win32com.client.Dispatch(
"Xfw<targ>.CommandLine")
self.COMobject.Init(cmdline_options)
except Exception,e:
print (Is the Xfw<targ> COM object installed,
using "xfw<targ>.exe RegServer"?)
raise e
def Execute(self, text, sequence_number = 0):
result = self.COMobject.Execute(text, sequence_number)
# convert Unicode to Python string
retval = (result[0], str(result[1]))
return retval
def test_xfw<targ>_com_object():
xvw = Xfw<targ>(r"sd c:\\testdir")
(success, result) = xvw.Execute("echo Hello from Python")
print "received", result
(success, result) = xvw.Execute("l d")
print "success=",success
print result
(success, result) = xvw.Execute("++$hoi")
print result
(success, result) = xvw.Execute("++$hoi")
print result
(success, result) = xvw.Execute("++$hoi")
print result
del xvw
if __name__ == "__main__":
test_xfw<targ>_com_object()
A13
Appendix A
A14
Events Callback
#
# Example with Events callback
#
INTERPROCESS COMMUNICATION
import win32com.client
# Python 1.4 requires "import ni" first.
import win32ui
import re
seen_ready_event = 0
class xvw_events:
def OnCrossViewEvent(self, strUnicode):
global seen_ready_event
print "CrossViewEvent: " + str(strUnicode)
if (re.match("CommandInterpreterReady.*", str(strUnicode))):
seen_ready_event = 1
class Xfw<targ>:
def __init__(self, cmdline_options = ""):
self.COMobject = win32com.client.DispatchWithEvents(
"Xfw<targ>.CommandLine", xvw_events)
self.COMobject.Init(cmdline_options)
def Execute(self, text, sequence_number = 0):
result = self.COMobject.Execute(text, sequence_number)
# convert Unicode to Python string
retval = (result[0], str(result[1]))
return retval
if __name__ == "__main__":
xvw = Xfw<targ>("sd testdir1")
print xvw.Execute("hello Python";$hoi++)
while seen_ready_event == 0:
win32ui.PumpWaitingMessages(0, 1)
print "terminating"
del xvw
Interprocess Communication
A15
Appendix A
A16
1.5.2
INTERPROCESS COMMUNICATION
Synchronous Calls
This example demonstrates plain commands being executed in CrossView
Pro, without receiving any events from CrossView Pro.
Dim Xvw As Object
Dim Result As String
here we invoke the PowerPC \xvw{}
replace xfw<targ> by your executable name
Set Xvw = CreateObject("Xfw<targ>.CommandLine")
Call Xvw.init("")
Call Xvw.Execute("I", Result, 0)
MsgBox Result
End
Events Callback
Visual Basic provides a special feature, WithEvents, to connect to the
connection point of a COM interface. It is also available in VBA 5.0. You
must use WithEvents in a variable declaration. There is a catch, however:
you can only use it in a class module (including form modules) and it
must appear in the declaration section. You cannot declare a variable
using WithEvents in the body of a procedure. For this example, first
select Xfw<targ> type library in the Project References dialog:
1. In Microsoft Word or Microsoft Excel, start the Visual Basic editor and go
to Tools|References or:
In Visual Basic, go to Project|References .
Note that VBA differs from VB. See the Word example for VBA.
2. Search and check the CrossView COM Interface Type Library entry.
Interprocess Communication
Option Explicit
Public WithEvents Xvw As Xfw<targ>
Private Sub Form_Load()
Dim Result As String
Set Xvw = CreateObject("Xfw<targ>.CommandLine")
Call Xvw.Init("")
Call Xvw.Execute("echo Hello", Result, 0)
End
End Sub
Private Sub Xvw_CrossViewEvent(ByVal EventText As String)
MsgBox "Called back with: " & EventText
End Sub
1.5.3
WORD EXAMPLES
A17
Appendix A
A18
Option Explicit
INTERPROCESS COMMUNICATION
members
Public WithEvents oXfw<targ> As Xfw<targ>
Private Sub Class_Initialize()
End Sub
Private Sub oXfw<targ>_CrossViewEvent(ByVal strEvent
As String)
MsgBox strEvent
End Sub
Module testXfw<targ>
Option Explicit
Dim oXfw<targ>1 As New clsXfw<targ>
run automatically when your Addin loads
and your Addin will automatically load when Word
loads.
Public Sub AutoExec()
Set oXfw<targ>1.oXfw<targ> = New Xfwppc
call oXfw<targ>1.oXfw<targ>.Init("")
End Sub
Interprocess Communication
1.5.4
A19
Appendix A
A20
INTERPROCESS COMMUNICATION
2.1 INTRODUCTION
CrossView Pro offers an Interprocess Communications (IPC) option using
the Microsoft Windows Dynamic Data Exchange (DDE) interface for
external control of CrossView Pro. The DDE interface offers direct access
to the CrossView Pro command interpreter. Via the DDE interface you can
execute every CrossView Pro command that you can access via the regular
CrossView Pro command window, and retrieve the output produced by
the executed command.
Help
Topic
System
Item
Help
Operations
Request, Advise
Description
Returns a brief overview of the topics and items in ASCII text format.
Interprocess Communication
cmdoutput
Topic
Command
Item
cmdoutput
Operations
Request, Advise
Description
Retrieves all command window output of the last executed command via
the Command topic. This item empties itself after it has been requested.
A21
Appendix A
A22
cmdannotatedoutput
Topic
Command
INTERPROCESS COMMUNICATION
Item
cmdannotatedoutput
Operations
Request, Advise
Description
The first line indicates the error status and says OK, ERROR or
NOT_EXECUTED. The second line has the form SEQ:sequence_number,
where the sequence number is either 0 or the number specified with the
execext command. Although the sequence number is optional (it may be
omitted in some commands) this line is always present. The next lines are
either output or error messages. A label indicates the type (OUTPUT or
ERROR) and the number of lines that follow.
Example
ERROR
SEQ: 9284
OUTPUT:1
Hello World
ERROR:1
No such name: xy
Interprocess Communication
execext
Topic
Command
Item
execext:options:string
Operations
Execute
Description
Passes the specified string without interpreting it to CrossView Pros
command interpreter (see also Command\cmdannotatedoutput). The
execext: prefix is part of the entire command string: it makes a distinction
between the various commands. For example exec, execext or halt,
received via the Command topic.
Options
wait=yesno
A23
Appendix A
A24
exec
Topic
Command
INTERPROCESS COMMUNICATION
Item
exec
Operations
Execute
Description
Passes the specified string without interpreting it to CrossView Pros
command interpreter (see also Command\cmdoutput).
A major difference with regular MSWindows applications is the immediate
acknowledge of a command, before it has been completed. This is
because the sender does not have to wait for the answer and can peform
other tasks meanwhile. For example, you are able to issue a halt
command to stop the debugger.
To simulate waittillcompletion command execution, wait until the
cmdoutput item is assigned to the commands output via an Advisory link
event, or interpret the event item.
The exec: prefix is part of the entire command string: it makes a
distinction between the various commands. For example, exec, execext
or halt, received via the Command topic.
Interprocess Communication
halt
Topic
Command
Item
halt
Operations
Execute
Description
Forces CrossView Pro to stop target execution. You can issue the
command via a second conversation.
A25
Appendix A
A26
event
Topic
Command
INTERPROCESS COMMUNICATION
Item
event
Operations
Advise
Description
Reports event occurrences to the client, asynchronously. An event is
reported by a string. To ensure capturing all events, use an Advise link.
CrossView Pro only keeps the last event.
Request is not meant to be used; it can only be used after establishing an
Advise link.
Interprocess Communication
result
Topic
Command
Item
result:name
Operations
Execute
Description
The name that you specify provides a serve as DDE requestable item to
obtain a message which describes the reason why a DDE command failed
to execute. It does not return the CrossView Pro error message. It is
always deleted after it has been requested.
The result: prefix is part of the entire command string: it makes a
distinction between the various commands. For example, exec, execext
or halt, received via the Command topic.
2.3.1
PACKET FORMAT
Each event is wrapped in a record and one DDE message contains one or
more of these records. This means that multiple events can be received
simultaneously in one DDE transaction. This is done because DDE can
lose ("combines") events when XTYPF ACKREQ mode is selected, and
because this channel will be redirected to TCP/IP in the future for portable
IPC support in CrossView Pro.
To handle events with more than one line, a header (not a newline) is
used to distinguish between the individual events. The header format is:
EVENT: numberofcharacters<newline>
So you must always split events that arrive in one DDE message. An
example of such a multievent DDE message is:
A27
Appendix A
INTERPROCESS COMMUNICATION
A28
EVENT: 27
SourceFileChanged "demo.c"
EVENT: 23
ViewedLineNrChanged 93
EVENT: 27
Stopped BREAKPOINT "input"
EVENT: 24
CommandInterpreterReady
EVENT: 79
CmdAnnotatedOutput
OK\r
OUTPUT:1\r
Error breakpoint name input is not unique!\r
2.4.1
ddeservername=name
This command line option specifies a unique DDE server name. This way
it is easier to distinguish between multiple instances of the same debugger.
If you do not use this option, the server name is the name of the
CrossView executable. To distinguish between multiple DDE servers with
the same name, you must connect to all DDE servers using
DdeConnectLists() and obtain distinguishing information.
2.4.2
COMMANDS
Interprocess Communication
Creates a menu entry with given label and idstring. The label also
specifies the path from the main menu bar, for example:
AddDDEMenuEntry "Options|CaseTool|Configure...",
"configmenuentry"
2.5 EXAMPLES
2.5.1
EVALUATING AN EXPRESSION
A29
Appendix A
A30
2.5.2
You can retrive target memory either via requesting a variables value, or
with the dump command. The dump command can dump both byte
(MAU) sized hex values or C type values, for example long or double. The
resulting output must be interpreted to get the values.
INTERPROCESS COMMUNICATION
The basic syntax of the returned values for plain MAU size hex dumps is:
address: value value ASCIIdump
The basic syntax of the returned values for formatted dumps is:
address = value value
For example, execute via the Command topic a hex dump command:
execext:dump main,#16
The number of values per line differs. This depends on both the size and
type of the values, as well as the architecture of the processor that is
connected to the debugger.
Interprocess Communication
2.5.3
A31
Appendix A
A32
2.5.4
INTERPROCESS COMMUNICATION
$FILE
The file in which the source window cursor position is. If the
position is outside any file, the error message No current file
is returned.
$PROCEDURE
The name of the function in which the source window cursor
position is. If the position is outside any function, the error
message No current function is returned.
$LINE
You can also use the command l s" to get all special variables, including
the ones above. If a variable is not set, it is not included in the list, or set
with the error message as described above.
To make sure the cursor is at the current execution position, precede the L
command before requesting the variable. For example, issue:
L; $FILE; $PROCEDURE; $LINE
2.5.5
APPENDIX
CROSSVIEW
EXTENSION
LANGUAGE (CXL)
CXL SYNTAX
APPENDIX
B2
Appendix B
1 INTRODUCTION
The CXL language is used for scripting, specifically for the data analysis
window and simulation scripts. From CXL only limited access is possible to
the CrossView Pro data. Usually CXL scripts are bound to a CrossView Pro
command, such as a graph command or a cycle breakpoint with a cxl
command.
The CXL syntax is derived from the C syntax, the basic differences from C
are:
No preprocessor, so no defines.
Only "//" comments.
No structs or unions, so the operators "." and ">" are not
supported.
No type definition
No enums
No switch statement.
No casts allowed. Casts are performed automatically (like in C).
No ? : operator allowed.
Blocks must not be empty ("1;" is the minimal expression).
No main, all the script code is to be enclosed within a { and }
pair.
Function prototypes and function definitions can be nested, but
must be preceded by the keyword "sub". They can be used
anywhere in the source. Following the scope rules, a function
declaration hides a previous definition when it is defined.
Single statements after a flow control statement (if, else, for, while)
should always be between braces.
Initializers in declarations are not allowed.
Modifiers such as signed, unsigned, register and static are
not supported.
Floating point numbers below 1 should always be preceded by a
zero. For example, the number .15 is treated as invalid, this should
be 0.15.
Furthermore, the syntax is like the C syntax.
B3
Appendix B
B4
Example:
{
sub void p(function f)
{
outd(f());
outc(\n);
}
sub int h() { return 1; }
{
}
}
This example would print the following output in the command window:
1
2
CXL SYNTAX
There is no "main" function in a CXL script, the script just starts after the
first open brace.
Comments start with a // and end at the end of the line. Comments are
allowed anywhere in the script, including before the first brace and after
the last brace. The C style comments /* */ are not allowed.
Each block starts a new scope level for variables. Blocks must not be
empty ("1;" is the minimal expression).
There is no preprocessor like in C, so you cannot use C preprocessor
directives such as defines.
The control flow statements if, else, while and for are supported, just
like in C. The statements after the control flow statement must always be
included between braces. For example, the following expression is not
allowed:
if (x < 0 )
x = 0;
it should be written as
if (x < 0 )
{
x = 0;
}
The switch statement, the goto statement and labels are not supported.
B5
Appendix B
B6
2.1 VARIABLES
Variable declarations must be done at the beginning of a block, before
starting the actions. All variables are initialized to zero. Variables cannot be
initialized at declaration, which means that the following is not allowed:
int cyclebreak = 100;
Variables declared at the highest level are global and keep their value
between the script invocations. The cxl_reset command and the program
reset of CrossView Pro will reset these variables to zero. Variables at other
levels and in functions are initialized to zero every time the block or
function is executed.
Modifiers such as signed, unsigned, register and static are not
supported. Type definitions like in C with the typedef keyword are not
supported. The enumerated type (enum) is not supported.
CXL SYNTAX
char
int
long
float
double
string
function
Internally, char, int and long are treated the same, as are float and
double. Since they are the same, types belonging to one group can be
interchanged freely.
A function return value can be of any base type. Additionally, void can be
used as return type for functions without a return value.
array
array
array
array
array
of
of
of
of
of
char
int
long
float
double
Example:
{
char str[100];
strcpy( str, "Hello\n" );
}
Structures, unions and type definitions are not part of the CXL syntax.
2.4 POINTERS
Pointer to base type is only supported for parameters and not for other
variables. Pointers to variables are the result of the "addressof" (&)
operator and are treated as arrays of the mentioned base type with
upperbound 1.
Example:
{
int myval;
sub void threetimes( int *value )
{
*value *= 3;
}
myval = 10;
threetimes( &myval );
printf( "%d\n", myval );
}
When running this script in CrossView Pro with the cxl command, the
output in the command window will be:
30
B7
Appendix B
B8
// chopping
// rounding off to nearest integer
2.6 OPERATORS
CXL SYNTAX
The operators in CXL are equal to the operators and their precedence in C.
Only the ? : operator is not allowed.
B9
2.7 FUNCTIONS
Function definitions start with the keyword "sub". Besides that, the syntax
is equal to functions in C.
Example:
sub int putbit( int val, int bit, int bitval )
{
if( bitval )
{
val = val | (1 << bit);
}
else
{
val = val & ~(1 << bit);
}
return val;
// set bit
Just like in C, functions defined after the call must get a function prototype
before the call. Also, the prototype must be preceded by the sub
keyword:
sub int putbit( int val, int bit, int bitval );
// prototype
Appendix B
B10
The included files can only contain functions definitions. It is not possible
just include a script fragment.
The include files are searched in the following order:
1. Directory of the CXL file that contains the include statement.
2. Current working directory.
3. The etc\CXL directory in the installation tree of the product.
3 PREDEFINED FUNCTIONS
The following sections list the predefined functions in CXL. Several
functions are only useful when using CXL for scripting the data analysis
window.
CXL SYNTAX
sin(double x);
cos(double x);
tan(double x);
acos(double x);
asin(double x);
atan(double x);
sinh(double x);
cosh(double x);
tanh(double x);
log(double x);
log10(double x);
exp(double x);
sqrt(double x);
ceil(double x);
floor(double x);
fabs(double x);
pow(double x, double y);
The following string and array functions have the same implementation as
in the standard C library. Replace array with one of the compound types
"array of ...".
char * strcpy( char *s, string ct );
int strcmp( string cs, string ct );
char * strcat( char *s, string ct );
int strlen( string cs );
array memcpy( array s, array ct, int n );
array memset( array s, int c, int n );
int memcmp( array cs, array ct, int n );
void sprintf( string s, string format, ... );
File I/O
The following functions are available for file I/O:
int open( string filename, string mode );
The open function opens the file filename and returns a file handle if
successful, otherwise 1 is returned. The mode string determines the
mode in which the file is opened. The mode string must begin with
one of the following sequences:
"r"
"r+"
B11
Appendix B
B12
"w"
"w+"
"a"
"a+"
The mode string can also include the letter b either as a last character
or as a character between the characters in any of the twocharacter
strings described above. With the b in the mode the file is treated as
binary.
void fclose( int handle );
Is the same as the fprintf function in C, with the difference that the
first argument is a file handle and not a pointer to a stream.
void fputs( int handle, string data );
Writes the data string to the file belonging to the handle. The
handle is achieved by calling the open function.
Set or get variable name
The following functions are available for interaction with the application
being debugged:
CXL SYNTAX
Sets the value of the variable name in CrossView Pro. The name must
be a name known at the execution point of CrossView Pro. If the name
starts with a $ it is either a register name or a CrossView Pro special
variable. If the name starting with a $ is not known, a new special
variable is created and assigned to the value. If the name does not start
with a $ and is not known by CrossView Pro, an error will be issued
on the CXL line: "Evaluation of expression failed".
Example:
set( "$PSW", 0 );
set( "x", 0x1000 );
B13
Appendix B
B14
Set graph area size. The offset determines the lower left corner of
the graph area. Size is the exact number of pixels.
axis xlow, ylow, xhigh, yhigh
Define the axes ranges, for determining the crosshair cursor
coordinates (to be displayed in the cursor field and to be passed to
the representation generator). The axes range upto the topright
coordinate, which is excluded (reduces axis drawing maths, but
mind axis lengths of 0). The axes are linear.
CXL SYNTAX
pen_color color
Set pen color. Black is the default color. The color can be specified
by name or by RGB number in the form red,green,blue as decimal
number for each base color for 0 to 255. E.g. 255,128,0 is orange.
Valid names are:
black, red, yellow, green, blue, cyan, magenta,
dkgray, gray, ltgray, white
brush_color color
Color used for filling areas. Black is the default color. See
pen_color for possible colors. The value background sets the
brush to the current background color which is
WINDOW_BACKGROUND under Windows.
B15
Appendix B
B16
Anchors:
123
|
|
4
5
6
|
|
789
CXL SYNTAX
Argument passing.
The graph and graphm commands can be given a number of arguments.
These arguments are accessible as follows.
long n_args;
with N = n_args are added to the global scope and have type
double * for buffers, type string for strings and type double for
evaluated expressions.
Parsing the script will fail if a certain argument has not been provided.
Evaluation of the script will fail if the type of the argument does not match
its use.
For argument testing and argument retrieval the following functions are
provided:
long is_string_arg(long n);
long is_double_arg(long n);
long is_buffer_arg(long n);
double get_double_arg(long n);
string get_string_arg(long n);
double *get_buffer_arg(long n);
B17
CXL SYNTAX
B18
Appendix B
APPENDIX
SOUND SUPPORT
(MSWindows)
APPENDIX
C2
SOUND
Appendix C
C3
You can have sound effects being played when a predefined event in
CrossView Pro occurs. You can configure the sound in the Sound settings
of the Control Panel of MSWindows. Similar to assigning a sound to a
system event, you can assign a sound to a CrossView Pro event.
Currently the following events are supported:
Breakpoint hit
File has been downloaded
CrossView Pro has started execution
CrossView Pro is exiting
Run command/button
Step command/button
StepOver command/button
Halt command/button
Symbols Loaded
Fatal (system) error occurred
Nonfatal error
How to add sound support
1. Firstly all events must be specified to MSWindows. You can do this by
adding the following lines to the Registry under:
My Computer\HKEY_CURRENT_USER\AppEvents\EventLabels\
"XVW
"XVW
"XVW
"XVW
"XVW
"XVW
"XVW
"XVW
"XVW
"XVW
"XVW
Breakpoint Hit"
Program Download"
Start"
Exit"
Run"
Step Into"
Step Over"
Stop"
Load Symbols"
syserror"
uerror"
2. You must also add the same list of keys (without values) to
My Computer\HKEY_CURRENT_USER\AppEvents\Schemes\Apps\.Default\
3. Now go and start the Sound settings in your Control Panel. Here you can
assign a sound to each event. You can also assign None to an event, which
prevents CrossView Pro from playing a sound if that specific event occurs.
Appendix C
C4
4. For the sound effects to become operational, you also have to edit the
xvw.ini file. You can do this using any editor, e.g. the Windows
notepad command. Add the following line at an arbitrary line to your
xvw.ini file:
sound_effects: TRUE
It is also possible to disable the sound effects by changing this line into:
sound_effects: FALSE
SOUND
ADDENDUM
ROM/RAM MONITOR
Execution Environment
ADDENDUM
ROM/RAM MONITOR
Mon2
ROM/RAM Monitor
Mon3
1 INTRODUCTION
This addendum contains information specific for the C166/ST10 family
target boards with a ROM or RAM debug monitor. A target board can be
either an evaluation board or your own target board.
If you are using an evaluation board, the evaluation boards user manual is
always the first source of information; this addendum covers the
evaluation boards interaction with CrossView Pro.
2 EXECUTABLE NAME
The following CrossView Pro executable is delivered with the package (for
PC with .exe extension):
xfw166
3 GENERAL OPERATION
To debug your application with CrossView Pro it has to be executed in an
C16x, ST10, XC16x or Super10 family hardware environment. This
CrossView Pro version was designed to have full control over the
following target boards:
any board running the TASKING C166/ST10 ROM debug monitor
any board running the TASKING C166/ST10 RAM debug monitor
The TASKING C166/ST10 ROM and RAM debug monitors are included in
the package, as source code in the mon subdirectory and configured for
several boards in the etc directory. The ROM debug monitor should be
burned into an EPROM on the target board. The RAM debug monitor is
downloaded into onboard RAM by means of the onchip bootstrap
loader.
Execution Environment
Mon4
CrossView Pro knows which resources to use for a target board by reading
a target configuration file. You can select one of the target configuration
files by using the tcfg option or by selecting the target configuration file
from the Target Settings dialog (Target | Settings...).
4 RESTRICTIONS
Facilities for hardware breakpoints, realtime kernel support and trace are
absent on these evaluation boards. As a consequence, the CrossView Pro
commands bd and bD for data breakpoints, the commands bt, bti, btI, et
and l t for kernel support, and the command ct for Clevel tracing, are not
available. Due to the binary command interface between debugger and
evaluation board, the >& command to record target communication and
the o command for transparency mode are not available.
Profiling is only available for ICEs that support it. Contact your ICE vendor
to ask if they support profiling.
ROM/RAM MONITOR
Menu and dialog items related to the mentioned commands are disabled
(grayed out).
When a breakpoint is set in an ATOMIC or EXTEND sequence, CrossView
Pro will set a breakpoint at the first instruction after the sequence. Within
an ATOMIC or EXTEND sequence class A hardware traps are not
handled. Therefore, it is not possible to set a breakpoint within a
sequence, because breakpoints are set by a TRAP #2 (NMI) instruction
which is a class A hardware trap.
ROM/RAM Monitor
5.1.1
For loading the monitor in RAM, the onchip bootstrap loader (BSL) is
used. The processor is started in BSL mode by activation of one or more of
its pins during the hardware reset. See the BSL description in the CPU
users manual for more information about activation of the onchip BSL.
CrossView Pro detects if the CPU is in the BSLmode by sending a
nullbyte to the serial channel. If the CPU is in BSLmode it detects the
baud rate from this nullbyte and sends an acknowledge byte back to
CrossView Pro. When this acknowledge byte matches the byte specified
for the selected target board CrossView Pro knows that the CPU is in
BSLmode. If the monitor has already been loaded before and running, it
answers with an acknowledge byte (0xAA) which is different from all
possible BSL acknowledge bytes. Once CrossView Pro detects that the
CPU is in BSLmode it continues with the boot sequence. This boot
sequence is as follows:
Mon5
Execution Environment
Mon6
ROM/RAM MONITOR
ROM/RAM Monitor
Mon7
5. Initializing registers.
The values of the registers specified in the configuration file with the
einit field are passed by the bootprogram to the monitor by storing it at
a location in internal RAM. This is possible because a SRST instruction
does not erase the internal RAM. This way the register from the
configuration file in the einit field could be initialized before the EINIT
instruction in the monitor. The initialization of the other registers specified
in the target configuration file is now done by using monitor commands.
For each execution of the user application (step and run commands) the
monitor installs the NMI and serial receive interrupt vectors to jump into
the monitor before the execution of the monitor is ended and the user
application is started. The NMI vector is used for breakpoints and the serial
receive interrupt is used to jump into the monitor on the halt command of
CrossView Pro. Because these vectors are each time reinstalled, loading
the interrupt vector table of the user application over these vectors is
possible.
The etc directory contains several boot programs and RAM debug
monitors. The target configuration files *.cfg (also in the etc directory)
tell CrossView Pro which boot program and monitor can be used for a
board. The boot programs and monitors are in SRecord format (S1). The
filename suffix is .sre.
The following boot programs are available:
Boot Program
Description
btarget.sre
btargetnrb.sre
Execution Environment
Mon8
Boot Program
Description
btargetnrbe.sre
ROM/RAM MONITOR
b167a.sre
b167snrb.sre
bi_me167.sre
bext2f.sre
bext2i.sre
bext2fi.sre
bext2nrbi.sre
bxc16xi.sre
bxc16xnrbi.sre
ROM/RAM Monitor
Mon9
Description
mtargetn.sre
mtargetr.sre
mtargetre.sre
m167cr.sre
m167crd.sre
m167mcp.sre
m167cmcp.sre
m167rvh.sre
m164r.sre
for C164 boards with RAM boot with reset vector. Use T4
instead of T6 for baud rate.
mext2b.sre
mext2fb.sre
Execution Environment
Mon10
Monitor Program
Description
mext2ib.sre
mxc16xb.sre
mexc16xib.sre
ROM/RAM MONITOR
Start
End
000FCC0h
000FCDFh
0000200h
0000DFFh
0000E00h
0000FFFh
000FD00h
000FD4Bh
000DF00h
000DFFFh
0C01000h
0C01FFFh
000CF00h
000CFFFh
0001000h
0001FFFh
ROM/RAM Monitor
Mon11
mext2d.sre
mxc16xd.sre
Execution Environment
Mon12
The ROM debug monitors with dual vector table are by default configured
as follows:
Resource
Start
End
0FCC0h
0FCDFh
00000h
00FFFh
0FD00h
0FD8Fh
08000h
081FFh
0C00000h
0C01FFFh
0DF00h
0DF8Fh
0CF00h
0CF8Fh
00FFFh
ROM/RAM MONITOR
ROM/RAM Monitor
5.1.3
Mon13
In this configuration the monitor and vector table are in EPROM starting at
address 0000h. When the monitor is booted, the EINIT instruction causes
the RSTOUT pin of the controller be toggled. The hardware will then swap
the EPROM with a RAM area and the monitor will continue execution at
the new EPROM address.
For each execution of the user application (step and run commands) the
monitor installs the NMI and serial receive interrupt to jump into the
monitor before the execution of the monitor is ended and the user
application is started. The NMI vector is used for breakpoints and the serial
receive interrupt is used to jump into the monitor on the halt command of
CrossView Pro. Because these vectors are each time reinstalled, locating
the interrupt vector table of the user application over these vectors is
possible.
The following Srecord (S1) file for burning into EPROMS is installed in
the etc directory:
m167s.sre
Start
End
0FCC0h
0FCDFh
08000h
08FFFh
00200h
0027Fh
Execution Environment
Mon14
ROM/RAM MONITOR
C16x/ST10
monitor
XC16x/Super10 monitor
serial port
S0
S0
interrupts used
NMI, S0RINT
system stack
32 words
48 words
16 words
16 words
136 bytes
136 bytes
< 3K
< 3K
< 3K
< 3K
CAN interface
ROM/RAM Monitor
The NMI and the S0RINT interrupt cannot be used by your program. Both
vectors should be located in RAM because the monitor refreshes them on
exit. This is needed to be able to restart the monitor after downloading an
application which overwrites the vector table.
All SFRs used by the monitor are saved on entry of the monitor and they
are restored before the program is continued.
The CrossView Pro debugger sets a breakpoint by exchanging the code on
the breakpoint with a TRAP #NMI instruction. When the breakpoint is hit
CrossView Pro writes the original code at the breakpoint address.
Therefore, the user program must be in RAM. As a consequence, the
monitor may also be entered when an NMI is caused externally by a
hightolow transition at the NMI#pin.
On entry of the monitor (e.g. after a breakpoint) all timer registers
T01CON, T2CON, T3CON, T4CON, T5CON, T6CON (and T78CON for the
167) are saved and set to zero. This way the timers are stopped while the
monitor is running. The timers are reloaded with the saved value before
continuing with the user program.
At startup the monitor executes the DISWDT and the EINIT instruction.
The DISWDT instruction disables the watchdog timer, and it cannot be
enabled by the user program. The EINIT instruction causes the RSTOUT#
pin to go high. This pin cannot be used by the user program.
The serial receive interrupt vector S0RINT (or S1RINT when configured
for port S1) is used by the monitor to abort execution of the user program.
This interrupt vector points to the start address of the monitor. If program
execution needs to be aborted, the debugger sends an escape sequence to
the serial port to cause an interrupt. When the interrupt is serviced by the
CPU the monitor is trapped and debugging continues. The receive
interrupt level for the serial port is set to the lowest priority (ILVL=1 and
GLVL=0). These interrupt levels can be changed in the monitor source. See
section 5.3 Rebuilding the Debug Monitors for more information. The
interrupt enable bit in the program status word (PSW) is enabled in the
monitor and need to stay enabled when the user program is running.
Otherwise, interrupting the program from the debugger is not possible.
For the RAM debug monitor for the C16x the WR# pin and the BHE# pin
are enabled at startup of the monitor. The init field in the target
configuration file can be used to change the values at startup. The signal
BHE# is used by the chipselect logic for the 16bit data bus modes. Here
the signal may not be disabled by the user, respectively port P3.12 may
not be used as an I/O port.
Mon15
Execution Environment
Mon16
ROM/RAM MONITOR
The monitor and boot programs are also included as source, installed in
the mon subdirectory. This directory contains the following files:
boot.c
boot_get.c
bootcom.h
boot.ilo
command.c
memcopy.c
memcopy.h
id.c
io.c
iocan.c
candef.h
ioserial.c
ioserial.h
vio.c
vio.h
flash_exe.c
flash_exe.h
flash_ptr.h
ROM/RAM Monitor
Mon17
flash_st10f16x.c
flash_st10f276.c
trap.c
trap_get.c
vectabl.asm
mon.c
mon.h
mon.ilo
mondef.h
makefile
subdirectory mon167:
makefile
subdirectory monext2:
makefile
subdirectory monxc16x:
makefile
When you have the TASKING C166/ST10 C compiler version 5.0 or higher
you can rebuild the monitors. Make the mon subdirectory the current
working directory and type:
mk166
Execution Environment
Mon18
The SRecord files (.sre) of the boot programs and monitors are created
in the mon167, monext2 and monxc16x subdirectories. If you need the
Intel HEX file format (for example, for programming into flash) instead of
the Motorola S record format, type:
mk166 IHEX=
all files which can be created when building the monitors are removed.
ROM/RAM MONITOR
ROM/RAM Monitor
Memory configuration
The memory configuration depends on the values of the SYSCON,
CPUCON1, VECSEG, BUSCON and ADDRSEL registers. The values for
these registers can be specified with the einit and init fields for the
selected target board in a target configuration file (.cfg). CrossView Pro
will initialize the registers as specified just after booting the boot program
and just after booting the monitor. This is not the case for the registers
specified within the einit field, because they cannot be modified after
execution of the EINIT instruction. For this reason CrossView Pro always
sends the values as specified in the einit field before the boot program
has executed the EINIT instruction. These values are passed by the boot
program to the monitor by storing them in the internal memory which is
not changed by a SRST instruction.
Memory layout
The memory layout of the three basic configurations of the monitor is
defined in the locator invocation file mon.ilo with defines in mondef.h.
The files are preprocessed by the C preprocessor to select one of the three
configurations and to substitute the defined macros. The following
parameters can easily be changed in the mondef.h file by changing the
defines:
MON_RB_START
The start address of the monitor register bank, default 0FCC0h.
ROM_START
The start address of the monitor code in ROM.
ROM_SIZE
The monitor code size.
RAM_START
The start address of the monitor data in RAM.
RAM_SIZE
The monitor data size.
Mon19
Execution Environment
Mon20
VECTAB_APP_START
The start address of the vector table of the user application for the
ROM dual vector table configuration. All vectors except the reset, NMI
and serial receive interrupt vectors in the monitor vector table jump to
a vector table starting at this address in RAM. The default is 08000h.
VECTAB_MON_START
The start address of the monitor for the ROM dual vector table
configuration.
Startup configure at NMI
C16x/ST10 derivatives can enter the bootstrap mode by activating the NMI
pin in combination with another port pin. When the bootstrap program
starts the monitor using the SRST instruction, the following may happen:
1. the target board has deactivated the NMI pin when the RSTOUT pin
went low. Then the NMI remains deactivated when the SRST
instruction causes the RSTOUT pin to go high again.
ROM/RAM MONITOR
2. the target board did not deactivate the NMI pin or activated it again at
the SRST instruction.
Now the NMI occurs before starting at the reset vector.
To cope with both situations the monitor module main.c uses a C
preprocessor macro NMI_STARTUP. When this macro is set, an additional
NMI handler is defined. This NMI handler does the startup configuration of
the CPU and then returns. Then the monitor main function is executed
from the reset vector.
When this macro is not set, the CPU is configured by the main function
executed from the reset vector.
ROM/RAM Monitor
5.4.1
INITIALIZATION
To initiate the connection, the host sends a null byte to the target. In case
of a serial link, the target monitor measures the time between start bit and
stop bit, and the monitor should appropriately set up the baud rate
generator.
Then the host sends the SYNC command to synchronize host program and
target monitor. The monitor should reply with the acknowledge byte:
0xAA.
Now the connection is established at monitor command interface level.
5.4.2
CONVENTIONS
command
Name of the command as used in descriptions and documentation.
Token:
Decimal code for command byte.
Parameters:
Additional data which should be supplied with the command token.
Returns:
Data returned by monitor. Hexadecimal numbers are prepended by 0x.
The data format, if applicable, is annotated between parentheses. If the
format is to be applied more than once, the format is preceded or
succeeded by a count number and multiplication operator. These are the
data formats used:
Mon21
Execution Environment
Mon22
ROM/RAM MONITOR
ADDR:
WORD:
BYTE:
STRING:
ROM/RAM Monitor
5.4.3
Mon23
COMMAND SET
NULL
Description:
Dummy command, no action to be performed.
Token:
0
(BYTE)
Parameters:
none
Returns:
When the monitor supports the EINIT command and the command is not
yet executed:
0xEE
(BYTE)
otherwise:
0xAA
(BYTE)
Execution Environment
Mon24
PCTOMEM
Description:
Send number of bytes from host to target. Start address and start address +
count must be in the same 16K page.
Token:
1
(BYTE)
Parameters:
start address
count
data byte
(ADDR)
(WORD)
(BYTE) * count
Returns:
none
ROM/RAM MONITOR
MEMTOPC
Description:
Receive number of bytes from target at host. Start address and start address
+ count must be in the same 16K page.
Token:
2
(BYTE)
Parameters:
start address
count
(ADDR)
(WORD)
Returns:
data byte
(BYTE) * count
ROM/RAM Monitor
Mon25
POKE
Description:
Write a 16bit word to target. The supplied address parameter must be
even.
Token:
3
(BYTE)
Parameters:
address
value
(ADDR)
(WORD)
Returns:
none
PEEK
Description:
Read a 16bit word from target. The supplied address parameter must be
even.
Token:
4
(BYTE)
Parameters:
address
(ADDR)
Returns:
value
(WORD)
Execution Environment
Mon26
REGLOAD
Description:
Receive all 16 user program General Purpose Register values from the
target.
Token:
5
(BYTE)
Parameters:
none
ROM/RAM MONITOR
Returns:
reg
reg
reg
reg
reg
reg
reg
reg
reg
reg
reg
reg
reg
reg
reg
reg
R0 value
R1 value
R2 value
R3 value
R4 value
R5 value
R6 value
R7 value
R8 value
R9 value
R10 value
R11 value
R12 value
R13 value
R14 value
R15 value
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
ROM/RAM Monitor
Mon27
REGSAVE
Description:
Send 16 new user program General Purpose Register values to target.
Token:
6
(BYTE)
Parameters:
reg
reg
reg
reg
reg
reg
reg
reg
reg
reg
reg
reg
reg
reg
reg
reg
R0 value
R1 value
R2 value
R3 value
R4 value
R5 value
R6 value
R7 value
R8 value
R9 value
R10 value
R11 value
R12 value
R13 value
R14 value
R15 value
Returns:
none
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
Execution Environment
Mon28
MOVMEM
Description:
Copy range of target memory contents to another memory location. Source
range and destination range should be in the same 16K page.
Token:
7
(BYTE)
Parameters:
src range start
src range end
dest range start
(ADDR)
(ADDR)
(ADDR)
Returns:
0xAA
(BYTE)
ROM/RAM MONITOR
FILLMEM
Description:
Fill a target memory range with a specific value.
Token:
9
(BYTE)
Parameters:
start address
count
fill value
(ADDR)
(ADDR)
(WORD)
Returns:
0xAA
(BYTE)
ROM/RAM Monitor
Mon29
SETIP
Description:
Set user program CSP:IP registers on target to given address value .
Token:
14
0x0E
(BYTE)
Parameters:
new CSP:IP value
(ADDR)
Returns:
none
VERSION
Description:
Receive the target monitor version string.
Token:
15
0x0F
(BYTE)
Parameters:
none
Returns:
monitor id string
(STRING)
Execution Environment
Mon30
GO
Description:
Start user program on target.
Token:
16
0x10
(BYTE)
Parameters:
none
Returns:
none
SHOWSTAT
ROM/RAM MONITOR
Description:
Receive user programs most important SFR values.
Token:
17
0x11
(BYTE)
Parameters:
none
Returns:
reg
reg
reg
reg
reg
reg
reg
reg
reg
reg
reg
CP value
IP value
CSP value
PSW value
SP value
DPP0 value
DPP1 value
DPP2 value
DPP3 value
ADCON value
STKOV value
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
ROM/RAM Monitor
reg
reg
reg
reg
reg
reg
reg
reg
reg
Mon31
STKUN value
T01CON value
T2CON value
T3CON value
T4CON value
T5CON value
T6CON value
T78CON value
TFR value
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
(WORD)
SYNC
Description:
Test if target monitor is alive. Monitor should return acknowledge token
0xAA.
Token:
20
0x14
(BYTE)
Parameters:
none
Returns:
0xAA
(BYTE)
Execution Environment
Mon32
MONADR
Description:
Receive target memory locations where the user program resources are
saved when the target monitor is running and uses these resources itself.
Token:
21
0x15
(BYTE)
Parameters:
none
Returns:
saved regs address
(ADDR)
ILVL
ROM/RAM MONITOR
Description:
Write the monitor ILVL/priority to the target. The interrupt/priority level
should be 15 or lower. When the monitor should allow certain interrupt
routines to continue to be served when the program is halted, this monitor
interrupt/priority level should be lower than the interrupt level of the
interrupt routines.
Token:
22
0x16
(BYTE)
Parameters:
interrupt level
Returns:
none
(BYTE)
ROM/RAM Monitor
Mon33
DEBUG
Description:
Receive the debug instruction that will activate the monitor when a
breakpoint is encountered.
This instruction is the trap function with corresponding trap number.
Token:
25
0x19
(BYTE)
Parameters:
none
Returns:
used trap intruction
(WORD)
BAUD_ZL
Description:
Internal use to calculate the baud rate oscillator frequency used on the
target board.
Token:
26
0x1A
(BYTE)
Parameters:
none
Returns:
myltiply factor
baud rate zero length
(BYTE)
(WORD)
Execution Environment
Mon34
EINIT
Description:
Internal use to execute the einit instruction to initialize the target at startup.
Token:
32
0x20
Parameters:
none
Returns:
ROM/RAM MONITOR
none
(BYTE)
ROM/RAM Monitor
Mon35
subfield
fieldvalue
comment
optional comment
Field
Description
title
cpu_type
Execution Environment
ROM/RAM MONITOR
Mon36
Field
Description
debug_instrument_module
bslack
boot
monitor
flash_monitor
ROM/RAM Monitor
Mon37
Field
Description
flash_direct_access
flash_device_num
flash_workspace
flash_vendor0
flash_chip0
flash_width0
flash_chips0
flash_base_address0
register_file
syscon
init
Execution Environment
ROM/RAM MONITOR
Mon38
Field
Description
einit
ilvl
reserve
reset_period
rs232_reset_pin
rs232_reset_level
rs232_reset_hold_level
rs232_bootstrap_pin
rs232_bootstrap_level
rs232_bootstrap_hold_level
ROM/RAM Monitor
Mon39
The SYSCON register will always be initialized before the boot program
and monitor execute the EINIT instruction.
The configuration files could have the following syscon/einit
combinations:
1. syscon:
einit:
2. syscon:
0x0080
einit:
0x0000
$syscon = 0x0080;
3. einit:
$syscon = 0x0080;
! overruled value.
! new value
Ertec EVA167
167
0xC5,0xA5
b167.sre
m167n.sre
reg167.dat
$syscon = 0x0000;
$addrsel1 = 0x0406, $buscon1 = 0x0680,
$stkov = 0xfa00;
debug_instrument_module: dieva166
reserve:
0x2000xFFF,0xFCC00xFCDF,0xFD000xFD4B
CrossView Pro searches for the target configuration file in the current
directory and in the etc directory.
On startup CrossView Pro reads the target configuration file in memory
and selects the target configuration file indicated with the tcfg command
line option or by the target configuration field of Target | Settings...
dialog. This board can be selected using the filename of the target
configuration file or the full name (title field) of the target board.
Execution Environment
Mon40
ROM/RAM MONITOR
For the C16x/ST10 derivatives the _EXT define must also be enabled to get
C16x/ST10 startup code.
When locating your application you should reserve the memory areas used
by the monitor running on your target board by using the RESERVE
MEMORY control in the locator invocation. See the description of the
monitor for your target board for a list of the ranges to be reserved.
ROM/RAM Monitor
Mon41
8.1 RS232
All configurations of the monitor have an automatic baud rate detection.
We recommend using a baudrate in the range 4800 to 19200 baud. By
using the D rs232,port,baudrate (Execution environment port and
communication Speed: baudrate) option of CrossView Pro you can force
the serial connection parameters to nondefault values. You can use the
Communication Setup dialog (Target | Communication Setup...) to set
the port and baudrate. The set of valid parameters for PC host computers
running MSWindows is listed here:
port:
COM1 (default)
COM2
COM3
COM4
baudrate:
1200
2400
4800
9600 (default)
19200
port
baud rate
Sun
/dev/ttya
9600
others
/dev/tty00
9600
Mon42
Execution Environment
ROM/RAM MONITOR
You can solve the problem that caused the error, reset the board, and click
the Retry button to try connecting again.
In the midst of a debug session, whenever CrossView Pro might lose
connection with the monitor, the debugger times out issues a error
message in a window where you can choose to retry the last command or
to exit CrossView Pro. You can reset the board and click the Retry button
to reestablish the connection. When using a ROM monitor the memory
contents are not affected by the reset. When the board uses a RAM debug
monitor, CrossView Pro reboots the monitor using the onchip bootstrap
loader and the boot program. Some memory is overwritten at startup of
the boot program and monitor and your application must be downloaded
again using the download command dn or select Download
Application... from the File menu.
The RAM debug monitor can only use serial port 0 of the CPU because
only that port can be used by the onchip BSL. The ROM debug monitors
installed in the etc directory use port 0 by default. They should be rebuilt
when port 1 has to be used.
The monitors are always configured using 8 data bit, one stop bit and no
parity.
ROM/RAM Monitor
Mon43
Execution Environment
Mon44
ROM/RAM MONITOR
identifier:
Default is 30.
This value is the send identifier host>target); the
receive identifier target>host) is identifier+1.
time_out:
board_segment:
hardware_index:
port_IO_address:
net_number:
ROM/RAM Monitor
target_board:
Mon45
For example:
xfw166 D can,500,30,0,0,0,0,pcnetcan tcfg kc167c.cfg
Execution Environment
Mon46
ROM/RAM MONITOR
ROM/RAM Monitor
Mon47
Execution Environment
Mon48
ROM/RAM MONITOR
ROM/RAM Monitor
Mon49
Execution Environment
Mon50
|
target DTE
| ________________________
> |
4
7
RTS
| |
CTS
8
5
< |
5
8
CTS
|
TxD
3
2
>>
2
3
TxD
|
RxD
2
3
<<
3
2
RxD
|
GND
5
7
>>
7
5
GND
|
DSR
6
6
> |
6
6
DSR
| |
DTR
4
20
< |
20
4
DTR
| |
DCD
1
8
< |
8
1
DCD
|
______________________
| _______________________
ROM/RAM MONITOR
RTS
ROM/RAM Monitor
Mon51
Execution Environment
Mon52
10
When you invoke CrossView Pro, you have to specify which board is used
with the tcfgcfgfilename option (see section 6, The Target
Configuration File). You can select the board in the Target | Settings...
dialog. From the selected target board CrossView Pro knows which CPU,
boot program, monitor program and register file are used.
ROM/RAM MONITOR
Bootstrap
Loader
Monitor
Flash
Monitor
Configuration File
EVA165
b167.sre
m167n.sre
f167.sre
eva165.cfg
EVA167
b167.sre
m167r.sre
f167.sre
eva167.cfg
FS FORTH Systeme
Bootstrap
Loader
Monitor
Flash
Monitor
Configuration File
b167nrb.sre
m167r.sre
f167.sre
fsf_167cr_demux.cfg
b167nrb.sre
m167r.sre
f167.sre
fsf_167cr_mux.cfg
ST10x168
b167nrb.sre
m167r.sre
f16x.sre
fsf_168.cfg
ST10x269
b167nrb.sre
m167r.sre
f167.sre
fsf_269.cfg
ST10x276
b167nrb.sre
m167r.sre
f276.sre
fsf_276.cfg
ST10x280
b167nrb.sre
m167r.sre
f167.sre
fsf_280.cfg
bext2i.sre
mext2b.sre
fext2.sre
fsf_super10bo.cfg
bext2f.sre
mext2fb.sre
fext2.sre
fsf_super10bo_fbd.cfg
bext2i.sre
mext2b.sre
fext2.sre
fsf_super10r303.cfg
bext2fi.sre
mext2fb.sre
fext2.sre
fsf_super10r303_fbd.cfg
I+ME ACTIA
Bootstrap
Loader
Monitor
Flash
Monitor
Configuration File
I+ME C167C
bi_me167.sre
m167r.sre
f167.sre
ime167c.cfg
Infineon
Bootstrap
Loader
Monitor
Flash
Monitor
Configuration File
b167nrb.sre
m167r.sre
f167.sre
inf_161u.cfg
m167ocds.sre
inf_161u_ocds.cfg
b167nrb.sre
m167r.sre
f167.sre
inf_165utah.cfg
m167ocds.sre
inf_165utah_ocds.cfg
M2 evaluation board
b167nrb.sre
m167r.sre
f167.sre
inf_sda6000.cfg
ROM/RAM Monitor
Mon53
Infineon
Bootstrap
Loader
Monitor
Flash
Monitor
Configuration File
XC161CJ (DEMUX)
bxc16xnrbe.sre
mxc16xre.sre
fxc16x.sre
inf_xc161cj_demux.cfg
XC161CJ (MUX)
bxc16xnrbe.sre
mxc16xre.sre
fxc16x.sre
inf_xc161cj_mux.cfg
fxc16xs.sre
inf_xc161cj_ocds.cfg
fxc16x.sre
inf_xc161cj_ocds_demux.cfg
fxc16x.sre
inf_xc161cj_ocds_mux.cfg
XC161CS (DEMUX)
bxc16xnrbe.sre
mxc16xre.sre
fxc16x.sre
inf_xc161cs_demux.cfg
XC161CS (MUX)
bxc16xnrbe.sre
mxc16xre.sre
fxc16x.sre
inf_xc161cs_mux.cfg
fxc16xs.sre
inf_xc161cs_ocds.cfg
fxc16x.sre
inf_xc161cs_ocds_demux.cfg
fxc16x.sre
inf_xc161cs_ocds_mux.cfg
XC164CS (DEMUX)
bxc16xnrbe.sre
mxc16xre.sre
fxc16x.sre
inf_xc164cs_demux.cfg
XC164CS (MUX)
bxc16xnrbe.sre
mxc16xre.sre
fxc16x.sre
inf_xc164cs_mux.cfg
fxc16xs.sre
inf_xc164cs_ocds.cfg
fxc16x.sre
inf_xc164cs_ocds_demux.cfg
fxc16x.sre
inf_xc164cs_ocds_mux.cfg
XC167CI (DEMUX)
bxc16xnrbe.sre
mxc16xre.sre
fxc16x.sre
inf_xc167ci_demux.cfg
XC167CI (MUX)
bxc16xnrbe.sre
mxc16xre.sre
fxc16x.sre
inf_xc167ci_mux.cfg
fxc16xs.sre
inf_xc167ci_ocds.cfg
fxc16x.sre
inf_xc167ci_ocds_demux.cfg
fxc16x.sre
inf_xc167ci_ocds_mux.cfg
Phytec
Bootstrap
Loader
Monitor
Flash
Monitor
Configuration File
b167nrb.sre
m167r.sre
f167.sre
kc161pi.cfg
b167nrb.sre
m167r.sre
f167.sre
kc161ri.cfg
KitCON161
b167nrb.sre
m167r.sre
f167.sre
kc161.cfg
b167nrb.sre
m167r.sre
f167.sre
kc161ci.cfg
b167nrb.sre
m167r.sre
f167.sre
kc161cs.cfg
b167nrb.sre
m167r.sre
f167.sre
kc161jc.cfg
KitCON163
b167nrb.sre
m167r.sre
f167.sre
kc163.cfg
KitCON164
b164nrb.sre
m164r.sre
f167.sre
kc164.cfg
KitCON165
b167nrb.sre
m167r.sre
f167.sre
kc165.cfg
KitCON167
b167nrb.sre
m167r.sre
f167.sre
kc167.cfg
b167nrb.sre
m167cr.sre
f167.sre
kc167c.cfg
Execution Environment
ROM/RAM MONITOR
Mon54
Phytec
Bootstrap
Loader
Monitor
Flash
Monitor
Configuration File
KitCON167 using
PEAKCANDongle
b167nrb.sre
m167crd.sre
f167.sre
kc167cd.cfg
MicroMODUL165
b167nrb.sre
m167r.sre
f167.sre
um165.cfg
MiniMODUL165
b167nrb.sre
m167r.sre
f167.sre
mm165.cfg
MiniMODUL167CR
b167nrb.sre
m167r.sre
f167.sre
mm167cr.cfg
MiniMODUL167CS
b167nrb.sre
m167r.sre
f167.sre
phy_167cs_mm.cfg
MiniMODUL167CW
b167nrb.sre
m167r.sre
f167.sre
mm167cw.cfg
MiniMODULST10F168
b167nrb.sre
m167r.sre
f167x.sre
mmst10f168.cfg
NanoMODUL164
b164nrb.sre
m164r.sre
f167.sre
nm164.cfg
phyCORE161CS/JC/JI
b167nrb.sre
m167r.sre
f167.sre
phy_161jc_phycore.cfg
phyCORE167
b167nrb.sre
m167r.sre
f167.sre
phy_167cs_phycore.cfg
phyCOREST10F168
b167nrb.sre
m167r.sre
f167x.sre
phy_168_phycore.cfg
phyCOREXC161CJ
bxc16xnrbe.sre
mxc16xre.sre
fxc16x.sre
phy_xc161cj_phycore.cfg
phyCOREXC161CJ with
OCDS
fxc16x.sre
phy_xc161cj_phycore_ocds.cfg
phyCOREXC167CI
bxc16xnrbe.sre
mxc16xre.sre
fxc16x.sre
phy_xc167ci_phycore.cfg
phyCOREXC167CI with
OCDS
fxc16x.sre
phy_xc167ci_phycore_ocds.cfg
Rigel Corporation
Bootstrap
Loader
Monitor
Flash
Monitor
Configuration File
RMB165
b167.sre
m167r.sre
f167.sre
rmb165.cfg
RMB167
b167.sre
m167r.sre
f167.sre
rmb167.cfg
RMB167CRI
b167.sre
m167r.sre
f167.sre
rm167cri.cfg
RMB167SR
b167.sre
m167r.sre
f167.sre
rmb167sr.cfg
STMicroelectronics
Bootstrap
Loader
Monitor
Flash
Monitor
Configuration File
bext2i.sre
mext2b.sre
fext2.sre
evasuper10.cfg
Tara Systems
Bootstrap
Loader
Monitor
Flash
Monitor
Configuration File
b167nrb.sre
m167r.sre
f167.sre
tara_sda6000.cfg
TQComponents
Bootstrap
Loader
Monitor
Flash
Monitor
Configuration File
b164nrb.sre
m164r.sre
f167.sre
tqs_164ci_tqm164c.cfg
b167nrb.sre
m167r.sre
f167.sre
tqs_165_tqm165.cfg
ROM/RAM Monitor
Mon55
TQComponents
Bootstrap
Loader
Monitor
Flash
Monitor
Configuration File
b167nrb.sre
m167r.sre
f167.sre
tqs_167cr_tqm167c.cfg
b167nrb.sre
m167r.sre
f167.sre
tqs_167cr_tqm167lc.cfg
b167nrb.sre
m167r.sre
f167.sre
tqs_167cr_tqm167u.cfg
b167nrb.sre
m167r.sre
f167.sre
tqs_167cr_tqm167ue.cfg
bxc16xnrbe.sre
mxc16xre.sre
fxc16x.sre
tqs_xc161cj_tqmx161u.cfg
bxc16xnrbe.sre
mxc16xre.sre
fxc16x.sre
tqs_xc167ci_tqmx167u.cfg
Other
Bootstrap
Loader
Monitor
Flash
Monitor
Configuration File
b167.sre
m167r.sre
f167.sre
default.cfg
rom165.cfg
rom167.cfg
Execution Environment
Mon56
ROM/RAM MONITOR
The I+ME C167C board uses the onchip BSL to load the TASKING boot
program and RAM debug monitor. Please read section 5, The RAM and
ROM Debug Monitor of this addendum first for more information on the
monitor. The following section describes some details on the configuration
for the monitor for the I+ME C167C board.
10.3.2 CONNECTION
The I+ME C167C board should be connected to the host computer using
the DSub 9 female connector. The board does not loop back handshake
signals decently, so when you have connection problems please read
section 9 Troubleshooting the Debug Monitor first.
ROM/RAM Monitor
10.4.2 CONNECTION
For using the RAM debug monitor the mode jumper should be set to 1 to
select the appropriate memory configuration. The BSL should be enabled
with a resistor of 10K between the P0.4 and signal ground.
The MM165 or MM167 board should be connected to the host computer
using the DSub 9 female connector. The board does not loop back
handshake signals decently, so when you have connection problems
please read section 9 Troubleshooting the Debug Monitor first.
Mon57
Mon58
Execution Environment
ROM/RAM MONITOR
ADDENDUM
SIMULATOR
Execution Environment
SIMULATOR
ADDENDUM
Sim2
Simulator
Sim3
1 INTRODUCTION
This addendum contains information specific to the simulator version of
CrossView Pro for the C166/ST10. The simulator use the host memory to
simulate the memory of the target. To avoid that the whole address range
(up to 16MB) of these derivatives has to be allocated on the host, a
memory map should be supplied to the simulator with the simulator
configuration file.
2 EXECUTABLE NAME
The following CrossView Pro executable is delivered with the package (for
PC with .exe extension):
xfw166
3 SUPPORTED FEATURES
Except for the restrictions mentioned in section 6, the simulator version of
the debugger cleanly supports the standard features of CrossView Pro,
including single stepping, code breakpoints, data breakpoints, trace
support, C expression evaluation and record/playback capability. The
simulator disim166 logs a user definable number of addresses of the most
recent instructions. The simulator disim166 also supports code coverage,
profiling, background debug mode and peripheral simulation.
Execution Environment
Sim4
When you use EDE, the memory settings are automatically transferred to
the debugger. All memory mappings of your applications are automatically
done by the debugger.
4 PERIPHERAL SIMULATION
The C166/ST10 simulator includes peripheral simulation for a range of
peripherals. With peripheral simulation and CXL scripting you can make
scenarios for testing (parts of) your application before hardware is
available.
SIMULATOR
Simulator
Sim5
Parallel Ports
The processor pins for parallel port Px are available in CrossView Pro as a
special register PORT_Px. The bits in these special registers are only
effective if the DPx register is set properly.
A/D Converter
You can use the CrossView Pro special register PIN_ADCx as replacement
of the A/D converter external port pin. The value of this register is the
value as put on the external ADC port pin. The type of this register is
floating point.
The A/D converter also requires a ground and reference voltage. The
special registers PIN_VAREF and PIN_VAGND are for this purpose. The
types of these registers is also floating point.
General Purpose Timers
All timers work only when there are no external inputs selected
(TxUDE=0). In all cases when the transition level is used as trigger, it only
works on the OTL level of the core timer.
The following four modes apply for all GPT timers.
TIMER_MODE:
All five timers T2, T3, T4, T5 and T6 can be used in this mode.
GATED_TIMER_MODE:
All five timers T2, T3, T4, T5 and T6 can be used in this mode.
COUNTER_MODE (timer concatenation):
Only the timers T2, T4 and T5 can be used in this mode when the
transition comes from the corresponding OTL of the core timer. This
mode is used for the concatenation of the timers.
RELOAD_MODE:
Timers T2 and T4 can be used for this mode only when the transition
comes from the corresponding OTL of the core timer. Timer T6 could
be reloaded with the value of CAPREL when the sfrbit T6SR is set.
Execution Environment
Sim6
SIMULATOR
Name
Probe point
Commands
Simulator
Sim7
5. Click OK.
6. Click OK.
It is also possible to set the breakpoint via the command window:
break CYCLES noofcycles, name=fancyname, probe_point=true,
commands=cxl "scriptname"
The noofcycles is the number representing the number of cycles
between each probe point hit. The fancyname is the name you want to
give to the probe point to recognize it easily in the breakpoint list or to be
used with other commands. The scriptname is the filename of the CXL
script.
Cycles
When writing a CXL script that is executed every number of cycles by a
cycle probe point, you have to keep in mind that the simulator is an
instruction set simulator. If an instruction takes more than one cycle, the
simulator will never break in the middle of the instruction, but completes
the whole instruction first. When the number of cycles of the cycle probe
point is elapsed in the middle of an instruction, the probe point is hit after
the instruction is finished and this may be a number of cycles later. So, the
CXL script invoked by the probe point is not always executed exactly after
the number of cycles defined with the probe point.
You have to keep this in mind when writing a CXL script that does things
depending on the cycle counter. For example, it triggers a port pin every
1000 cycles and it triggers another port pin every 2000 cycles. You will
have to round the cycle counter in the CXL script to get this done. This
means that it is inevitable that there is an inaccuracy in the timing. An
example of rounding the cycle counter:
long ccnt;
ccnt = floor( ( get( "$CCNT" ) / 20)) * 20;
Execution Environment
Sim8
The number of cycles that you fill in with the probe point is depending on
the demand of your scenario. If you need a high frequency of events, a
lower cycle count may be required than with a low frequency of events.
Keep in mind that with lower cycle counts the script is executed more
frequently, which makes the simulation slower.
As an alternative to using cycle probe points, you could also use
instruction probe points. Or if you only need certain actions at defined
points in your code you could use code probe points.
CXL and Simulator Interaction
Usually your CXL script will need some interaction with the CPUs
registers, port pins or the applications variables. CXL supports the builtin
functions get() and set() for this purpose. The C166/ST10 simulator
supports special registers that represent the processors port pins. See the
peripheral description for the names of these special registers.
Note that when supplying a register name to the get() and set()
function, the name should be prefixed by a $ to tell CrossView Pro that a
register is requested.
SIMULATOR
port
peccserial
You can use the examples as a starting point for writing your own CXL
script.
Simulator
Sim9
fieldvalue
comment
optional comment
Field
Description
title
cpu_type
Execution Environment
Sim10
Field
Description
register_file
debug_instrument_module
map_iram
map_sfr
map_ram
map_rom
psm_dll_name
SIMULATOR
Notes:
Fields not required for the target can be omitted.
CrossView Pro searches for the *.cfg files in the current directory and
in the etc directory.
Example of a part of the sim167.cfg file.
title: C167 / ST10x167 Simulator
register_file: reg167.def
debug_instrument_module: disim166
cpu_type: 167
psm_dll_name: psm166
Simulator
Sim11
With the example above, to select the SIM167 configuration the command
option would be:
tcfg sim167.cfg
Sim12
Execution Environment
SIMULATOR
ADDENDUM
ONCHIP DEBUG
SUPPORT
Execution Environment
OCDS/JTAG
ADDENDUM
OCDS2
1 INTRODUCTION
This addendum gives supporting information for use of CrossView Pro
with the onchip debug support (OCDS) of the Infineon Technologies
architectures. Part of the OCDS concept is the JTAG debug connection, an
industry standard serial connection with the MCUs inner states. OCDS
allows pervasive debugging control of the MCU.
CrossView Pro can debug with OCDS via the parallel port (LPT) or via the
Device Access Server (DAS). The DAS architecture was designed by
Infineon for multidevice multicore systems with very demanding
emulation requirements. The goal of the DAS architecture is to provide
one single interface for all types of tools. CrossView Pro works with DAS
and a USB wiggler connected to the onboard OCDS connector.
2 SUPPORTED HARDWARE
CrossView Pro supports the following hardware:
OCDS via the parallel port
EASY UTAH v1.1 evaluation board with C161U or C165UTAH
Phytec phyCore XC161CJ or XC167CI
OCDS via the Device Access Server
Starterkit XC164CM Rev 20
OCDS via the parallel port or via the Device Access Server
XC16Board Rev 200 with XC161CJ, XC164CS or XC167CI
OCDS3
Execution Environment
OCDS4
4 INSTALLATION
OCDS/JTAG
5 OCDS BREAKPOINTS
The usage of OCDS software breakpoints is limited to 64k breakpoints. A
software breakpoint is set by injecting DEBUG instructions into the
memory, so software breakpoints are only possible within RAM memory.
The OCDS has a limited number of hardware breakpoints:
4 code breakpoints or data write breakpoints, of which you can use
one for a code range breakpoint or a data range read or write
breakpoint.
or 1 data value write breakpoint
For data breakpoints, CrossView Pro always uses hardware breakpoints.
For the XC16x and XC22xx derivatives there is a CMCTR register with a
bitfield Injection Level that is influencing the OCDS breakpoints. When
the bitfield value of the Injection Level is lower than a specific interrupt
level, the interrupt could not be debugged. The default value for the
Injection Level bitfield contains the highest value, so all interrupts could
be debugged by default.
OCDS5
Execution Environment
OCDS6
subfield
fieldvalue
comment
optional comment
OCDS/JTAG
Description
title
cpu_type
OCDS7
Field
Description
register_file
debug_instrument_module
RegisterFile
init
ResetDelay
reserve
Execution Environment
OCDS8
OCDS/JTAG
Fields specific for the JTAG/OCDS connection via the parallel port:
Field
Description
monitor
JtagDriver
PeripheralsStop
Cable
ChipReset
ClientValue
OCDS9
Description
DASserver
AccessPort
TerminateServer
Execution Environment
OCDS10
LED
470
10k 10k 10k 10k 10k 10k 10k
10k
0.01
10k 10k
82
(Schottky)
13
25
0
Vcc1
1
51
a1
b1
a2
b2
a3
b3
a4
b4
a5
b5
a6
b6
b7
a7
b8
a8
a9
b9
TMS
TDO
82
82
10
82
11
12
82
13
14
15
16
82
VCC
2
GND
51
7
RESET#
GND
10k
4
TDI
TRST#
TCLK
BRK_IN#
GND
1
14
BRK_OUT#
OCDS_E#
82
Wiremount Socket
1
110
8
4
a10
b10
0.01
GND
0
2x
SN74HC244N
DB25-F
OCDS/JTAG
Number of
parts
Part
74HC244
11
10k Ohm
470 Ohm
110 Ohm
51 Ohm
82 Ohm
10 nF
LED
Schottky
OCDS11
7.1.1
Mechanical
The connector is a standard 2.54mm (0.1 inch) centers.
TMS
TDO
CPU_CLOCK
TDI
TRST
TCLK
Brk_IN
TRAP
10
11
12
13
14
15
16
VCC
GND
GND
RESET
Brk_OUT
GND
OCDS_E
Key (no Pin)
Signal description
Table OCDS3 contains the Infineon JTAG connector signals. The direction
is specified as follows:
O = output from the CPU processor board to the debugger
I
Execution Environment
OCDS12
Signal Name
Direction
Pin Number
Comment
TDO
IEEE 1149.1
TDI
IEEE 1149.1
TMS
IEEE 1149.1
TCLK
11
IEEE 1149.1
TRST
IEEE 1149.1
Brk_IN
13
Brk_OUT
10
RESET
Open collector
CPU_CLOCK
Optional
TRAP
15
TriCore only
OCDS_E
14
GND
4,6,12
VCC
Key
16
OCDS/JTAG
Frequencies
The speed of the JTAG signals must not exceed 200% of the actual CPU
clock speed.
7.1.2
OCDS13
IMPLEMENTATION CONSIDERATIONS
Pullup
OCDS_E
10k
TMS
10k
TDI
10k
TRST
10k
RESET
10k
Brk_IN
10k
TCLK
Pulldown
10k
OCDS/JTAG
OCDS14
Execution Environment
INDEX
INDEX
Index
INDEX
INDEX
Index2
Index
Index3
Symbols
. (period) operand, 318
! command, 1321
? command, 515, 1323
& operator, 318
@format code, 313
ddeservername, A28
timeout, 910
/ command, 515, 1322
/format code, 313
^ command, 1337
< command, 1324
<< command, 1325
> command, 1326
>& command, 1334
># command, 1330
>@ command, 1328
>* command, 1336
>> command, 1332
_EXT, Mon40
A
A command, 1338
a command, 1339
a166, 111
absolute file, 153
accelerator bar, 425
accelerator button, 412, 425
accessing code and data, 61
AccessPort, 124, OCDS9
AddDDEMenuEntry, A28
adding files to a project, 141
address bias, set, 13153
addresses
in expressions, 318
specifying format of, 617
application
debugging, 130
executing, 128
application notes
EVA165, Mon55
EVA167, Mon55
EVA167AA, Mon55
I+ME C167C, Mon56
PHYTEC KC161, Mon58
PHYTEC KC163, Mon58
PHYTEC KC164, Mon58
PHYTEC KC167, Mon58
PHYTEC MM165, Mon57
PHYTEC MM167CR, Mon57
PHYTEC MM167CW, Mon57
RMB165, Mon56
RMB167, Mon56
RMB167SR, Mon56
target board, Mon52
TQComponents, Mon58
ar166, 111
argument of a function, 39
arrays
display address of, 66
display character, 315, 66
displaying twodimensional, 617
viewing contents of, 316, 616
assembler, 111
assembly window
hexadecimal display, 310
intermixed assembly, 310
pipeline, 310
source merge limit, 311
assertion mode, 728, 153
assertions, 15, 728, 153
activating, 728
activating and suspending, 731
assertion mode, 728
debugging with, 733
define or modify assertion, 1339
defining, 729
deleting, 732
editing, 731
quit assertion mode, 13189
statistics, 735
Index
Index4
INDEX
B
B command, 1341
b command, 1342
b164nrb.sre, Mon8
b167.sre, Mon7
b167a.sre, Mon8
b167nrb.sre, Mon7
b167nrbe.sre, Mon8
b167snrb.sre, Mon8
background color, 25
background mode, 1123, 153
assertions, 1128
leaving, 1126
local and global variables, 1127
manual refresh, 1124
refresh limitations, 1127
running a program, 1125
stack, 1127
starting, 1125
stopping a program, 1126
updating windows, 1123
waiting, 1126
batch mode, 910
batch processing, 910
bB command, 1343
bb command, 1344
bc command, 1345
bCYC command, 1346
bcyc command, 1347
bD command, 1348
bd command, 1350
bdis command, 1352
bena command, 1353
bext2.sre, Mon7
bext2f.sre, Mon8
bext2fi.sre, Mon8
bext2i.sre, Mon8
bext2nrb.sre, Mon7
bext2nrbe.sre, Mon8
bext2nrbi.sre, Mon8
bI command, 1354
bi command, 1355
bi_me167.sre, Mon8
bias, 154
binary constants, 35
binary notation, 34
bINST command, 1356
binst command, 1357
bit, 69
bitword, 615
boot, 120, Mon36
boot program, Mon16
boot programs, Mon7
boot sequence, Mon5
bootstrap loader (BSL), Mon55
break command, 1358
breakpoint toggle, 424, 74
breakpoints, 14, 71, 1358, 154,
Mon15
and diagnostic output, 727
and multiline statements, 75
and multiple statements, 75
and statistical information, 727
attaching macros to, 721
code, 73
commands associated with, 719
conditionals, 721
count, 154
count of, 73
cycle count, 73, 1346, 1347
data, 77
data breakpoints over a range of
addresses, 711
delete, 1388
delete all, 1387
deleting, 716
disable, 717, 1352
emulator mode, 76
Index
Index5
bt command, 1363
btI command, 1364
bti command, 1365
bTIM command, 1366, 1367
bU command, 1368
bu command, 1370
bufa command, 1372
bufd command, 1373
bxc16x.sre, Mon7
bxc16xnrb.sre, Mon7
bxc16xnrbe.sre, Mon8
C
C, character constants, 36
C command, 512, 1374
C trace, 15, 1382
C++ compiler, 111
c166, 111
Cable, 123, OCDS8
cache, debugging with, 154
CAN, Mon43
interface messages, Mon45
case sensitivity, 320, 13190
casting values, 316, 616
CB command, 1375
cc166, 111
cd command, 1376
ce command, 1377
character codes, 614
character codes table, 36
character constants, 36
ChipReset, 123, OCDS8
clear command, 1378
ClientValue, 123, OCDS8
close a file I/O stream, 13128
CmdAnnotatedOutput, A11
cmdannotatedoutput, A22
cmdoutput, A21
code breakpoints
See also breakpoints
Index
INDEX
Index6
Index
Index7
functions, B9
graph functions, B13
I/O functions, B11
mathematical functions, B10
miscellaneous functions, B17
operators, B8
pointers, B7
predefined functions, B10
variables, B6
cxl_reset command, 1386
cycle count, breakpoints, 73
D
D command, 1387
d command, 1388
d166, 111
DAS, Device Access Server, OCDS3
DASserver, 124, OCDS9
data
displaying, 61
enumerated, 65
list data monitors, 13141
data analysis, 1111
add update commands, 13118
bufa, 1372
bufd, 1373
clear sequence of update commands,
13119
close window, 13120
create window, 13117
graph, 13117
graph debug, 13121
graph_add_update, 13118
graph_clear_updates, 13119
graph_close, 13120
graph_debug, 13121
graphm, 13122
graphmn, 13123
graphp, 13124
memget, 13145
Index
INDEX
Index8
E
e command, 514, 1396
Index
EasyCODE, 49
eC command, 1398
ec command, 1399
echo command, 13100
echo string to terminal, 1320
EDE, 135
build an application, 139
load files, 137
open a project, 137
select a toolchain, 136
start a new project, 140
starting, 135
edit source, 426
ei command, 13101
einit, 121, Mon38
embedded development environment.
See EDE
embedded system, 156
emulator communication setup, 124
emulator mode, 19
environment variable
LD_LIBRARY_PATH, 23
UIDPATH, 23
error messages, alphabetical listing of,
141
Esc key, 422
et command, 13102
EVA, Mon40
EVA165, application notes, Mon55
EVA167, application notes, Mon55
EVA167AA, application notes, Mon55
evaluate expression, 1317
event, A26
events, A8, A27
AssertionsChanged, A11
BreakpointsChanged, A11
CmdAnnotatedOutput, A11
CommandCanceledByUser, A9
CommandInterpreterBusy, A8
CommandInterpreterReady, A9
DestroyedAllSymbols, A11
DidAddSymbols, A11
DidDownloadImage, A11
Index9
DidLoadSymbols, A10
HaltButtonPressed, A9
MenuEntrySelected, A11
Quit, A12
Reset, A10
ResetProgram, A10
Running, A9
RunningInBackground, A9
SourceFileChanged, A10
Stopped, A9
ViewedLineNrChanged, A10
example
starting EDE, 135
using EDE, 135
using the control program, 142
using the makefile, 145
exec, A24
execext, A23
executable, building for CrossView,
135
Execute, A6
ExecuteNoWait, A7
executing an application, 128
execution control commands,
summary of, 138
execution environment, Mon1, Sim1,
OCDS1
connecting to CrossView, 46
downloading files to, 125
execution position, 53
changing the, 55
definition of, 156
sync with viewing position, 57
exit, 420
exponential notation, 35
expression evaluator, 14
expressions, 33
C character codes, 36
character constants, 36
evaluating, 611
evaluation precision, 34
floating point constants, 35
format of, 313
Index
Index10
monitoring, 612
removing monitored, 613
show, 430
special expressions, 318
specifying variables in, 38
strings, 36
watch, 430
extension language, B3
eye diagram, 1119
INDEX
F
f command, 13103
fa command, 13104
far, 68, 615
fc command, 13105
fd command, 13106
FFT power spectrum, 1115
combined with phase, 1118
multi, 1115
multi in lines, 1116
multi in lines and grid, 1117
FFT waterfall, 1115
file system simulation, 107, 156
close a stream, 13112
libraries, 108
redirect output to a file, 13113
redirection, 107, 13111
summary of commands, 1314
filenames, 23
fl command, 13107
FLASH programming, 1119
add FLASH device, 13104
check FLASH device, 13105
delete FLASH device, 13106
disable protection, 13109
FLASH monitor workspace, 13114
get protection status, 13108
list FLASH devices, 13107
protect FLASH device, 13110
flash_base_address, 119, Mon37
flash_chip, 119, Mon37
G
g command, 55, 13115
GDI, 18, 912, 913
logging, 913, 915, 917
getting started, 113
gi command, 56, 13116
global variables, 38
glossary, 151
graph command, 13117
graph_add_update command, 13118
Index
Index11
graph_clear_updates command,
13119
graph_close command, 13120
graph_debug command, 13121
graphm command, 13122
graphmn command, 13123
graphp command, 13124
GUI update suppress, 13125
gus command, 13125
H
Halt, A7
halt, A25
halt execution, 59
HaltButtonPressed, A9
Help, A20
help
online, 17, 440
summary of help commands, 1315
hexadecimal disassembly, 310
hexadecimal notation, 34
history mechanism, 156
huge, 68, 615
I
I command, 13126
I+ME C167C
application notes, Mon56
connecting to, Mon56
debug monitors, Mon56
I/O simulation, 15
defined, 157
disable streams, 107
enable streams, 107
file system simulation, 107
redirecting streams, 106
setting up streams, 104
J
JTAG, OCDS3
JtagDriver, 122, OCDS8
jump to cursor, 55
Index
Index12
K
kernel support, 17, 114
keyboard mappings, 1010
keywords, conditional, 319320
KitCon, Mon58
INDEX
L
L command, 13137
l command, 13138
l166, 111
label, in disassembly, 618
language, 31
LD_LIBRARY_PATH, 23
librarian, 111
line command, 1319
line numbers, 311
linker, 111
listing, 13138
load command, 13140
load symbol file, 13140, 13152
local variables, 37
and the stack, 37
autowatch, 432
locator, 111
logging, 912
command window output, 1332
commands and screen output, 915
debuggeremulator I/O, 1334
debuggerGDI accesses, 1336
example, 915
resume, 915
setting up, 913
start, 913
startup options, 918
stop, 917
summary of commands, 1311
suspend, 915
long integer constants, 35
M
M command, 13141
m command, 13142
m164r.sre, Mon9
m166, 111
m167cmcp.sre, Mon9
m167cr.sre, Mon9
m167crd.sre, Mon9
m167d.sre, Mon11
m167mcp.sre, Mon9
m167n.sre, Mon9
m167r.sre, Mon9
m167re.sre, Mon9
m167rvh.sre, Mon9
m167s.sre, Mon13
macro preprocessor, 111
macros, 17, 81, 157
calling other macros, 84
define, 13174
defining, 83
delete definition, 13185
deleting, 88
echo command, 13100
expanding, 85
listing, 85
parameters of, 89
reading from a file, 87
redefining, 85, 810
save, 13173
saving to a file, 86
summary of commands, 1312
using the toolbox, 811
main() function, 157
make utility, 111
makefile
automatic creation of, 141
updating, 141
makepy utility, A15
map_iram, 119, Sim10
map_ram, 119, Sim10
Index
Index13
mk166, 111
Monitor
configuration parameters, Mon18
connecting target board
CAN, Mon43
RS232, Mon41
I+ME C167C, Mon56
interface description, Mon21
rebuild, Mon16
resources used by, Mon14
startup configure at NMI, Mon20
troubleshooting, Mon50
monitor, 120, 122, Mon36, OCDS8
monitor command
BAUD_ZL, Mon33
DEBUG, Mon33
EINIT, Mon34
FILLMEM, Mon28
GO, Mon30
ILVL, Mon32
MEMTOPC, Mon24
MONADR, Mon32
MOVMEM, Mon28
NULL, Mon23
PCTOMEM, Mon24
PEEK, Mon25
POKE, Mon25
REGLOAD, Mon26
REGSAVE, Mon27
SETIP, Mon29
SHOWSTAT, Mon30
SYNC, Mon31
VERSION, Mon29
monitor data, 13141
monitor programs, Mon7
monitors, 13142
more, 310
ms command, 13150
multi FFT power spectrum, 1115
in lines, 1116
in lines and grid, 1117
mxc16xb.sre, Mon10
mxc16xd.sre, Mon11
Index
Index14
mxc16xib.sre, Mon10
mxc16xn.sre, Mon9
mxc16xr.sre, Mon9
mxc16xre.sre, Mon9
N
N command, 13152
n command, 13153
nC command, 13154
near, 68, 615
near pointer, 69
nU command, 13155
INDEX
O
o command, 13156
OCDS, OCDS1
octal constants, 35
octal notation, 34
onchip debug support, OCDS1
configuration, OCDS5
hardware, OCDS4
Infineon OCDS interface circuit,
OCDS9
installation
hardware, OCDS4
software, OCDS4
software, OCDS4
system requirements, OCDS3
open a file I/O stream, 13129, 13134
operators, 317
order of precedence, 317
using addresses, 318
opt command, 13157
optimization, and debugging, 37
options, display or set, 13157
OSEK/ORTI, 114
output paging mechanism, 310
overview, 11
P
P command, 13158
p command, 13159
packet format, A27
patches, 158
and breakpoints, 725
pC command, 13160
pd command, 13161
pe command, 13162
performing timing analysis, 16
peripheral simulation, Sim4
peripheral support, Sim4
PeripheralsStop, 122, OCDS8
PHYTEC KC161, application notes,
Mon58
PHYTEC KC163, application notes,
Mon58
PHYTEC KC164, application notes,
Mon58
PHYTEC KC167, application notes,
Mon58
PHYTEC MM165, application notes,
Mon57
PHYTEC MM167CR
application notes, Mon57
connecting to, Mon57
PHYTEC MM167CW
application notes, Mon57
connecting to, Mon57
pipeline, 310
playback, 98
calling other playback files, 99
quitting, 910
setting the type of, 99
startup options, 918
summary of commands, 1311
playback mode, 17
continuous, 1324
single step, 1325
pointer, 316, 68, 615
display character, 315, 66
Index
Index15
Q
Q command, 13166
q command, 13167
quiet breakpoint recording, 13166
Quit, A12
quit debugger, 13167
R
R command, 58, 13168
radm, 118
RAM Debug Monitor, Mon5
booting, Mon5
command set, Mon23
configurations, Mon5
resources used by, Mon14
rawmemget command, 13169
read from an I/O stream, 13131
formatted, 13132
record
commands only, 1326
CrossView Pro and emulator
commands, 1328
emulator commands only, 1330
record and playback, 91
definition of, 159
record mode, 17
recording
checking status, 96
close file for, 96
entering comments, 94
example, 97
resume, 95
start, 93
startup options, 918
stop, 96
summary of commands, 1311
suspend, 95
refresh windows, 13184
register file, 118, Mon37, Sim10,
OCDS7
Register Window, 427, 627
setup, 627
register_file, 118, Mon37, Sim10,
OCDS7
RegisterFile, 122, 123, OCDS7
registers, 311
displaying the contents of, 610
Index
Index16
INDEX
S
S command, 511, 13171
s command, 13172
save command, 13173
save on exit, 420
scoping rules and variables, 39
Index
Index17
viewing, 65
style codes, 314
symbol information, 1511
symbolic disassembly, 618
symbols, in disassembly, 310
synchronize execution and viewing
positions, 57, 13137
syscon, 121, Mon37
system stack, 621, Mon14
system startup code, 1511
T
T command, 13179
t command, 13180
Tab key, 422
target board, Mon1, Mon3
application notes, Mon52
connecting
CAN, Mon43
RS232, Mon41
connection messages, Mon47
connection problems, Mon49
selecting, Mon4, Mon39
target communication, 1511
target configuration file, 117, Mon35,
Sim9, OCDS6
example, Mon39
target program counter, 1375
target settings, 116
target state, 1315
target system, 18
task selection, 13102
td command, 13181
te command, 13182
Terminal Window, 435
keyboard mappings, 1010
setup, 436
TerminateServer, 124, OCDS9
timer breakpoints, 73
timer support, Sim5
Index
Index18
INDEX
U
u command, 13183
ubgw command, 13184
UIDPATH, 23
unset command, 13185
update command, 13186
update windows, 13183, 13184
updating makefile, 141
V
variables, 37
and case sensitivity, 320
and scoping rules, 39
casting, 37
changing, 67
determining the size of, 67
formats of, 614
global, 610
global variables, 38
local, 157
local variables, 37
scope, 159
special, 1510
special variables, Pages, 39
specifying in expressions, 38
static variables, 37
userdefined special variables, 312
ViewedLineNrChanged, A10
viewing position, 39, 53
changing the, 5457
defined, 1512
establish, 1396
establish at address, 13101
sync with execution position, 57
W
wait for target completion, 13188
waiting, 1126
window update
reactivate, 13125
suppress, 13125
Index
windows, 421
active, 416, 153
automatic switching between source
and assembly, 310
closing, 416
command window, 422
customizing, 418
data analysis window, 437
data window, 430
help window, 438
memory window, 428
opening, 415
popup, 438
register window, 427
selecting, 416
source positioning, 53
source window, 424
stack window, 433
terminal windows, 435
toolbox, 438
trace window, 434
workspace file (.cws), 133
Index19
X
x command, 13189
X Resources, 24
X Widgets, CrossView Motif, 24
X Windows
Motif environment, 23
resources, 24
xt plotting, 1114
xy plotting, 1114
xfw166, 113
xvwedit, 426
Z
Z command, 13190
INDEX
Index20
Index