/// ------------------------------------------------------------------------------------------------- /// <summary> Removes the break point at address described by addr. </summary> /// /// <remarks> 08/09/2018. </remarks> /// /// <param name="addr"> The address. </param> /// /// <returns> True if it succeeds, false if it fails. </returns> /// ------------------------------------------------------------------------------------------------- public static bool RemoveBreakPointAtAddress(int addr) { int b = FindFreeBreakpointAtAddress(addr); if (b < 0) { return(false); } if (breakpointData[b].markerset) { if (SourceCodeView.SetBreakPointMarker(false, breakpointData[b].markerSourcefilename, breakpointData[b].markerSourceLine)) { } } breakpointData[b].address = -1; breakpointData[b].used = false; breakpointData[b].IsEnabled = false; breakpointData[b].ConditionString = ""; breakpointData[b].breakpointType = BreakpointType.disabled; breakpointData[b].markerset = false; Program.telnetConnection.SendCommand("sb " + (b + 1), null); Program.telnetConnection.SendCommand("disable-breakpoint " + (b + 1), Program.myMainForm.myBreakpoints.UpdateCallback); MainForm.mySourceWindow.UpdateSourceButtons(); return(true); }
/// ------------------------------------------------------------------------------------------------- /// <summary> Sets break point. </summary> /// /// <remarks> 08/09/2018. </remarks> /// /// <param name="addr"> The address. </param> /// <param name="type"> The type. </param> /// <param name="Condition"> The condition. </param> /// <param name="filename"> Filename of the file. </param> /// <param name="linenum"> The linenum. </param> /// /// <returns> True if it succeeds, false if it fails. </returns> /// ------------------------------------------------------------------------------------------------- public static bool SetBreakPoint(int addr, BreakpointType type, string Condition, string filename, int linenum) { int b = FindFreeBreakpoint(); if (b < 0) { return(false); } breakpointData[b].address = addr; breakpointData[b].used = true; breakpointData[b].IsEnabled = true; breakpointData[b].ConditionString = Condition; breakpointData[b].breakpointType = type; breakpointData[b].markerset = false; //set a marker in the source code if (!string.IsNullOrEmpty(filename)) { //no filename then we dont set a marker if (SourceCodeView.SetBreakPointMarker(true, filename, linenum)) { breakpointData[b].markerset = true; breakpointData[b].markerSourceLine = linenum; breakpointData[b].markerSourcefilename = filename; } } Program.telnetConnection.SendCommand("sba " + (b + 1) + " break", null); Program.telnetConnection.SendCommand("sb " + (b + 1) + " PC=" + addr.ToString("X4") + "H", Program.myMainForm.myBreakpoints.UpdateCallback); //Program.myMainForm.UpdateBreakpoints(); MainForm.mySourceWindow.UpdateSourceButtons(); return(true); }