Skip to content

Invoke debugger function evaluations through managed UCO - #133659

Draft
jkoritzinsky wants to merge 3 commits into
dev/jkoritzinsky/custom-attribute-constructorsfrom
dev/jkoritzinsky/func-eval-uco
Draft

jkoritzinsky wants to merge 3 commits into
dev/jkoritzinsky/custom-attribute-constructorsfrom
dev/jkoritzinsky/func-eval-uco

Conversation

@jkoritzinsky

@jkoritzinsky jkoritzinsky commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

Summary

Layer 3 of the stack for #123864, following #133658. The prior func-eval-specific proposal is #126809.

  • Replace native ABI argument packing and MethodDescCallSite invocation with a managed UCO entrypoint and the shared invocation emitter.
  • Preserve native validation and rooted receiver/argument/result storage, including unboxed receivers, reference-containing values, memory/register/literal argument homes, and copy-back ownership.
  • Keep raw byref and nullable results distinct from ordinary reflection result normalization.
  • Preserve exception propagation and safe/rude/exception-unwind abort recovery. Correct the native-helper abort contracts and true nullable backing-box copy-back uncovered during comparison.
  • Register the runtime-owned UCO exception path and preserve the browser/WASI callback entries.

Validation

Used the existing MDbg/xUnit debugger-test harness with a private CoreRun and ProjectK/CoreCLR-only configuration. The frozen set contains 20 rows: 18 passed, 0 failed, and 2 pre-existing skips, with no runner errors. It includes moving GC, receiver mutation, nullable copy-back, byref results, constructors, register arguments, nested/exception-time eval, and inspection cases.

Both nullable return/read assertions produce 59. Each of the three abort scenarios completes the eval callback, calls Echo(42), and detaches with MDbg exit 100. The cleanup-layer rerun retained all outcomes.

Runtime hashes and actual loaded modules were audited. The harness binaries, selected recorder scripts, and diagnostic test patch stayed unchanged; execution used direct CoreRun/xUnit/MDbg commands and configuration data, without session-state launch scripts or expectation changes. This is Windows x64 coverage, not proof of every architecture or debugger scenario.

The final cleanup layer is #133660.


Stack created with GitHub Stacks CLI • Give Feedback 💬

Note

This PR description and implementation were prepared with GitHub Copilot. Commits that reuse am11's code retain the requested co-author attribution.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke
See info in area-owners.md if you want to be subscribed.

@am11

am11 commented Sep 11, 2026

Copy link
Copy Markdown
Member

discussed on #126542.

nit: funceval was already split: #126809 so #126542 discussion is irrelevant.

@jkoritzinsky

Copy link
Copy Markdown
Member Author

Thanks, @am11. Corrected the summary to reference #126809 for the prior func-eval-specific proposal rather than #126542.

Note

This reply was prepared with GitHub Copilot.

@jkoritzinsky
jkoritzinsky force-pushed the dev/jkoritzinsky/func-eval-uco branch from 84969d7 to ce9480a Compare September 15, 2026 21:55
@jkoritzinsky
jkoritzinsky force-pushed the dev/jkoritzinsky/func-eval-uco branch from ce9480a to 10d25d9 Compare September 15, 2026 22:57
jkoritzinsky and others added 3 commits September 23, 2026 15:29
Complete the third layer of #123864 on the shared invocation foundation from #126542. Use rooted receiver/argument/result storage and the common managed emitter instead of native ABI packing. Preserve raw byref and nullable results, in-place receivers, register/literal semantics, exception propagation and abort recovery. Correct native-helper abort contracts and true nullable backing-box copy-back.

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
WebAssembly does not build or link debug/ee even though DEBUGGING_SUPPORTED is defined. Guard both the debugger UCO MethodDesc declaration and its EH comparison with TARGET_WASM instead of referencing an unavailable definition.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Add an internal InvokeForDebugger facade on RuntimeConstructorInfo that
forwards to its existing MethodBaseInvoker, so Debugger.InvokeFunction no
longer needs direct access to the constructor's Invoker property once it
is made private for encapsulation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants