Disabled breakpoint causes debugger break/suspend

Issue #77 resolved
Anders Melander created an issue

Setting TdwsDebuggerBreakpoint.Enabled to False does not prevent the debugger from breaking on the breakpoint.

I believe the problem is caused by the TdwsDSCBreakpoints.SuspendExecution method failing to take the value of the Enabled property into account. The following modification solves the problem:

function TdwsDSCBreakpoints.SuspendExecution: Boolean;
var
  ScriptPos: TScriptPos;
  Breakpoint: TdwsDebuggerBreakpoint;
begin
  ScriptPos := Debugger.CurrentScriptPos;
  if (ScriptPos.Line < FBitmap.Size) and (FBitmap.Bits[ScriptPos.Line]) then
  begin
    Breakpoint := FBreakpoints.BreakpointAt(ScriptPos);
    if (Breakpoint <> nil) and (Breakpoint.Enabled) then
      Exit(True);
  end;

  Result := inherited;
end;

Comments (2)

  1. Log in to comment