fix: global struct variable debugger shows no values#643
Conversation
Global (external) struct and FB variables use CONFIG0__ prefix in debug.c, but the variableInfoMap building code always constructed local RES0__INSTANCE paths when resolving member indices. This caused all lookups for global struct members to fail, so their values were never polled by the debugger. Check variable.class === 'external' in the three sections that process nested FB/struct members and use buildGlobalDebugPath instead of buildDebugPath for external variables. Fixes #638 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 (1)
WalkthroughThe PR adds support for debugging global (external) function block variables by introducing a Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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
CONFIG0__prefix indebug.c, but thevariableInfoMapbuilding code always constructed localRES0__INSTANCEpaths, causing all index lookups for global struct members to fail silentlyvariable.class === 'external'in three code paths that process nested FB/struct members and switches tobuildGlobalDebugPathaccordinglyFixes #638
Test plan
MY_STRUCTwithFIELD1: INT,FIELD2: BOOL)VAR_GLOBAL)VAR_EXTERNAL🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
Bug Fixes
Refactor