Apex Offline Debugger: not stopping on iterated breakpoints

Issue #1492 resolved
Phil W created an issue

I have a breakpoint set on a conditionally executed line that is in a triply nested loop (in this case). For example:

When running the Apex offline debugger, the breakpoint is hit the first time the given line is processed. However, subsequent iterations do not cause the breakpoint to be hit so hitting “continue” simply causes the test execution to complete (assuming no later breakpoints exist).

Being unable to use breakpoints for debugging makes something that should take moments take many 10s of minutes using the single-step alternative.

Comments (6)

  1. Scott Wells repo owner

    Phil, did you come up with a really simple use case that reproduces this? I've tried simple things like:

        @IsTest(SeeAllData=true)
        static void issue1492()
        {
            for (User user : [SELECT Id, Username FROM User]) {
                System.debug(user);
            }
        }
    

    and:

            for (Integer i = 0; i < 10; i++)
            {
                System.debug(i);
            }
    

    with breakpoints on the respective body lines, and I see the breakpoints hit on each iteration properly.

  2. Phil W reporter

    OK, not exactly the same reproduction because the breakpoint is being entirely ignored, but try to put a breakpoint on line 50 of the ExampleOfDebugIssue file attached (this being the line "total += value;") then debug the test that invokes this code. For me a breakpoint on line 7 of the test is hit, but if I use the continue button the test runs to completion.

    The breakpoints:

  3. Phil W reporter

    This issue may be related to the method call being nested again, like my other issue (1496).

  4. Scott Wells repo owner

    I'm also able to reproduce this in a scratch org with a namespace and the org shape you posted to the other issue. Again, my suspicion is that it's due to the namespace and not anything else around the shape. I'll debug these today and tomorrow and hopefully have a fix for both ready early next week.

  5. Log in to comment