public bool OnInitialBreakpointReached(int Address, int BreakpointIndex) { if (BreakpointsToAddAfterStartup.Count == 0) { return(false); } // now add all later breakpoints foreach (Types.Breakpoint bp in BreakpointsToAddAfterStartup) { if ((bp.TriggerOnLoad) || (bp.TriggerOnStore)) { if (bp.TriggerOnExec) { // this was already added, remove Debugger.DeleteBreakpoint(bp.RemoteIndex, bp); bp.RemoteIndex = -1; } /* * VICERemoteDebugger.RequestData delData = new VICERemoteDebugger.RequestData( VICERemoteDebugger.Request.ADD_BREAKPOINT, bp.Address ); * delData.Breakpoint = bp; * Debugger.QueueRequest( delData ); */ Debugger.AddBreakpoint(bp); } } // only auto-go on if the initial break point was not the fake first breakpoint if (Address != LateBreakpointOverrideDebugStart) { // need to add new intermediate break point Types.Breakpoint bpTemp = new C64Studio.Types.Breakpoint(); bpTemp.Address = LateBreakpointOverrideDebugStart; bpTemp.TriggerOnExec = true; bpTemp.Temporary = true; Debugger.AddBreakpoint(bpTemp); /* * RemoteDebugger.RequestData addNewBP = new RemoteDebugger.RequestData( RemoteDebugger.Request.ADD_BREAKPOINT, m_LateBreakpointOverrideDebugStart ); * addNewBP.Breakpoint = bpTemp; * Debugger.QueueRequest( addNewBP );*/ } // and auto-go on with debugging Debugger.Run(); if (MarkedDocument != null) { MarkLine(MarkedDocument.DocumentInfo.Project, MarkedDocument.DocumentInfo.FullPath, -1); MarkedDocument = null; } Core.Executing.BringToForeground(); FirstActionAfterBreak = false; Core.MainForm.SetGUIForDebugging(true); return(true); }
public void AddVirtualBreakpoints(Types.ASM.FileInfo ASMFileInfo) { if (ASMFileInfo == null) { return; } foreach (var virtualBP in ASMFileInfo.VirtualBreakpoints.Values) { virtualBP.IsVirtual = true; int globalLineIndex = -1; if (!ASMFileInfo.FindGlobalLineIndex(virtualBP.LineIndex, virtualBP.DocumentFilename, out globalLineIndex)) { Core.AddToOutput("Cannot assign breakpoint for line " + virtualBP.LineIndex + ", no address found" + System.Environment.NewLine); continue; } int address = ASMFileInfo.FindLineAddress(globalLineIndex); if (address != -1) { var existingBP = BreakpointAtAddress(address); if (existingBP == null) { C64Studio.Types.Breakpoint bp = new C64Studio.Types.Breakpoint(); bp.LineIndex = virtualBP.LineIndex; bp.Address = address; bp.TriggerOnExec = true; bp.IsVirtual = true; bp.DocumentFilename = virtualBP.DocumentFilename; bp.Virtual.Add(virtualBP); virtualBP.Address = address; // we just need any key (as null is not allowed) if (!BreakPoints.ContainsKey("C64Studio.DebugBreakpoints")) { BreakPoints.Add("C64Studio.DebugBreakpoints", new List <C64Studio.Types.Breakpoint>()); } BreakPoints["C64Studio.DebugBreakpoints"].Add(bp); //AddBreakpoint( bp ); Debug.Log("Add virtual bp for $" + address.ToString("X4")); } else { // merge with existing existingBP.TriggerOnExec = true; existingBP.Virtual.Add(virtualBP); } } else { Core.AddToOutput("Cannot assign breakpoint for line " + virtualBP.LineIndex + ", no address found" + System.Environment.NewLine); } } }
private void btnAddBreakpoint_Click(object sender, EventArgs e) { Types.Breakpoint bp = new C64Studio.Types.Breakpoint(); bp.Address = GR.Convert.ToI32(editBPAddress.Text, 16); bp.TriggerOnExec = checkTriggerExec.Checked; bp.TriggerOnLoad = checkTriggerLoad.Checked; bp.TriggerOnStore = checkTriggerStore.Checked; bp.LineIndex = -1; bp.Conditions = editTriggerConditions.Text; bp.DocumentFilename = "C64Studio.DebugBreakpoints"; RaiseDocEvent(new DocEvent(DocEvent.Type.BREAKPOINT_ADDED, bp)); }
private void btnAddBreakpoint_Click(object sender, EventArgs e) { Types.Breakpoint bp = new C64Studio.Types.Breakpoint(); bp.Address = GR.Convert.ToI32(editBPAddress.Text, 16); bp.TriggerOnExec = checkTriggerExec.Checked; bp.TriggerOnLoad = checkTriggerLoad.Checked; bp.TriggerOnStore = checkTriggerStore.Checked; bp.LineIndex = -1; bp.Conditions = editTriggerConditions.Text; bp.DocumentFilename = "C64Studio.DebugBreakpoints"; // set marker in associated file if (DebuggedProject != null) { var element = DebuggedProject.GetElementByFilename(DebuggedProject.Settings.MainDocument); if (element != null) { var asmFileInfo = Core.Navigating.DetermineASMFileInfo(element.DocumentInfo); if (asmFileInfo.DocumentAndLineFromAddress(bp.Address, out string DocumentFilename, out int lineIndex)) { element = DebuggedProject.GetElementByFilename(DocumentFilename); if (element.DocumentInfo.Type == ProjectElement.ElementType.ASM_SOURCE) { var sourceFile = element.Document as SourceASMEx; bp.LineIndex = lineIndex; bp.DocumentFilename = DocumentFilename; sourceFile.AddBreakpoint(bp); } } } } RaiseDocEvent(new DocEvent(DocEvent.Type.BREAKPOINT_ADDED, bp)); }