Skip to content

[clr-interp][debugger] Skip ResumeInUpdatedFunction for Interpreter - #130069

Merged
steveisok merged 2 commits into
dotnet:mainfrom
matouskozak:matouskozak/fantastic-guide
Jul 8, 2026
Merged

steveisok merged 2 commits into
dotnet:mainfrom
matouskozak:matouskozak/fantastic-guide

Conversation

@matouskozak

Copy link
Copy Markdown
Member

We currently do not support EnC when debugging code from CoreCLR interpreter. By skipping the ResumeInUpdatedFunction we allow the changes to take place on subsequent method execution.

@matouskozak matouskozak self-assigned this Jul 1, 2026
Copilot AI review requested due to automatic review settings July 1, 2026 08:26
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @BrzVlad, @janvorli, @kg
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR changes Edit-and-Continue (EnC) remap behavior in the CoreCLR debugger controller so that when the current instruction pointer is in interpreted code (under FEATURE_INTERPRETER), the runtime does not call ResumeInUpdatedFunction, allowing execution to continue in the pre-update version of the method.

Changes:

  • Detect interpreted-code execution at remap time via EECodeInfo(GetIP(pContext)).IsInterpretedCode().
  • Skip g_pEEInterface->ResumeInUpdatedFunction(...) for interpreted code and log that the remap is being skipped.
  • Keep existing remap behavior for non-interpreted (JIT/native) code.
Comments suppressed due to low confidence (1)

src/coreclr/debug/ee/controller.cpp:9495

  • This log message is now reachable when remap is skipped for interpreted code, but it claims we returned from ResumeInUpdatedFunction. That’s misleading and makes EnC/interpreter debugging harder to diagnose from logs. Consider changing it to describe what actually happened (skipping the EnC patch / remap).
    LOG((LF_CORDB, LL_ALWAYS, "DEnCB::TP: We've returned from ResumeInUpdatedFunction"
            "we're going to skip the EnC patchId:0x%zx\n", patch->patchId));

Comment thread src/coreclr/debug/ee/controller.cpp Resolved
Comment thread src/coreclr/debug/ee/controller.cpp Resolved
@thaystg

thaystg commented Jul 6, 2026

Copy link
Copy Markdown
Member

When the EnC path is disabled, are we calling the UpdateModuleSymbols callback when?

@matouskozak

Copy link
Copy Markdown
Member Author

When the EnC path is disabled, are we calling the UpdateModuleSymbols callback when?

I don't think UpdateModuleSymbols is on the EnC remap path.

It is triggered by DB_IPCE_UPDATE_MODULE_SYMS. One path to this origins from SetSymbolBytes which is triggered on assembly load. The other path is triggered by SendClassLoadUnloadEvent (I didn't find a direct path from EnC to this one).

Comment thread src/coreclr/debug/ee/controller.cpp Resolved
Copilot AI review requested due to automatic review settings July 8, 2026 13:24
@matouskozak

Copy link
Copy Markdown
Member Author

I think a cleaner way to do this is skip setting the breakpoints that cause the debugger to provide the remap opportunity in the first place:

Thank you @noahfalk , yes I think that preventing the EnC breakpoints is a better way. I wasn't aware that VS would have an issue with this. Updated the PR and tested with Maui iOS app.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@steveisok
steveisok enabled auto-merge (squash) July 8, 2026 20:04
@steveisok
steveisok merged commit 656d7b2 into dotnet:main Jul 8, 2026
111 checks passed
@noahfalk

noahfalk commented Jul 8, 2026

Copy link
Copy Markdown
Member

I wasn't aware that VS would have an issue with this

fwiw I don't know that VS would have necessarily run into issues, I was more thinking that its confusing for the API to offer remap opportunities that it has no ability to fulfill :)

@matouskozak
matouskozak deleted the matouskozak/fantastic-guide branch July 10, 2026 04:55
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview7 milestone Jul 10, 2026
eiriktsarpalis pushed a commit that referenced this pull request Jul 15, 2026
…130069)

We currently do not support EnC when debugging code from CoreCLR
interpreter. By skipping the `ResumeInUpdatedFunction` we allow the
changes to take place on subsequent method execution.
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants