Stop stepping past end of completed program - #115
Merged
Conversation
BRK and unknown opcodes now mark the program as completed even in debug mode, so single-stepping ends at the program end instead of running on through uninitialized memory. debugExecStep refuses to step a completed program and informs the user; the step action is disabled in COMPLETED state and a program-completed notification is shown on all platforms. Fixes #109
Add the new toast title "Program completed" and the stepper info message to the pot and all language files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #109
Problem
Stepping is done via the simulator's
debugExecStep, which executes withdebuggingmode set to true and bypasses thecodeRunningcheck. Because of this, the program end (BRK) was never detected while single-stepping:debugExecStepeven cleared the_programCompletedflag and kept executing, so the user could silently step past the end of the program into uninitialized memory.Changes
Core (
packages/6502)BRKand unknown opcodes now explicitly mark the program as completed, so completion is detected in debug mode too — stepping over the finalBRKnow logs Program completed at PC=$… and transitions toCOMPLETEDstate.debugExecSteprefuses to step a completed program and emits an info message (Program completed. Reset to step through the program again.) instead of clearing the flag. This protects all platforms, including the web app which uses the simulator directly.stategetter givesCOMPLETEDprecedence over the stepper flag so the UI reflects completion while debugging.common-ui
COMPLETEDstate; the user has to reset or run again (the main button switches to Reset).program-completednotification when execution finishes, prompting users who are watching the GUI debugger.Apps
Translations
Verification
yarn format→yarn check:format→yarn buildall pass.BRK→COMPLETED+ stop event; a further step is refused (PC unchanged) with the info message; after reset, stepping works again; normal run mode still ends inCOMPLETEDas before.