Exemple #1
0
        /// <summary>
        /// Removes all breakpoints and reapplies them again.
        /// </summary>
        /// <param name="hasPdbChanged"></param>
        /// <param name="ct"></param>
        /// <returns></returns>
        /// <remarks>This method is required when lost contact with VICE or when debugging symbols change.</remarks>
        public async Task ReapplyBreakpoints(bool hasPdbChanged, CancellationToken ct)
        {
            var checkpointsListCommand = viceBridge.EnqueueCommand(new CheckpointListCommand());
            var checkpointsList        = await checkpointsListCommand.Response.AwaitWithLogAndTimeoutAsync(dispatcher, logger, checkpointsListCommand, ct : ct);

            if (checkpointsList is not null)
            {
                foreach (var ci in checkpointsList.Info)
                {
                    // TODO verify result
                    await DeleteCheckpointAsync(ci.CheckpointNumber, ct);
                }
            }
            var breakpoints = Breakpoints.ToImmutableArray();

            Breakpoints.Clear();
            breakpointsLinesMap.Clear();
            breakpointsMap.Clear();
            await ApplyOriginalBreakpointsAsync(breakpoints, hasPdbChanged, ct);

            logger.LogDebug("Checkpoints reapplied");
        }