Ejemplo n.º 1
0
        internal bool GetEnableDisableBreakpointsInfo(out int count)
        {
            count = 0;
            var textView = MainWindow.Instance.ActiveTextView;

            if (textView == null)
            {
                return(false);
            }
            var location = textView.TextEditor.TextArea.Caret.Location;
            var ilbps    = BreakpointHelper.GetILCodeBreakpoints(textView, location.Line, location.Column);

            count = ilbps.Count;
            return(BreakpointHelper.IsEnabled(ilbps));
        }
Ejemplo n.º 2
0
        public bool ToggleBreakpoint()
        {
            if (!CanToggleBreakpoint)
            {
                return(false);
            }

            var textView = MainWindow.Instance.ActiveTextView;

            if (textView == null)
            {
                return(false);
            }
            var location = textView.TextEditor.TextArea.Caret.Location;

            BreakpointHelper.Toggle(textView, location.Line, location.Column);
            return(true);
        }
Ejemplo n.º 3
0
        public bool DisableBreakpoint()
        {
            if (!CanDisableBreakpoint)
            {
                return(false);
            }

            var textView = MainWindow.Instance.ActiveTextView;

            if (textView == null)
            {
                return(false);
            }
            var  location  = textView.TextEditor.TextArea.Caret.Location;
            var  ilbps     = BreakpointHelper.GetILCodeBreakpoints(textView, location.Line, location.Column);
            bool isEnabled = BreakpointHelper.IsEnabled(ilbps);

            foreach (var ilbp in ilbps)
            {
                ilbp.IsEnabled = !isEnabled;
            }
            return(ilbps.Count > 0);
        }
Ejemplo n.º 4
0
 private void AddBreakpoints(List <WorkspaceBreakpoint> breakpoints)
 {
     using (var breakpointHelper = new BreakpointHelper())
     {
         breakpoints.ForEach(b =>
         {
             try
             {
                 if (breakpointHelper.CanBreakpointBeSet(b.Filename, b.Line))
                 {
                     _dte.Debugger.Breakpoints.Add(File: b.Filename, Line: b.Line);
                 }
                 else
                 {
                     WorkspaceLogger.Log.Info($"Breakpoint skipped: {b.Filename}; {b.Line}");
                 }
             }
             catch (COMException e)
             {
                 WorkspaceLogger.Log.Info($"Filename: {b.Filename}; Line: {b.Line}");
                 WorkspaceLogger.Log.Error(e);
             }
             catch (Exception e)
             {
                 WorkspaceLogger.Log.Error(e);
             }
         });
     }
     foreach (Breakpoint breakpoint in _dte.Debugger.Breakpoints)
     {
         var wsBreak = breakpoints.FirstOrDefault(b => b.Filename == breakpoint.File && b.Line == breakpoint.FileLine);
         if (wsBreak != null)
         {
             breakpoint.Enabled = wsBreak.Enabled;
         }
     }
 }
Ejemplo n.º 5
0
 internal void Toggle(DecompilerTextView textView, int line, int column = 0)
 {
     BreakpointHelper.Toggle(textView, line, column);
 }