fix: resolve debugger issues with simulator endianness, FBD visualization, and forced variable polling#635
Conversation
1. Simulator endianness: the simulator debug flow skipped the getMd5Hash() call that triggers set_endianness() on the AVR runtime, causing multi-byte forced values to be byte-swapped (e.g. 1 → 256). 2. FBD BOOL edge coloring: _TMP_ function output variables were only registered for Ladder flows but not FBD, so function outputs like GT.OUT never got polled and edges were never painted green. Extracted a shared registerFunctionTempOutputs helper used by both editors. Also added missing getCompositeKey to the FBD styledEdges memo deps. 3. Forced variable polling: variables forced from the diagram were added to debugForcedVariables but never to the polling key set, so their values never appeared in the debugger panel. Now forced variable keys are included in debugVariableKeys before building the poll list. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Repository UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (3)
WalkthroughThis PR adds endianness detection for simulator connections via Modbus, fixes FBD editor memoization by including Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Simulator endianness detection: The simulator debug flow skipped the
getMd5Hash()call that triggersset_endianness()on the emulated AVR runtime. This caused multi-byte forced values to be byte-swapped on the little-endian AVR emulator (e.g., forcing INT to 1 displayed as 256). NowgetMd5Hash()is called after connecting in the simulator path ofhandleDebuggerConnect.FBD BOOL edge coloring: Compiler-generated
_TMP_function output variables (e.g.,_TMP_GT3058168_OUT) were only registered in the debug variable info map for Ladder flows, not FBD. This meant function BOOL outputs were never polled and FBD edges were never painted green. Extracted a sharedregisterFunctionTempOutputshelper used by both LD and FBD. Also added the missinggetCompositeKeydependency to the FBDstyledEdgesuseMemo (Ladder already had it).Forced variable polling: Variables forced from the diagram (FBD or Ladder) were added to
debugForcedVariablesbut never included in thedebugVariableKeyspolling set. Their values never appeared in the debugger panel (showed "-" or stale data). Now all forced variable composite keys are added todebugVariableKeysbefore building the poll list.Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes