int IDebugBoundBreakpoint2.GetHitCount(out uint pdwHitCount) { var remoteProcess = _engine.Process as PythonRemoteProcess; if (remoteProcess != null && remoteProcess.TargetHostType == AD7Engine.TargetUwp) { // Target is UWP host and we will just assume breakpoint hit count is 1 from this // remote debug type due to issues with communicating this command pdwHitCount = 1; } else { var task = _breakpoint.GetHitCountAsync(); pdwHitCount = (uint)task.GetAwaiter().GetResult(); } return(VSConstants.S_OK); }
int IDebugBoundBreakpoint2.GetHitCount(out uint pdwHitCount) { var remoteProcess = _engine.Process as PythonRemoteProcess; if (remoteProcess != null && remoteProcess.TargetHostType == AD7Engine.TargetUwp) { // Target is UWP host and we will just assume breakpoint hit count is 1 from this // remote debug type due to issues with communicating this command pdwHitCount = 1; } else { pdwHitCount = (uint)TaskHelpers.RunSynchronouslyOnUIThread(async ct => { var timeoutToken = remoteProcess != null ? CancellationTokens.After5s : CancellationTokens.After1s; var linkedSource = CancellationTokenSource.CreateLinkedTokenSource(ct, timeoutToken); return(await _breakpoint.GetHitCountAsync(linkedSource.Token)); }); } return(VSConstants.S_OK); }
int IDebugBoundBreakpoint2.GetHitCount(out uint pdwHitCount) { var remoteProcess = _engine.Process as PythonRemoteProcess; if (remoteProcess != null && remoteProcess.TargetHostType == AD7Engine.TargetUwp) { // Target is UWP host and we will just assume breakpoint hit count is 1 from this // remote debug type due to issues with communicating this command pdwHitCount = 1; } else { var task = _breakpoint.GetHitCountAsync(); try { if (!task.Wait(remoteProcess != null ? 5000 : 1000)) { pdwHitCount = 0; return(VSConstants.E_FAIL); } pdwHitCount = (uint)task.Result; } catch (AggregateException ae) { if (ae.InnerExceptions.OfType <OperationCanceledException>().Any()) { pdwHitCount = 1; } else if (ae.InnerExceptions.Count == 1) { throw ae.InnerException; } else { throw; } } } return(VSConstants.S_OK); }
int IDebugBoundBreakpoint2.GetHitCount(out uint pdwHitCount) { pdwHitCount = (uint)_breakpoint.GetHitCountAsync().GetAwaiter().GetResult(); return(VSConstants.S_OK); }