0
|
1 |
; Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
; All rights reserved.
|
|
3 |
; This component and the accompanying materials are made available
|
|
4 |
; under the terms of the License "Eclipse Public License v1.0"
|
|
5 |
; which accompanies this distribution, and is available
|
|
6 |
; at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
;
|
|
8 |
; Initial Contributors:
|
|
9 |
; Nokia Corporation - initial contribution.
|
|
10 |
;
|
|
11 |
; Contributors:
|
|
12 |
;
|
|
13 |
; Description:
|
|
14 |
;
|
|
15 |
|
|
16 |
AREA |d-rmdebug-bkpt$$Code|, CODE, READONLY, ALIGN=6
|
|
17 |
|
|
18 |
CODE32
|
|
19 |
|
|
20 |
; ARM tests
|
|
21 |
|
|
22 |
;
|
|
23 |
; Non-PC modifying
|
|
24 |
;
|
|
25 |
EXPORT RMDebug_StepTest_Non_PC_Modifying
|
|
26 |
EXPORT RMDebug_StepTest_Non_PC_Modifying_OK
|
|
27 |
|
|
28 |
RMDebug_StepTest_Non_PC_Modifying
|
|
29 |
mov r0,r0 ; nop
|
|
30 |
RMDebug_StepTest_Non_PC_Modifying_OK
|
|
31 |
bx lr ; should return to normal execution of the test thread
|
|
32 |
|
|
33 |
;
|
|
34 |
; Branch
|
|
35 |
;
|
|
36 |
EXPORT RMDebug_StepTest_Branch
|
|
37 |
EXPORT RMDebug_StepTest_Branch_1
|
|
38 |
|
|
39 |
RMDebug_StepTest_Branch
|
|
40 |
b RMDebug_StepTest_Branch_1
|
|
41 |
mov r0, #2 ; if the pc ends up here, we know its gone wrong
|
|
42 |
RMDebug_StepTest_Branch_1
|
|
43 |
bx lr ; return
|
|
44 |
|
|
45 |
;
|
|
46 |
; Branch and Link
|
|
47 |
;
|
|
48 |
EXPORT RMDebug_StepTest_Branch_And_Link
|
|
49 |
EXPORT RMDebug_StepTest_Branch_And_Link_1
|
|
50 |
EXPORT RMDebug_StepTest_Branch_And_Link_2
|
|
51 |
|
|
52 |
RMDebug_StepTest_Branch_And_Link
|
|
53 |
mov r0, lr ; preserve lr for the moment
|
|
54 |
RMDebug_StepTest_Branch_And_Link_1
|
|
55 |
bl RMDebug_StepTest_Branch_And_Link_2
|
|
56 |
mov r1, #1 ; insert a gap in the instruction stream so we know we branched.
|
|
57 |
RMDebug_StepTest_Branch_And_Link_2
|
|
58 |
mov lr, r0 ; restore lr
|
|
59 |
bx lr ; should return to normal execution of the test thread
|
|
60 |
|
|
61 |
;
|
|
62 |
; MOV PC
|
|
63 |
;
|
|
64 |
EXPORT RMDebug_StepTest_MOV_PC
|
|
65 |
EXPORT RMDebug_StepTest_MOV_PC_1
|
|
66 |
EXPORT RMDebug_StepTest_MOV_PC_2
|
|
67 |
|
|
68 |
RMDebug_StepTest_MOV_PC
|
|
69 |
mov r0, #4
|
|
70 |
RMDebug_StepTest_MOV_PC_1
|
|
71 |
add pc, pc, r0 ; should be a jump (bear in mind reading pc = current inst + 8bytes for arm)
|
|
72 |
mov r0, #1 ; Simple instructions which allow us to test where the PC really is
|
|
73 |
mov r0, #2 ; just by reading r0.
|
|
74 |
RMDebug_StepTest_MOV_PC_2
|
|
75 |
mov r0, #3 ;
|
|
76 |
mov r0, #4 ;
|
|
77 |
bx lr ; should return to normal execution of the test thread
|
|
78 |
|
|
79 |
;
|
|
80 |
; LDR PC
|
|
81 |
;
|
|
82 |
EXPORT RMDebug_StepTest_LDR_PC
|
|
83 |
EXPORT RMDebug_StepTest_LDR_PC_1
|
|
84 |
|
|
85 |
RMDebug_StepTest_LDR_PC
|
|
86 |
ldr pc, =RMDebug_StepTest_LDR_PC_1
|
|
87 |
mov r0, #1 ; separate the branch target so we can prove it works
|
|
88 |
RMDebug_StepTest_LDR_PC_1
|
|
89 |
bx lr ; should return to normal execution of the test thread
|
|
90 |
|
|
91 |
;
|
|
92 |
; Stepping performance tests
|
|
93 |
;
|
|
94 |
; This counts down from 100000 to 0
|
|
95 |
; This means that for all practical purposes
|
|
96 |
; we can single-step as much as we like
|
|
97 |
; in less than one second and have some likelyhood
|
|
98 |
; that we will not step too far from our loop
|
|
99 |
|
|
100 |
EXPORT RMDebug_StepTest_Count
|
|
101 |
EXPORT RMDebug_StepTest_Count_1
|
|
102 |
EXPORT RMDebug_StepTest_Count_2
|
|
103 |
|
|
104 |
RMDebug_StepTest_Count
|
|
105 |
ldr r2, =100000
|
|
106 |
RMDebug_StepTest_Count_1
|
|
107 |
subs r2, r2, #1
|
|
108 |
RMDebug_StepTest_Count_2
|
|
109 |
bne RMDebug_StepTest_Count_1
|
|
110 |
bx lr
|
|
111 |
|
|
112 |
;
|
|
113 |
; ARM multiple-step ( 5 steps )
|
|
114 |
;
|
|
115 |
EXPORT RMDebug_StepTest_ARM_Step_Multiple
|
|
116 |
EXPORT RMDebug_StepTest_ARM_Step_Multiple_1
|
|
117 |
|
|
118 |
RMDebug_StepTest_ARM_Step_Multiple
|
|
119 |
mov r0,r0 ; nop
|
|
120 |
mov r0,r0 ; nop
|
|
121 |
mov r0,r0 ; nop
|
|
122 |
mov r0,r0 ; nop
|
|
123 |
mov r0,r0 ; nop
|
|
124 |
RMDebug_StepTest_ARM_Step_Multiple_1
|
|
125 |
bx lr
|
|
126 |
|
|
127 |
END
|
|
128 |
|
|
129 |
; End of file - d_rmdebug_step_test_armv4.s
|