示例#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);
        }
示例#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);
        }
示例#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);
        }
 private void BreakpointManager_Removed(object sender, BreakpointEventArgs e)
 {
     WabbitcodeBreakpointManager.RemoveBreakpoint(new FilePath(FileName), e.Breakpoint.LineNumber);
 }