Release v0.5.3: debugger STRING / WSTRING implementation#164
Merged
Conversation
…nforce (#162) The four `*_string_stub` placeholders in debug_dispatch.hpp returned zero for read and no-op'd for write/force/unforce. Net effect: every STRING / WSTRING pin in a project showed as "-" in the editor's debug watch panel because `handle_read()` saw a `type_ops[].size == 0` entry and short-circuited with zero bytes, and `handle_set` / `handle_write` rejected any payload with STATUS_DATA_TOO_LARGE. Implement the real ops against `IECStringVar<254>` / `IECWStringVar<254>`, matching the `len8-utf8` / `len8-utf16le` wire format that the editor's decoder (`src/frontend/utils/variable-sizes.ts:decodeWireValue`) already expects: STRING wire shape: [ uint8 length ][ 126 bytes UTF-8 payload ] (127 B) WSTRING wire shape: [ uint8 length ][ 126 char16_t LE code units ] (253 B) Force-aware: - read uses `length()` / `c_str()` on the wrapper, which the earlier proxy additions route through `forced_value_` when forcing is active. - write uses `IECStringVar::set` which itself is a no-op when forced (correct OPC-UA / debug-soft-write semantics). - force pins the value via `IECStringVar::force`; unforce clears via `IECStringVar::unforce`. WSTRING serialises char16_t as explicit little-endian byte pairs so the wire format stays host-endianness-independent. The trailing window past `length` is zero-filled on read so stale bus contents from a previous read can't leak through the fixed-width window into the editor's display. Verified end-to-end with a direct C++ smoke test: STRING read 'hello' → len=5 bytes='hello' ✓ WSTRING read 'hi' → len=2 bytes=68 00 69 00 (UTF-16LE 'h','i') ✓ STRING write 'world' → IECStringVar.length()=5, c_str()='world' ✓ STRING force 'forced'→ is_forced=1, c_str()='forced' ✓ STRING unforce → is_forced=0, c_str()='world' (back) ✓ Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Promote development to main for v0.5.3 release.
Carries:
Test plan
🤖 Generated with Claude Code