Exemple #1
0
        public bool SetBreakpoint(WabbitcodeBreakpoint newBreakpoint)
        {
            if (_debugger == null || newBreakpoint == null)
            {
                return(false);
            }

            CalcLocation location = _symbolService.ListTable.GetCalcLocation(newBreakpoint.File, newBreakpoint.LineNumber + 1);

            if (location == null)
            {
                // move the breakpoint to the nearest location
                FilePath     fileName   = newBreakpoint.File;
                int          lineNumber = newBreakpoint.LineNumber;
                CalcLocation value      = _symbolService.ListTable.GetNextNearestCalcLocation(fileName, lineNumber + 1);
                if (value == null)
                {
                    return(false);
                }

                DocumentLocation newLocation = _symbolService.ListTable.GetFileLocation(value.Page, value.Address, value.IsRam);
                WabbitcodeBreakpointManager.RemoveBreakpoint(fileName, lineNumber);
                WabbitcodeBreakpointManager.AddBreakpoint(newLocation.FileName, newLocation.LineNumber - 1);
                return(true);
            }

            newBreakpoint.Page    = location.Page;
            newBreakpoint.Address = location.Address;
            newBreakpoint.IsRam   = location.IsRam;
            byte page = location.IsRam ? location.Page : (byte)(_appPage - newBreakpoint.Page);

            newBreakpoint.WabbitemuBreakpoint = _debugger.SetBreakpoint(newBreakpoint.IsRam,
                                                                        page, newBreakpoint.Address);
            return(false);
        }
Exemple #2
0
        private void breakpointGridView_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
        {
            string   value    = e.Row.Cells[1].Value.ToString();
            int      splitter = value.IndexOf(':', 4);
            FilePath file     = new FilePath(value.Substring(0, splitter));
            IProject project  = _projectService.Project;

            if (!project.IsInternal)
            {
                file = new FilePath(Path.Combine(project.ProjectDirectory, file));
            }
            int lineNum = Convert.ToInt32(value.Substring(splitter + 1, value.Length - splitter - 1));

            WabbitcodeBreakpointManager.RemoveBreakpoint(file, lineNum);
        }
Exemple #3
0
        private void delBreakToolStripButton_Click(object sender, EventArgs e)
        {
            string   value    = breakpointGridView.SelectedRows[0].Cells[1].Value.ToString();
            int      splitter = value.IndexOf(':', 4);
            FilePath file     = new FilePath(value.Substring(0, splitter));
            IProject project  = _projectService.Project;

            if (!project.IsInternal)
            {
                file = new FilePath(Path.Combine(project.ProjectDirectory, file));
            }

            int lineNum = Convert.ToInt32(value.Substring(splitter + 1, value.Length - splitter - 1));

            WabbitcodeBreakpointManager.RemoveBreakpoint(file, lineNum);
        }
Exemple #4
0
        protected override void Execute()
        {
            ITextEditor activeTextEditor = _dockingService.ActiveDocument as ITextEditor;

            if (activeTextEditor == null)
            {
                return;
            }

            FilePath             fileName   = activeTextEditor.FileName;
            int                  lineNum    = activeTextEditor.CaretLine;
            WabbitcodeBreakpoint breakpoint = WabbitcodeBreakpointManager.Breakpoints
                                              .SingleOrDefault(b => b.File == fileName && b.LineNumber == lineNum);

            if (breakpoint == null)
            {
                WabbitcodeBreakpointManager.AddBreakpoint(fileName, lineNum);
            }
            else
            {
                WabbitcodeBreakpointManager.RemoveBreakpoint(fileName, lineNum);
            }
        }
        private void okButton_Click(object sender, EventArgs e)
        {
            int lineNum;

            if (!int.TryParse(lineBox.Text, out lineNum))
            {
                return;
            }

            lineNum--;
            FilePath fileName = new FilePath(fileBox.Text);

            if (File.Exists(fileName))
            {
                AbstractUiAction.RunCommand(new GotoFileAction(fileName));
            }
            else
            {
                DockingService.ShowError("File doesn't exist!");
                return;
            }

            WabbitcodeBreakpointManager.AddBreakpoint(fileName, lineNum);
        }
 private void BreakpointManager_Added(object sender, BreakpointEventArgs e)
 {
     WabbitcodeBreakpointManager.AddBreakpoint(new FilePath(FileName), e.Breakpoint.LineNumber);
 }
Exemple #7
0
 private void delAllBreakToolStripButton_Click(object sender, EventArgs e)
 {
     WabbitcodeBreakpointManager.RemoveAllBreakpoints();
     UpdateManager();
 }