Skip to content

Delete ICorDebugProcess11#128042

Open
Copilot wants to merge 3 commits into
mainfrom
copilot/remove-getloaderheapmemoryranges-api
Open

Delete ICorDebugProcess11#128042
Copilot wants to merge 3 commits into
mainfrom
copilot/remove-getloaderheapmemoryranges-api

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 11, 2026

Removes ICorDebugProcess11 and its associated types (ICorDebugMemoryRangeEnum, COR_MEMORY_RANGE) — the single method EnumerateLoaderHeapMemoryRegions was unused.

…s API

Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 11, 2026 15:41
Copilot AI changed the title E_NOTIMPL EnumerateLoaderHeapMemoryRegions and remove GetLoaderHeapMemoryRanges Return E_NOTIMPL for loader-heap memory region enumeration and remove GetLoaderHeapMemoryRanges May 11, 2026
Copilot AI requested a review from rcj1 May 11, 2026 15:42
Copilot finished work on behalf of rcj1 May 11, 2026 15:42
@rcj1 rcj1 changed the title Return E_NOTIMPL for loader-heap memory region enumeration and remove GetLoaderHeapMemoryRanges Return E_NOTIMPL for ICorDebugProcess11::EnumerateLoaderHeapMemoryRegions May 11, 2026
@rcj1 rcj1 requested review from hoyosjs and plnelson May 11, 2026 15:47
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

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

@rcj1 rcj1 marked this pull request as ready for review May 11, 2026 15:49
Copilot AI review requested due to automatic review settings May 11, 2026 15:49
Copy link
Copy Markdown
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 disables loader-heap memory range enumeration in the CoreCLR debugging API by making ICorDebugProcess11::EnumerateLoaderHeapMemoryRegions return E_NOTIMPL, and removes the underlying DAC/DBI plumbing (IDacDbiInterface::GetLoaderHeapMemoryRanges) that previously supported the feature.

Changes:

  • Return E_NOTIMPL from CordbProcess::EnumerateLoaderHeapMemoryRegions instead of building a CordbMemoryRangeEnumerator from DAC-provided ranges.
  • Remove GetLoaderHeapMemoryRanges from the DAC/DBI interface surface (IDL + C++ headers + DAC implementation).
  • Remove the corresponding managed COM projection and forwarding stub in the legacy managed cDAC layer.
Show a summary per file
File Description
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/IDacDbiInterface.cs Removes the managed COM projection entry for GetLoaderHeapMemoryRanges.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs Removes the managed implementation/forwarder for GetLoaderHeapMemoryRanges.
src/coreclr/inc/dacdbi.idl Removes GetLoaderHeapMemoryRanges from the IDL contract.
src/coreclr/debug/inc/dacdbiinterface.h Removes GetLoaderHeapMemoryRanges from the C++ interface declaration.
src/coreclr/debug/di/process.cpp Simplifies EnumerateLoaderHeapMemoryRegions to return E_NOTIMPL.
src/coreclr/debug/daccess/dacdbiimpl.h Removes the DAC-side declaration and helper declarations related to loader-heap range enumeration.
src/coreclr/debug/daccess/dacdbiimpl.cpp Removes the DAC-side implementation that enumerated loader allocator + JIT code heap ranges.

Copilot's findings

  • Files reviewed: 7/7 changed files
  • Comments generated: 2

Comment thread src/coreclr/debug/di/process.cpp Outdated
Comment thread src/coreclr/debug/inc/dacdbiinterface.h
…ANGE

Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com>
Copilot AI changed the title Return E_NOTIMPL for ICorDebugProcess11::EnumerateLoaderHeapMemoryRegions Delete ICorDebugProcess11 May 11, 2026
Copilot finished work on behalf of rcj1 May 11, 2026 16:14
Copilot AI review requested due to automatic review settings May 11, 2026 17:03
Copy link
Copy Markdown
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.

Copilot's findings

Comments suppressed due to low confidence (4)

src/coreclr/inc/dacdbi.idl:435

  • Removing GetLoaderHeapMemoryRanges from IDacDbiInterface changes the COM vtable layout for all subsequent methods (e.g., IsModuleMapped, MetadataUpdatesApplied, etc.). This is a protocol-breaking change for any scenario where DBI/DAC binaries can be mixed across versions, and typically requires either (1) keeping the method slot (returning E_NOTIMPL), or (2) introducing a new interface IID/version and negotiating via QueryInterface, and/or (3) bumping/strengthening the DBI↔DAC protocol breaking-change version check so mismatched components fail before calling shifted slots.
    // Module Mapping
    HRESULT IsModuleMapped([in] VMPTR_Module pModule, [out] BOOL * isModuleMapped);
    HRESULT MetadataUpdatesApplied([out] BOOL * pResult);
    HRESULT GetAssemblyFromModule([in] VMPTR_Module vmModule, [out] VMPTR_Assembly * pvmAssembly);

src/coreclr/debug/inc/dacdbiinterface.h:2279

  • GetLoaderHeapMemoryRanges was removed from IDacDbiInterface, which shifts vtable slots for everything after it. Unless the DBI↔DAC version/protocol negotiation is guaranteed to prevent mixed-version calls into these later methods, this can lead to calling the wrong function pointer at runtime. Consider keeping the slot (return E_NOTIMPL) or versioning the interface (new IID) rather than removing an existing method from the middle of the contract.
    virtual HRESULT STDMETHODCALLTYPE IsModuleMapped(VMPTR_Module pModule, OUT BOOL *isModuleMapped) = 0;

    virtual HRESULT STDMETHODCALLTYPE MetadataUpdatesApplied(OUT BOOL * pResult) = 0;

src/coreclr/inc/cordebug.idl:3333

  • ICorDebugProcess11 (and related ICorDebugMemoryRangeEnum / COR_MEMORY_RANGE) is removed from the public ICorDebug IDL. This is a breaking change for any external debugger that previously QueryInterfaced for ICorDebugProcess11 (even if the method was rarely used). Please confirm this interface was never shipped/supported, or consider leaving the interface defined and implemented as a stub returning E_NOTIMPL (or following whatever deprecation/breaking-change process is expected for ICorDebug COM surface).
[
    object,
    local,
    uuid(4DCD6FB9-3CF0-43F0-9EDF-E833070FE644),
    pointer_default(unique)
]
interface ICorDebugProcess12 : IUnknown
{
    HRESULT GetAsyncStack([in] CORDB_ADDRESS continuationAddress, [out] ICorDebugStackWalk** ppStackWalk);
}

src/coreclr/debug/di/process.cpp:2100

  • Runtime behavior change: CordbProcess::QueryInterface no longer returns ICorDebugProcess11. If any external debugger relied on this being available, it will now see E_NOINTERFACE. Please ensure this COM interface removal is intentional/approved and that any consumers (e.g., VS/debugger tooling) don’t rely on it.
    else if (id == IID_ICorDebugProcess12)
    {
        *pInterface = static_cast<ICorDebugProcess12*>(this);
    }
  • Files reviewed: 11/11 changed files
  • Comments generated: 2

Comment on lines 116 to 120
typedef int COR_TYPEID;
typedef int COR_FIELD;
typedef int COR_TYPE_LAYOUT;
typedef int COR_ARRAY_LAYOUT;
typedef int COR_HEAPINFO;
@@ -2919,7 +2914,6 @@ class CordbProcess :
public ICorDebugProcess5,
public ICorDebugProcess7,
public ICorDebugProcess8,
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