Report program state in RTM builds - #3524
Conversation
The StateProgramRunning and StateProgramExited bits of the debugger state mask were only set when NANOCLR_ENABLE_SOURCELEVELDEBUGGING is defined, so an RTM build never reports either of them. Debugger clients read a zero state mask as "initialize", which makes the device look stuck before its program has started: nanoff refuses --filedeployment with E2002 and keeps rebooting the target. Set both unconditionally. The ProgramExit broadcast stays behind the source level debugging guard, since that one is a debugging event rather than state.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (2)
Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughThe runtime now reports ChangesDebugger state reporting
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to RTM builds now report running and exited program states while retaining the debug-only exit event guard. No current merge-blocking risk remains. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
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 |
josesimoes
left a comment
There was a problem hiding this comment.
The fix looks OK. Just remove the verbose comment. The reasoning is perfectly explained in the PR comments where it belongs.
|
Comments removed in 8b89a2a — the reasoning stays in the PR description. |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
The two red jobs ( |
|
@dkovyazin thank you again for your contribution! 🙏😄 .NET nanoFramework is all about community involvement, and no contribution is too small. Please edit it and add an entry with your GitHub username in the appropriate location (names are sorted alphabetically): (Feel free to adjust your name if it's not correct) |
Description
StateProgramRunningandStateProgramExitedare now set in every build, not only whenNANOCLR_ENABLE_SOURCELEVELDEBUGGINGis defined.CLR_DBG_Commands_c_Monitor_ProgramExitbroadcast stays behind that guard, since it is a debugging event rather than state.Motivation and Context
Both bits of the debugger state mask were guarded by
NANOCLR_ENABLE_SOURCELEVELDEBUGGING, so an RTM build never reported either of them. On the client sideState.Initializeis0x00000000, which makes a mask that never gainsProgramRunning(0x00000400) indistinguishable from a device that is still initializing. An RTM device therefore looks stuck before its program starts, for the entire time the program is actually running.The visible effect is that
nanoff --filedeploymentagainst an RTM build fails withE2002and reboots the target repeatedly, while a debug build of the same firmware on the same hardware deploys normally.How Has This Been Tested?
mainforESP32_S3_QUAD.Types of changes
Checklist