[WIP] debugger robot runpool #1790
                
     Draft
            
            
          
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Addresses #1736 (comment).
Testing procedure
First I tried using the debugger to step through the
1598-detect-entity-change.yamltest added in #1736, without applying the changes of this PR.This was done by invoking it with:
then:
solutioncontents to the REPL in one line:move; move; swap "dial (G)"; swap "dial (B)";As it turns out, debugging mode for this particular scenario and solution was unbroken by #1736. A more specific test case would have to be engineered to exercise the particular gap introduced by #1736.
Since I couldn't find any existing unit/integration tests for the debugger, I have left this for a future exercise. However, based on the assumed behavior discrepancy between normal mode and debug mode, I did make a change to the
singleStepfunction.Implementation notes
I had to augment the
runRobotIDs/iterateRobotsfunctions to accommodate the debugger by supporting interruption of the iteration at a certainRIDand returning theRIDs that hadn't been visited yet.In
singleStep, therunRobotIDsfunction is called from within theSBeforecase, theSAftercase, and theSSinglecase. In theSAfterandSSingleinstance,runRobotIDsis just used to run "the rest of the robots", so no special behavior is needed. In this PR, the behavior has been extracted to a newfinishTickWithfunction.SBeforecaseThis calls
runRobotIDs preFocimmediately. This is the only place that necessitated support for "early interruption" of the iteration ofiterateRobots.SAftercaseTODO
SSinglecaseTODO
Handling
stepRobotinvoked fromSSingleTODO