DBG C ThrdStat: Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 36: | Line 36: | ||
By repeatedly calling the DBG_C_ThrdStat command, replacing the Tid with the last returned Value until a thread ID is repeated, all threads in the process can be traversed. When used in this way, the Tids returned by the DBG_C_ThrdStat command form a loop of the debuggee's thread IDs. | By repeatedly calling the DBG_C_ThrdStat command, replacing the Tid with the last returned Value until a thread ID is repeated, all threads in the process can be traversed. When used in this way, the Tids returned by the DBG_C_ThrdStat command form a loop of the debuggee's thread IDs. | ||
[[Category:Debug Command]] |
Latest revision as of 17:06, 10 March 2020
Debug Command 17 - Get Thread Status Command
- Parameters
- Pid= Process ID of debuggee
- Tid= Thread ID of thread of interest
- Cmd= DBG_C_ThrdStat
- Buffer= Pointer to Thread Status buffer
- Len= Length of Thread Status buffer, in bytes. This value is 4.
If Tid is zero, the status of the debuggee thread most recently scheduled to run will be returned.
- Returns
Value= Thread ID of "next" active thread to examine Tid= Thread ID of thread whose status is returned Thread Status buffer= Buffer for the thread status, filled in.
Thread Status buffer format is as follows:
typedef struct _TStat { BYTE DbgState; BYTE TState; USHORT TPriority; } TStat
DbgState in the Thread Status buffer contains information about the current state of debugging, and will have one of the following values upon return:
- 0 DBG_D_Thawed
- 1 DBG_D_Frozen
TState in the Thread Status buffer contains information about the scheduling state of the thread, and will have one of the following values upon return:
- 0 DBG_T_Runnable
- 1 DBG_T_Suspended
- 2 DBG_T_Blocked
- 3 DBG_T_CritSec
TPriority in the Thread Status buffer contains the thread's base scheduling priority. This priority will be expressed as scheduling class and delta values upon return.
The Value field will be filled in with the Thread ID of the "next" thread to look at when traversing threads.
By repeatedly calling the DBG_C_ThrdStat command, replacing the Tid with the last returned Value until a thread ID is repeated, all threads in the process can be traversed. When used in this way, the Tids returned by the DBG_C_ThrdStat command form a loop of the debuggee's thread IDs.