Exemplo n.º 1
0
        public void Activation()
        {
            _debugManager = IoC.Get <IDebugManager2>();

            _debugManager.DebugSessionStarted += (sender, e) => { Document = runModeDocument; IsVisible = true; };

            _debugManager.DebugSessionEnded += (sender, e) =>
            {
                Dispatcher.UIThread.InvokeAsync(() =>
                {
                    IsVisible = false;

                    Clear();
                });
            };

            _debugManager.FrameChanged += (sender, e) =>
            {
                Document = document;
                Update();
            };

            var started = Observable.FromEventPattern(_debugManager, nameof(_debugManager.TargetStarted));
            var stopped = Observable.FromEventPattern(_debugManager, nameof(_debugManager.TargetStopped));

            started.SelectMany(_ => Observable.Amb(Observable.Timer(TimeSpan.FromMilliseconds(250)).Select(o => true), stopped.Take(1).Select(o => false))).Where(timeout => timeout == true).Subscribe(s =>
            {
                Document = runModeDocument;
            });
        }
Exemplo n.º 2
0
        public void Activation()
        {
            _debugManager = IoC.Get <IDebugManager2>();

            _debugManager.DebugSessionStarted += (sender, e) => { IsVisible = true; };

            _debugManager.DebugSessionEnded += (sender, e) =>
            {
                IsVisible = false;

                // TODO clear out data ready for GC, this requires a fix in Avalonia.
                //DisassemblyData = null;
            };
        }
Exemplo n.º 3
0
        public void Activation()
        {
            _debugManager = IoC.Get <IDebugManager2>();

            _debugManager.TargetStopped += _debugManager_TargetStopped;

            _debugManager.DebugSessionStarted += (sender, e) => { IsVisible = true; };

            _debugManager.DebugSessionEnded += (sender, e) =>
            {
                IsVisible = false;
                Clear();
            };
        }
Exemplo n.º 4
0
        public void Activation()
        {
            _debugManager = IoC.Get <IDebugManager2>();

            _debugManager.TargetStopped += _debugManager_TargetStopped;

            _debugManager.DebugSessionStarted += (sender, e) => { IsVisible = true; };

            _debugManager.DebugSessionEnded += (sender, e) =>
            {
                IsVisible = false;
                Clear();
            };

            IoC.Get <IStudio>().DebugPerspective.AddOrSelectTool(this);
        }
Exemplo n.º 5
0
        public void Activation()
        {
            _debugManager = IoC.Get <IDebugManager2>();

            IoC.Get <IStudio>().DebugPerspective.AddOrSelectTool(this);

            _debugManager.DebugSessionStarted += (sender, e) => { Enabled = false; };

            _debugManager.TargetReady += (sender, e) =>
            {
                if (_debugManager.ExtendedSession != null)
                {
                    IsVisible = true;

                    var regs = _debugManager.ExtendedSession.GetRegisters();

                    Dispatcher.UIThread.InvokeAsync(() =>
                    {
                        SetRegisters(regs);
                    });
                }
            };

            _debugManager.DebugSessionEnded += (sender, e) =>
            {
                IsVisible = false;
                Clear();
            };

            _debugManager.FrameChanged += (sender, e) =>
            {
                Enabled = true;

                if (_debugManager.ExtendedSession != null)
                {
                    var changes = _debugManager.ExtendedSession.GetRegisterChanges();

                    UpdateRegisters(changes);
                }
            };

            var started = Observable.FromEventPattern(_debugManager, nameof(_debugManager.TargetStarted));
            var stopped = Observable.FromEventPattern(_debugManager, nameof(_debugManager.TargetStopped));

            started.SelectMany(_ => Observable.Amb(Observable.Timer(TimeSpan.FromMilliseconds(250)).Select(o => true), stopped.Take(1).Select(o => false))).Where(timeout => timeout == true).Subscribe(s => Enabled = false);
        }
Exemplo n.º 6
0
        public DebugCommands(CommandIconService commandIconService)
        {
            _debugManager = IoC.Get <IDebugManager2>();

            StartDebuggingCommand = new CommandDefinition(
                "Start",
                commandIconService.GetCompletionKindImage("Run"),
                ReactiveCommand.Create(StartDebugging, _debugManager.CanStart));

            PauseDebuggingCommand = new CommandDefinition(
                "Pause",
                commandIconService.GetCompletionKindImage("PauseDebugger"),
                ReactiveCommand.Create(_debugManager.Pause, _debugManager.CanPause));

            StopDebuggingCommand = new CommandDefinition(
                "Stop",
                commandIconService.GetCompletionKindImage("Stop"),
                ReactiveCommand.Create(_debugManager.Stop, _debugManager.CanStop));

            RestartDebuggingCommand = new CommandDefinition(
                "Restart",
                commandIconService.GetCompletionKindImage("Restart"),
                ReactiveCommand.Create(_debugManager.Restart, _debugManager.CanStop));

            StepOverCommand = new CommandDefinition(
                "Step Over",
                commandIconService.GetCompletionKindImage("StepOver"),
                ReactiveCommand.Create(_debugManager.StepOver, _debugManager.CanStep));;

            StepIntoCommand = new CommandDefinition(
                "Step Into",
                commandIconService.GetCompletionKindImage("StepInto"),
                ReactiveCommand.Create(_debugManager.StepInto, _debugManager.CanStep));;

            StepOutCommand = new CommandDefinition(
                "Step Out",
                commandIconService.GetCompletionKindImage("StepOut"),
                ReactiveCommand.Create(_debugManager.StepOut, _debugManager.CanStep));

            StepInstructionCommand = new CommandDefinition(
                "Step Instruction",
                null,
                ReactiveCommand.Create(_debugManager.StepInstruction, _debugManager.CanStep));
        }
Exemplo n.º 7
0
 public FrameViewModel(IDebugManager2 debugManager, StackFrame frame) : base(frame)
 {
     _debugManager = debugManager;
 }