Skip to content

Release v0.5.3: debugger STRING / WSTRING implementation#164

Merged
thiagoralves merged 2 commits into
mainfrom
development
Jun 2, 2026
Merged

Release v0.5.3: debugger STRING / WSTRING implementation#164
thiagoralves merged 2 commits into
mainfrom
development

Conversation

@thiagoralves
Copy link
Copy Markdown
Contributor

Promote development to main for v0.5.3 release.

Carries:

Test plan

  • CI green (lint, typecheck, test matrix, extension build, build, smoke).

🤖 Generated with Claude Code

thiagoralves and others added 2 commits June 2, 2026 17:14
…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>
@thiagoralves thiagoralves merged commit e939d4b into main Jun 2, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant