예제 #1
0
        private ThreadsMessageResult DoGetThreads()
        {
            uint threadCount;
            var hr = _systemObjects.GetNumberThreads(out threadCount);
            if (hr != HResult.Ok)
                return new ThreadsMessageResult(Enumerable.Empty<DebuggeeThread>());

            uint[] engineIds = new uint[threadCount];
            uint[] systemIds = new uint[threadCount];
            hr = _systemObjects.GetThreadIdsByIndex(0, threadCount, engineIds, systemIds);
            if (hr != HResult.Ok)
                return new ThreadsMessageResult(Enumerable.Empty<DebuggeeThread>());

            var threads = systemIds.Select(x => new DebuggeeThread((int)x, null));
            State.SetThreads(threads);

            return new ThreadsMessageResult(threads);
        }