TdwsBreakpointableLines does not handle initialization section

Issue #26 new
Anders Melander created an issue

The TdwsBreakpointableLines class in the dwsDebugger unit does not process the initialization expression tree.

Test case:

unit Test;

interface

implementation

initialization
  exit;
finalization
end;

Expected:

  • The line containing the exit statement is marked as being "breakable".

Actual:

  • No lines are marked as being "breakable".

Fix:

In TdwsBreakpointableLines.ProcessProg replace the following:

    if (prog.InitExpr.ScriptPos.SourceFile<>nil) and (prog.InitExpr.SubExprCount>0) then
      prog.InitExpr.RecursiveEnumerateSubExprs(EnumeratorCallback);

with:

    if (prog.InitExpr.SubExprCount>0) then
      prog.InitExpr.RecursiveEnumerateSubExprs(EnumeratorCallback);

Comments (0)

  1. Log in to comment