|
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
|
2 "http://www.w3.org/TR/html4/loose.dtd"> |
|
3 <html><head> |
|
4 <title>Current Thread State</title> |
|
5 <link href="sysdoc-eclipse.css" type="text/css" rel="stylesheet" media="screen"> |
|
6 <link href="sysdoc-eclipse.css" type="text/css" rel="stylesheet" media="print"> |
|
7 <link href="../../book.css" type="text/css" rel="stylesheet" > |
|
8 <style type="text/css"> |
|
9 <!-- |
|
10 .style14 {font-weight: bold} |
|
11 --> |
|
12 </style> |
|
13 <div class="Head1"> |
|
14 |
|
15 <h2>Current Thread State</h2> |
|
16 </div> |
|
17 <div> |
|
18 <p>The current thread is the thread that was executing when the fault |
|
19 occurred. The 23 lines starting at line 10 of the output gives information |
|
20 relating to the current thread:</p> |
|
21 <p class="listing">TheCurrentThread=64039408<br> |
|
22 THREAD at 64039408 VPTR=f803423c AccessCount=3 Owner=64038d5c<br>Full name test2.exe::Main<br>Thread MState READY<br>Default priority 16 WaitLink Priority 16<br>ExitInfo 2,100,USER<br>Flags 00000004, Handles 640330bc<br>Supervisor stack base 6571f000 size 1000<br>User stack base 00402000 size 2000<br>Id=26, Alctr=00600000, Created alctr=00600000, Frame=00000000<br>Trap handler=00000000, ActiveScheduler=00000000, Exception handler=00000000<br>TempObj=00000000 TempAlloc=00000000 IpcCount=00000000<br>NThread @ 640396b0 Pri 16 NState READY<br>Next=640396b0 Prev=640396b0 Att=03 iUserContextType=0b<br>HeldFM=00000000 WaitFM=00000000 AddrSp=64038d5c<br>Time=17 Timeslice=20 ReqCount=0<br>SuspendCount=0 CsCount=1 CsFunction=fffffffe<br>SavedSP=6571ff34 ExtraContext=00000000 ExtraContextSize=0000<br>DACR 63990000<br>R13_USR 6571ff88 R14_USR f8025bc0 SPSR_SVC 10000004<br> |
|
23 R4 f8033794 R5 64039408 R6 640396b0 R7 f8028518<br> |
|
24 R8 640396b0 R9 640396b0 R10 00000000 R11 f80284d8<br> |
|
25 PC 00000000</p> |
|
26 <ul> |
|
27 <li> |
|
28 <p><b><a href="CrashDebuggerInfoAboutKernel.guide03.html" title="Extracting information about the kernel / Current thread state / Thread object and access count">Thread object and access count</a></b></p> |
|
29 </li> |
|
30 <li class="style14"> |
|
31 <p><a href="CrashDebuggerInfoAboutKernel.guide03.html#debugging%2einfo%2dabout%2dkernel%2ethread%2dstate%2ename" title="Extracting information about the kernel / Current thread state / The thread name">The thread name</a></p> |
|
32 </li> |
|
33 <li class="style14"> |
|
34 <p><a href="CrashDebuggerInfoAboutKernel.guide03.html#debugging%2einfo%2dabout%2dkernel%2ethread%2dstate%2estate" title="Extracting information about the kernel / Current thread state / The thread state, exit information, priority">The thread state, exit information, priority</a></p> |
|
35 </li> |
|
36 <li class="style14"> |
|
37 <p><a href="CrashDebuggerInfoAboutKernel.guide03.html#debugging%2einfo%2dabout%2dkernel%2ethread%2dstate%2eflags" title="Extracting information about the kernel / Current thread state / Thread flags">Thread flags</a></p> |
|
38 </li> |
|
39 <li class="style14"> |
|
40 <p><a href="CrashDebuggerInfoAboutKernel.guide03.html#debugging%2einfo%2dabout%2dkernel%2ethread%2dstate%2ehandles" title="Extracting information about the kernel / Current thread state / Handles">Handles</a></p> |
|
41 </li> |
|
42 <li class="style14"> |
|
43 <p><a href="CrashDebuggerInfoAboutKernel.guide03.html#debugging%2einfo%2dabout%2dkernel%2ethread%2dstate%2estack%2dadrs" title="Extracting information about the kernel / Current thread state / Kernel & user stack addresses">Kernel & user stack addresses</a></p> |
|
44 </li> |
|
45 <li class="style14"> |
|
46 <p><a href="CrashDebuggerInfoAboutKernel.guide03.html#debugging%2einfo%2dabout%2dkernel%2ethread%2dstate%2ethreadid" title="Extracting information about the kernel / Current thread state / Thread id, RAllocator instances, trap frame">Thread id, RAllocator instances, trap frame</a></p> |
|
47 </li> |
|
48 <li class="style14"> |
|
49 <p><a href="CrashDebuggerInfoAboutKernel.guide03.html#debugging%2einfo%2dabout%2dkernel%2ethread%2dstate%2etrap%2dhandler" title="Extracting information about the kernel / Current thread state / Trap handler, active scheduler, user-side exception handler">Trap handler, active scheduler and user-side exception handler</a></p> |
|
50 </li> |
|
51 <li class="style14"> |
|
52 <p><a href="CrashDebuggerInfoAboutKernel.guide03.html#debugging%2einfo%2dabout%2dkernel%2ethread%2dstate%2etemp" title="Extracting information about the kernel / Current thread state / Temporary object, temporary allocation, IPC count">Temporary object, temporary allocation, IPC count</a></p> |
|
53 </li> |
|
54 <li class="style14"> |
|
55 <p><a href="CrashDebuggerInfoAboutKernel.guide03.html#debugging%2einfo%2dabout%2dkernel%2ethread%2dstate%2enthread" title="Extracting information about the kernel / Current thread state / Underlying nanokernel thread">Underlying nanokernel thread</a></p> |
|
56 </li> |
|
57 <li class="style14"> |
|
58 <p><a href="CrashDebuggerInfoAboutKernel.guide03.html#debugging%2einfo%2dabout%2dkernel%2ethread%2dstate%2efast%2dmutexes" title="Extracting information about the kernel / Current thread state / Fast mutexes">Fast mutexes</a></p> |
|
59 </li> |
|
60 <li> |
|
61 <p><b><a href="CrashDebuggerInfoAboutKernel.guide03.html#debugging%2einfo%2dabout%2dkernel%2ethread%2dstate%2etiming" title="Extracting information about the kernel / Current thread state / Timing, request semaphore count">Timing, request semaphore count</a></b></p> |
|
62 </li> |
|
63 </ul> |
|
64 |
|
65 </div> |
|
66 <div class="Head3"> |
|
67 <h3><span class="Bodytext"><a name="debugging%2einfo%2dabout%2dkernel%2ethread%2dstate%2ethread%2dobject"></a></span>Thread object and access count</h3> |
|
68 </div><div> |
|
69 <p class="CodeBlock">THREAD at 64039408 VPTR=f803423c AccessCount=3 Owner=64038d5c</p> |
|
70 <p>The THread at field contains a pointer to the |
|
71 DThread object representing the thread.</p> |
|
72 <p>The AccessCount field contains the reference count |
|
73 on the thread object.</p> |
|
74 <p>The owner field contains a pointer to the object |
|
75 that owns this DThread object.</p> |
|
76 |
|
77 </div> |
|
78 <div class="Head3"> |
|
79 <h3><span class="Bodytext"><a name="debugging%2einfo%2dabout%2dkernel%2ethread%2dstate%2ename"></a></span>The thread name</h3> |
|
80 </div><div> |
|
81 <p class="CodeBlock">Full name test2.exe::Main</p> |
|
82 <p>The thread name is the part after the colons. The part before the |
|
83 colons is the process name. This means that the thread is called |
|
84 <b>Main</b> inside the process <b>test2.exe</b>.</p> |
|
85 |
|
86 </div> |
|
87 <div class="Head3"> |
|
88 <h3><span class="Bodytext"><a name="debugging%2einfo%2dabout%2dkernel%2ethread%2dstate%2estate"></a></span>The thread state, exit information, priority</h3> |
|
89 </div><div> |
|
90 <p class="CodeBlock">Thread MState READY<br>Default priority 16 WaitLink Priority 16<br>ExitInfo 2,100,USER</p> |
|
91 <p>The information that characterises the thread exit is described |
|
92 by ExitInfo; this is shown as exit type, exit reason and exit |
|
93 category. In this example:</p> |
|
94 <ul> |
|
95 <li> |
|
96 <p>the thread has panicked, as indicated by: <b>exit type |
|
97 2</b>; See also TExitType.</p> |
|
98 </li> |
|
99 <li> |
|
100 <p>the panic category was: <b>USER</b></p> |
|
101 </li> |
|
102 <li> |
|
103 <p>the panic number was:<b>100</b></p> |
|
104 </li> |
|
105 <li> |
|
106 <p>the thread was running or it was in a ready-to-run state: |
|
107 <b>MState READY</b></p> |
|
108 </li> |
|
109 </ul> |
|
110 <p>The priority shown is for the underlying thread, see also |
|
111 <a href="CrashDebugger_cmd_m.guide.html" title="Process, thread, stack and memory useful information / Process and thread priorities">Process and thread priorities</a>.</p> |
|
112 |
|
113 </div> |
|
114 <div class="Head3"> |
|
115 <h3><span class="Bodytext"><a name="debugging%2einfo%2dabout%2dkernel%2ethread%2dstate%2eflags"></a></span>Thread flags</h3> |
|
116 </div><div> |
|
117 <p class="CodeBlock">Flags 00000004, Handles 640330bc</p> |
|
118 <p>The Flags field contains information about the state |
|
119 of the thread. The possible values in this field are defined by the |
|
120 KThread... constants in u32std.h. While the symbols |
|
121 are internal to Symbian OS, the following table summarises the values and their |
|
122 meaning.</p> |
|
123 <table cellpadding="1" border="0" cellspacing="0"><tr><td |
|
124 class="TableWrap"><table cellpadding="5" cellspacing="1" |
|
125 border="0"><tr valign="top"><td class="Cell"> |
|
126 <p><b>Symbol</b></p></td><td class="Cell"> |
|
127 <p><b>Value</b></p></td><td class="Cell"> |
|
128 <p><b>Meaning</b></p></td></tr> |
|
129 <tr valign="top"><td class="Cell"> |
|
130 <p>KThreadFlagProcessCritical</p></td><td class="Cell"> |
|
131 <p>0x00000001</p></td><td class="Cell"> |
|
132 <p>A thread panic causes the process to |
|
133 panic.</p></td></tr> |
|
134 <tr valign="top"><td class="Cell"> |
|
135 <p>KThreadFlagProcessPermanent</p></td><td class="Cell"> |
|
136 <p>0x00000002</p></td><td class="Cell"> |
|
137 <p>If the thread exits for any reason, then this causes the |
|
138 process to exit.</p></td></tr> |
|
139 <tr valign="top"><td class="Cell"> |
|
140 <p>KThreadFlagSystemCritical</p></td><td class="Cell"> |
|
141 <p>0x00000004</p></td><td class="Cell"> |
|
142 <p>If the thread panics, then this causes the entire system to |
|
143 reboot.</p></td></tr> |
|
144 <tr valign="top"><td class="Cell"> |
|
145 <p>KThreadFlagSystemPermanent</p></td><td class="Cell"> |
|
146 <p>0x00000008</p></td><td class="Cell"> |
|
147 <p>If the thread exits for any reason, then this causes the |
|
148 entire system to reboot.</p></td></tr> |
|
149 <tr valign="top"><td class="Cell"> |
|
150 <p>KThreadFlagOriginal</p></td><td class="Cell"> |
|
151 <p>0x00000010</p></td><td class="Cell"> |
|
152 <p>Reserved for future use.</p></td></tr> |
|
153 <tr valign="top"><td class="Cell"> |
|
154 <p>KThreadFlagLastChance</p></td><td class="Cell"> |
|
155 <p>0x00000020</p></td><td class="Cell"> |
|
156 <p>Set if the thread is currently handling an |
|
157 exception.</p></td></tr> |
|
158 </table></td></tr></table> |
|
159 |
|
160 </div> |
|
161 <div class="Head3"> |
|
162 <h3><span class="Bodytext"><a name="debugging%2einfo%2dabout%2dkernel%2ethread%2dstate%2ehandles"></a></span>Handles</h3> |
|
163 </div><div> |
|
164 <p class="CodeBlock">Flags 00000004, Handles 640330bc</p> |
|
165 <p>The Handles field contains the address of a |
|
166 DObjectIx object that contains the handles owned by the |
|
167 thread.</p> |
|
168 |
|
169 </div> |
|
170 <div class="Head3"> |
|
171 <h3><span class="Bodytext"><a name="debugging%2einfo%2dabout%2dkernel%2ethread%2dstate%2estack%2dadrs"></a></span>Kernel & user stack addresses</h3> |
|
172 </div><div> |
|
173 <p class="CodeBlock">Supervisor stack base 6571f000 size 1000<br>User stack base 00402000 size 2000</p> |
|
174 <p>These fields give the base address and size, in bytes, of the |
|
175 kernel and user stacks respectively.</p> |
|
176 |
|
177 </div> |
|
178 <div class="Head3"> |
|
179 <h3><span class="Bodytext"><a name="debugging%2einfo%2dabout%2dkernel%2ethread%2dstate%2ethreadid"></a></span>Thread id, RAllocator instances, trap frame</h3> |
|
180 </div><div> |
|
181 <p class="CodeBlock">Id=26, Alctr=00600000, Created alctr=00600000, Frame=00000000</p> |
|
182 <p>The Id field contains the thread id.</p> |
|
183 <p>The Alctr field contains a pointer to the current RAllocator instance used for heap allocation.</p> |
|
184 <p>The Created alctr field contains a pointer to the |
|
185 original RAllocator instance used for heap allocation. |
|
186 This may be different from the current instance if User::SwitchAllocator() has been called.</p> |
|
187 <p>The Frame field contains a pointer to the current |
|
188 trap frame, an instance of the TTrap class, on the cleanup |
|
189 stack.</p> |
|
190 |
|
191 </div> |
|
192 <div class="Head3"> |
|
193 <h3><span class="Bodytext"><a name="debugging%2einfo%2dabout%2dkernel%2ethread%2dstate%2etrap%2dhandler"></a></span>Trap handler, active scheduler, user-side exception |
|
194 handler</h3> |
|
195 </div><div> |
|
196 <p class="CodeBlock">Trap handler=00000000, ActiveScheduler=00000000, Exception handler=00000000</p> |
|
197 <p>The Trap handler field contains a pointer to the |
|
198 current trap handler, an instance of TTrapHandler, for the |
|
199 cleanup stack.</p> |
|
200 <p>The ActiveScheduler field contains a pointer to the |
|
201 current active scheduler.</p> |
|
202 <p> The Exception handler field contains a pointer to |
|
203 the current user-side exception handler.</p> |
|
204 |
|
205 </div> |
|
206 <div class="Head3"> |
|
207 <h3><span class="Bodytext"><a name="debugging%2einfo%2dabout%2dkernel%2ethread%2dstate%2etemp"></a></span>Temporary object, temporary allocation, IPC |
|
208 count</h3> |
|
209 </div><div> |
|
210 <p class="CodeBlock">TempObj=00000000 TempAlloc=00000000 IpcCount=00000000</p> |
|
211 <p>The Tempobj field contains a pointer to an instance |
|
212 of a DObject derived class that must be closed when the |
|
213 thread terminates.</p> |
|
214 <p>The TempAlloc field contains a pointer to a kernel |
|
215 heap cell that must be freed when the thread terminates. Both this and |
|
216 Tempobj are used to avoid leaks if the thread terminates |
|
217 unexpectedly.</p> |
|
218 <p>The IpcCount field contains the number of messages |
|
219 currently queued to this thread.</p> |
|
220 |
|
221 </div> |
|
222 <div class="Head3"> |
|
223 <h3><span class="Bodytext"><a name="debugging%2einfo%2dabout%2dkernel%2ethread%2dstate%2enthread"></a></span>Underlying nanokernel thread</h3> |
|
224 </div><div> |
|
225 <p class="CodeBlock">NThread @ 640396b0 Pri 16 NState READY<br>Next=640396b0 Prev=640396b0 Att=03 iUserContextType=0b</p> |
|
226 <p>The NThread field contains a pointer to the |
|
227 underlying nanokernel thread object, an instance of the |
|
228 NThread class.</p> |
|
229 <p>The Pri field contains the current priority of the |
|
230 underlying nanokernel thread.</p> |
|
231 <p> The NState field shows the current state of the |
|
232 underlying nanokernel thread. Note that this state is often referred to as the |
|
233 N-state, as compared to the to M-state, the state of a Symbian OS thread. See |
|
234 the <a href="CrashDebugger_cmd_m.guide.html" title="Process, thread, stack and memory useful information / Thread state summary">Thread state summary</a>.</p> |
|
235 <p>The Next field points to the next nanokernel thread |
|
236 object.</p> |
|
237 <p>The Prev field points to the previous nanokernel |
|
238 thread object.</p> |
|
239 <p>The Att field contains the nanokernel thread |
|
240 attributes, which is an 8-bit mask that controls how the thread is scheduled in |
|
241 certain cases. Two attributes are defined:</p><table cellpadding="1" border="0" cellspacing="0"><tr><td |
|
242 class="TableWrap"><table cellpadding="5" cellspacing="1" |
|
243 border="0"><tr valign="top"><td class="Cell"> |
|
244 <p> KThreadAttImplicitSystemLock</p></td><td class="Cell"> |
|
245 <p> This attribute signifies that the thread may not be |
|
246 scheduled if another thread currently holds the system lock, unless the the |
|
247 former thread holds another fast mutex. This attribute is used in implementing |
|
248 address space switching in the moving memory model and also in implementing |
|
249 change of user context in order to allow exceptions to be raised on other |
|
250 threads.</p></td></tr><tr valign="top"><td class="Cell"> |
|
251 <p>KThreadAttAddressSpace</p></td><td class="Cell"> |
|
252 <p>This attribute signifies that the thread may require a |
|
253 change of address space to schedule it. This attribute is used in conjunction |
|
254 with the thread’s iAddressSpace field; if this does not match the |
|
255 scheduler’s iAddressSpace field at the point where the thread is |
|
256 scheduled an address space switch will occur. Note that this is not required if |
|
257 the address space change is limited to the ARM domain permissions since these |
|
258 are saved and restored as part of the thread context.</p></td></tr></table></td></tr></table> |
|
259 |
|
260 </div> |
|
261 <div class="Head3"> |
|
262 <h3><span class="Bodytext"><a name="debugging%2einfo%2dabout%2dkernel%2ethread%2dstate%2efast%2dmutexes"></a></span>Fast mutexes</h3> |
|
263 </div><div> |
|
264 <p class="CodeBlock">HeldFM=00000000 WaitFM=00000000 AddrSp=64038d5c</p> |
|
265 <p>The HeldFM field contains a pointer to the fast |
|
266 mutex held by this thread; this is NULL if no fast mutext was held.</p> |
|
267 <p>The WaitFM field contains a pointer to the fast |
|
268 mutex that this thread was waiting on; this is NULL if this thread was not |
|
269 waiting on a fast mutex.</p> |
|
270 <p>The AddrSp field is the address space identifier |
|
271 used by the scheduler to determine whether an address space change is required |
|
272 when scheduling in a new thread.</p> |
|
273 |
|
274 </div> |
|
275 <div class="Head3"> |
|
276 <h3><span class="Bodytext"><a name="debugging%2einfo%2dabout%2dkernel%2ethread%2dstate%2etiming"></a></span>Timing, request semaphore count</h3> |
|
277 </div><div> |
|
278 <p class="CodeBlock">Time=17 Timeslice=20 ReqCount=0</p> |
|
279 <p>The Time field contains the number of nanokernel |
|
280 ticks, usually in milliseconds, to go before the thread is preempted.</p> |
|
281 <p>The Timeslice field contains the maximum number of |
|
282 ticks for which the thread can run before being preempted.</p> |
|
283 <p>The ReqCount contains the request semaphore counter. |
|
284 If the value is negative, then the thread is blocked waiting for a request to |
|
285 complete; if it is positive, then one or more requests have completed.</p> |
|
286 |
|
287 </div><div class="Head3"> |
|
288 <h3><span class="Bodytext"><a name="debugging%2einfo%2dabout%2dkernel%2ethread%2dstate%2esuspend"></a></span>Suspend count, critical section counter, register |
|
289 values</h3> |
|
290 </div> |
|
291 <div> |
|
292 <p class="CodeBlock">SuspendCount=0 CsCount=1 CsFunction=fffffffe<br>SavedSP=6571ff34 ExtraContext=00000000 ExtraContextSize=0000<br>DACR 63990000<br>R13_USR 6571ff88 R14_USR f8025bc0 SPSR_SVC 10000004<br> R4 f8033794 R5 64039408 R6 640396b0 R7 f8028518<br> R8 640396b0 R9 640396b0 R10 00000000 R11 f80284d8<br> PC 00000000</p> |
|
293 <p>The SuspendCount field contains the number of times |
|
294 that the thread has been suspended.</p> |
|
295 <p>The CsCount field critical section counter. When |
|
296 this value is greater than zero, then the thread is in a critical section and |
|
297 cannot be suspended or killed.</p> |
|
298 <p>The remaining content is a list of register values. <em>Note |
|
299 that they are not the register values when the thread panicked.</em> They are |
|
300 the values in the registers the last time that this thread was |
|
301 pre-empted.</p> |
|
302 </div> |
|
303 <h5>Related tasks</h5> |
|
304 <ul> |
|
305 <li><a href="CrashDebuggerInfoAboutKernel.guide.html">Extracting Kernel Information</a> </li> |
|
306 <li><a href="CrashDebuggerInfoAboutKernel.guide02.html">Scheduler State</a></li> |
|
307 <li><a href="CrashDebuggerInfoAboutKernel.guide04.html">Current Process State</a></li> |
|
308 <li><a href="CrashDebuggerInfoAboutKernel.guide05.html">Current Data Section Process</a></li> |
|
309 </ul> |
|
310 <div id="footer">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. <br>License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div> |
|
311 </body> |
|
312 </html> |
|
313 |