2
using System.Threading;
4
namespace Mono.Debugger.Soft
6
public class ThreadMirror : ObjectMirror
10
internal ThreadMirror (VirtualMachine vm, long id) : base (vm, id) {
13
// FIXME: Cache, invalidate when the thread/runtime is resumed
14
public StackFrame[] GetFrames () {
15
FrameInfo[] frame_info = vm.conn.Thread_GetFrameInfo (id, 0, -1);
17
StackFrame[] frames = new StackFrame [frame_info.Length];
18
for (int i = 0; i < frame_info.Length; ++i) {
19
FrameInfo info = (FrameInfo)frame_info [i];
20
MethodMirror method = vm.GetMethod (info.method);
21
frames [i] = new StackFrame (vm, info.id, this, method, info.il_offset, info.flags);
30
name = vm.conn.Thread_GetName (id);
41
public ThreadState ThreadState {
43
return (ThreadState)vm.conn.Thread_GetState (id);
47
public bool IsThreadPoolThread {
49
ThreadInfo info = vm.conn.Thread_GetInfo (id);
51
return info.is_thread_pool;
56
* Return a unique identifier for this thread, multiple ThreadMirror objects
57
* may have the same ThreadId because of appdomains.
59
public long ThreadId {
61
return vm.conn.Thread_GetId (id);
66
* Return the system thread id (TID) for this thread, this id is not unique since
67
* a newly started thread might reuse a dead thread's id.
71
return vm.conn.Thread_GetTID (id);