Skip to content

Remove AppDomain parameter for Debugger::InitIPCEvent #116871

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2025

Conversation

elinor-fung
Copy link
Member

Follow-up from #101749 (comment)
Always the one and only AppDomain.

cc @dotnet/dotnet-diag @AaronRobinsonMSFT

@Copilot Copilot AI review requested due to automatic review settings June 20, 2025 17:36
Copy link
Contributor

@Copilot Copilot AI left a comment

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 simplifies IPC event initialization by removing the AppDomain parameter from Debugger::InitIPCEvent and always using the current AppDomain internally.

  • Deleted the four-parameter overload in the header.
  • Updated all callers in debugger.cpp to use the three-parameter variant.
  • Inlined VMPTR_AppDomain::MakePtr(AppDomain::GetCurrentDomain()) inside the implementation.

Reviewed Changes

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

File Description
src/coreclr/debug/ee/debugger.h Removed the overload that accepted an AppDomain*.
src/coreclr/debug/ee/debugger.cpp Updated all InitIPCEvent calls to the new signature and defaulted the domain internally.
Comments suppressed due to low confidence (2)

src/coreclr/debug/ee/debugger.cpp:2791

  • Consider adding or updating unit tests to verify that vmAppDomain is correctly set for all IPC events, especially those that previously used NullPtr, to ensure the new default behavior is as intended.
    );

src/coreclr/debug/ee/debugger.h:2768

  • [nitpick] Update or add a comment here to explain that the AppDomain is now always the current domain and no longer needs to be passed in.
                      Thread *pThread)

Copy link
Member

@AaronRobinsonMSFT AaronRobinsonMSFT left a comment

Choose a reason for hiding this comment

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

LGTM

/cc @dotnet/dotnet-diag

Copy link
Contributor

Tagging subscribers to this area: @steveisok, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

@steveisok steveisok self-requested a review June 20, 2025 17:59
Copy link
Member

@steveisok steveisok left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@noahfalk noahfalk left a comment

Choose a reason for hiding this comment

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

It looks like there are places which are switching from NULL to GetCurrentAppDomain() which probably doesn't matter but there is a low chance it breaks something. If you haven't yet, can you test some basic debugging in Visual Studio like set a breakpoint in HelloWorld, hit it, and look at the locals?

@elinor-fung
Copy link
Member Author

I checked that basic debugging worked (helloworld, breakpoint, locals, eval in watch window). Also scanned through some of the reading of the IPC events and didn't see NULL obviously having some special meaning.

@elinor-fung elinor-fung merged commit 0721dd8 into dotnet:main Jun 20, 2025
95 checks passed
@elinor-fung elinor-fung deleted the init-ipc-event-no-appdomain branch June 20, 2025 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants