コード例 #1
0
ファイル: VSDebuggerProxy.cs プロジェクト: leculver/WinDbgCs
        public Tuple <uint, uint>[] GetProcessThreads(uint processId)
        {
            return(ExecuteOnDkmInitializedThread(() =>
            {
                DkmProcess process = GetProcess(processId);
                DkmThread[] threads = process.GetThreads();
                Tuple <uint, uint>[] result = new Tuple <uint, uint> [threads.Length];

                lock (this.threads)
                {
                    for (int i = 0; i < result.Length; i++)
                    {
                        result[i] = Tuple.Create((uint)this.threads.Count, (uint)threads[i].SystemPart.Id);
                        this.threads.Add(new ThreadStruct()
                        {
                            Thread = threads[i],
                            Frames = new SimpleCache <DkmStackFrame[]>(() =>
                            {
                                throw new NotImplementedException("You should first enumerate process threads!");
                            }),
                        });
                    }
                }

                return result;
            }));
        }
コード例 #2
0
ファイル: RemoteComponent.cs プロジェクト: zyxws012/PTVS
            public override GetCurrentFrameInfoResponse Handle(DkmProcess process)
            {
                var thread   = process.GetThreads().Single(t => t.UniqueId == ThreadId);
                var response = new GetCurrentFrameInfoResponse();

                thread.GetCurrentFrameInfo(out response.RetAddr, out response.FrameBase, out response.VFrame);
                return(response);
            }
コード例 #3
0
ファイル: LocalComponent.cs プロジェクト: krus/PTVS
            public override void Handle(DkmProcess process)
            {
                var ee = process.GetDataItem <ExpressionEvaluator>();

                if (ee != null)
                {
                    var thread = process.GetThreads().Single(t => t.UniqueId == ThreadId);
                    ee.OnAsyncBreakComplete(thread);
                }
            }
コード例 #4
0
ファイル: RemoteComponent.cs プロジェクト: zyxws012/PTVS
            public override void Handle(DkmProcess process)
            {
                var thread  = process.GetThreads().Single(t => t.UniqueId == ThreadId);
                var excInfo = DkmCustomExceptionInformation.Create(
                    process.GetPythonRuntimeInstance(), Guids.PythonExceptionCategoryGuid, thread, null, Name, 0,
                    DkmExceptionProcessingStage.Thrown | DkmExceptionProcessingStage.UserVisible | DkmExceptionProcessingStage.UserCodeSearch,
                    null, new ReadOnlyCollection <byte>(AdditionalInformation));

                excInfo.OnDebugMonitorException();
            }
コード例 #5
0
ファイル: LocalComponent.cs プロジェクト: krus/PTVS
            public override void Handle(DkmProcess process)
            {
                var traceHelper = process.GetDataItem <TraceManagerLocalHelper>();

                if (traceHelper == null)
                {
                    Debug.Fail("LocalComponent received a BeginStepInNotification, but there is no TraceManagerLocalHelper to handle it.");
                    throw new InvalidOperationException();
                }

                var thread = process.GetThreads().Single(t => t.UniqueId == ThreadId);

                traceHelper.OnBeginStepIn(thread);
            }
コード例 #6
0
            public override void Handle(DkmProcess process)
            {
                var thread             = process.GetThreads().Single(t => t.UniqueId == ThreadId);
                var runtimeBreakpoints = process.GetDataItem <RuntimeDllBreakpoints>();

                if (runtimeBreakpoints.Handlers.TryGetValue(BreakpointId, out RuntimeDllBreakpointHandler handler))
                {
                    handler(thread, FrameBase, VFrame, ReturnAddress);
                }
                else
                {
                    Debug.Fail("LocalComponent received a HandleBreakpointRequest for a breakpoint that it does not know about.");
                }
            }
コード例 #7
0
ファイル: RemoteComponent.cs プロジェクト: zyxws012/PTVS
            public override void Handle(DkmProcess process)
            {
                var thread = process.GetThreads().Single(t => t.UniqueId == ThreadId);

                thread.EndFuncEvalExecution(DkmFuncEvalFlags.None);
            }