Skip to content

Conversation

@AaronRobinsonMSFT
Copy link
Member

Remove unused interface and header.

@AaronRobinsonMSFT
Copy link
Member Author

/cc @dotnet/dotnet-diag-contrib

@dotnet-policy-service
Copy link
Contributor

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

Copy link
Contributor

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 refactors the DbgTransportTarget usage in the CoreCLR debugger infrastructure to eliminate dynamic memory allocation. The global instance is changed from a pointer (g_pDbgTransportTarget) to a value (g_DbgTransportTarget), simplifying the code by removing heap allocation, null checks, and manual cleanup. Additionally, the unused header file coreclrremotedebugginginterfaces.h and its forward declaration of ICoreClrDebugTarget are removed.

Key Changes

  • Converted global DbgTransportTarget from pointer-based to value-based storage
  • Updated all usage sites to take the address of the global instance
  • Removed unused interface declaration and header file

Reviewed changes

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

Show a summary per file
File Description
src/coreclr/debug/inc/coreclrremotedebugginginterfaces.h Deleted unused header containing forward declaration of ICoreClrDebugTarget
src/coreclr/debug/di/dbgtransportmanager.h Changed extern declaration from pointer to value and removed include of deleted header
src/coreclr/debug/di/dbgtransportmanager.cpp Changed global definition from pointer to value with aggregate initialization and removed include of deleted header
src/coreclr/debug/di/cordb.cpp Simplified DLL initialization/cleanup by removing heap allocation, null checks, and manual delete
src/coreclr/debug/di/shimremotedatatarget.cpp Updated to take address of global value instead of using pointer directly
src/coreclr/debug/di/remoteeventchannel.cpp Updated to take address of global value instead of using pointer directly
src/coreclr/debug/di/dbgtransportpipeline.cpp Updated two locations to take address of global value instead of using pointer directly

@jkotas jkotas enabled auto-merge (squash) November 27, 2025 01:14
@jkotas jkotas merged commit 9ec8711 into dotnet:main Nov 27, 2025
105 checks passed
@AaronRobinsonMSFT AaronRobinsonMSFT deleted the remove_alloc_on_load branch November 27, 2025 04:43
@steveisok
Copy link
Member

Thanks @AaronRobinsonMSFT!

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.

3 participants