Repository navigation
feat: what the editor's debugger needs from the link and the compiler - #1208
Merged
Merged
Conversation
The editor's debugger sets breakpoints on source lines, shows the line the script is held at, and reads the script's state. - The compiler can give a map from the source's lines to the script's statements (compileMapped, source_parser.buildMapped): each statement's offset, its place in the source, and whether the VM stops before it. - OpenReliant's own messages are records in the library (link.Hello, link.MissionStarted, link.State), which the game writes and openreliant debug reads, so every client reads them the same way. - While an editor is linked, the mission's start waits for the editor's flags, for a second at most, instead of a fixed fifth of a second, so a breakpoint in a start part stops it with a slower editor too. Closes #1206
An editor built on the library connects to the port the game listens at, so the number belongs with the link's other definitions rather than in the game's platform module.
- The state reads in one pass over its lines, passes over keys it doesn't know, and refuses a global past the 16 bits a mission counts them in, which could otherwise allocate without bound. - The start's wait reads a clock through the editor connection, so a second is a second however long each sleep takes. - The compiler's marks note where a statement's last instruction goes, and the map reads that instruction back from the written routine, so the two can't disagree. The statements come in the script's order, so they need no sort. - The test listener counts its releases as `released`, apart from the checks it counts as `checked`.
vdmkenny
added a commit
to OpenReliant/openreliant-editor
that referenced
this pull request
Oct 14, 2026
) The first stage of [the debugger's design](design/debugger.md), which this PR adds with its Editor link settings page: the editor links to OpenReliant, holds the mission's script at line breakpoints, and steps it. - **Linking:** Play starts the game with `--editor-link` and links to it, Link to game links to a game started by hand, and Unlink closes the link while the game plays on. The link's state shows on the toolbar's chip, the status bar and the start screen. - **Breakpoints:** placed by the build's map of statements to lines, which OpenReliant's compiler gives, while the game plays the build of the text as it is. A breakpoint on a line that can't hold moves to the next one that can. They're kept per source file in the settings folder. - **Holding and stepping:** Continue, Step over, Step into, Run to cursor and Pause; the held line in the gutter, the outline, the inspector and the chip; Threads and Variables from the game's state. - **The connection** answers each mission's file with the flags from a task of its own, since the game holds the mission's start until they come. - On-screen text is terse: Unlink, Link to game, State polling at 1 Hz or 4 Hz. The design pages and pictures say the same. Checked: tests including a game made of messages over TCP, `make check`, `--check-missions` over the 44 stock missions, and the real game headless, holding mission 90's start part at a breakpoint. Depends on [OpenReliant/openreliant#1208](OpenReliant/openreliant#1208): `build.zig.zon` pins its head, to repin to main once it merges. Left for later: conditions, log points and Watch (#19), the timeline (#20), the live scene (#21) and live changes (#22). Closes #5
vdmkenny
pushed a commit
that referenced
this pull request
Oct 14, 2026
🤖 I have created a release *beep* *boop* --- ## [0.15.0](v0.14.0...v0.15.0) (2026-10-14) ### Features * what the editor's debugger needs from the link and the compiler ([#1208](#1208)) ([0f92996](0f92996)), closes [#1206](#1206) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
vdmkenny
added a commit
to OpenReliant/openreliant-editor
that referenced
this pull request
Oct 14, 2026
Pins OpenReliant at its v0.15.0 release instead of the head of OpenReliant/openreliant#1208, which held the same code: their trees are identical, so nothing the editor builds changes.
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.
What the editor's debugger (openreliant-editor#5) needs from OpenReliant:
compileMappedgives, with the mission file, each statement's offset in the script, its line and column, and whether the VM stops before it.source_parser.buildMappedparses and compiles with it.link.Hello,link.MissionStartedandlink.Statewrite OpenReliant's own payloads and read them back, passing over keys they don't know. The game writes them andopenreliant debugreads them, replacing the hand-parsed fields. The default port moves into the library beside them.Checked: tests,
make check-missions(44 missions, 75 bound, the guide's change), and headless with a fake editor that answers the mission file half a second late: mission 1 still stops before its start part's first instruction, with the clock at 0. The editor's #23 builds on it, and its--check-missionsbuilds all 44 stock missions again through the mapped build.Left for later: the script's events for the editor's timeline (#1207).
Closes #1206