コード例 #1
0
ファイル: DumpReader.cs プロジェクト: xinyanmsft/clrmd
        /// <summary>
        /// Enumerate all the native threads in the dump
        /// </summary>
        /// <returns>an enumerate of DumpThread objects</returns>
        public IEnumerable <DumpThread> EnumerateThreads()
        {
            IMinidumpThreadList list = GetThreadList();
            uint num = list.Count();

            for (uint i = 0; i < num; i++)
            {
                MINIDUMP_THREAD rawThread = list.GetElement(i);
                yield return(new DumpThread(this, rawThread));
            }
        }
コード例 #2
0
ファイル: DumpReader.cs プロジェクト: xinyanmsft/clrmd
        /// <summary>
        /// Get the thread for the given thread Id.
        /// </summary>
        /// <param name="threadId">thread Id to lookup.</param>
        /// <returns>
        /// a DumpThread object representing a thread in the dump whose thread id matches
        /// the requested id.
        /// </returns>
        public DumpThread GetThread(int threadId)
        {
            EnsureValid();
            MINIDUMP_THREAD raw = GetRawThread(threadId);

            if (raw == null)
            {
                return(null);
            }

            return(new DumpThread(this, raw));
        }
コード例 #3
0
ファイル: DumpReader.cs プロジェクト: xinyanmsft/clrmd
        // Internal helper to get the raw Minidump thread object.
        // Throws if thread is not found.
        private MINIDUMP_THREAD GetRawThread(int threadId)
        {
            IMinidumpThreadList list = GetThreadList();
            uint num = list.Count();

            for (uint i = 0; i < num; i++)
            {
                MINIDUMP_THREAD thread = list.GetElement(i);
                if (threadId == thread.ThreadId)
                {
                    return(thread);
                }
            }

            return(null);
        }
コード例 #4
0
 /// <summary>
 /// Constructor for DumpThread
 /// </summary>
 /// <param name="owner">owning DumpReader object</param>
 /// <param name="raw">unmanaged structure in dump describing the thread</param>
 internal DumpThread(DumpReader owner, MINIDUMP_THREAD raw)
 {
     _raw   = raw;
     _owner = owner;
 }