Skip to content
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

Adds Console Log Formatting APIs #38616

Merged
merged 56 commits into from
Jul 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
60ccaa8
PAL_VirtualUnwindOutOfProc for MacOS (#39213)
mikem8361 Jul 15, 2020
c80cc2a
[wasm] Fix the propagation of exceptions through runtime invokes. (#3…
monojenkins Jul 15, 2020
324c6c7
Obsolete BinaryFormatter.Serialize and BinaryFormatter.Deserialize (#…
GrabYourPitchforks Jul 15, 2020
37cf387
Disallow unrestricted polymorphic deserialization in DataSet (#39304)
GrabYourPitchforks Jul 15, 2020
420e4e2
Fix location of gcdump test (#39057)
hoyosjs Jul 15, 2020
5929baa
WASM: Enable System.Memory tests (#39319)
akoeplinger Jul 15, 2020
08643df
[master] Update dependencies from mono/linker dotnet/icu (#39286)
dotnet-maestro[bot] Jul 15, 2020
1bdcd66
Add loader heap enumeration api's (ICorDebugProcess11) (#39124)
hoyosjs Jul 15, 2020
23acac8
Thumb2 uses the Arm registers (#39318)
davidwrighton Jul 15, 2020
0e7720c
Add .cfi annotation to CONTEXT_CaptureContext and RtlCaptureContext (…
janvorli Jul 15, 2020
83a15e3
[wasm] Remove ActiveIssue for issue #38337. Add a ConditionalFact ins…
vargaz Jul 15, 2020
7f53623
Add static one-shot hashing methods
vcsjones Jul 15, 2020
cd9b662
[Crossgen2] Add DelayLoadMethodCallThunks table, fix stack walks cont…
nattress Jul 15, 2020
c3a817e
Add PlatformNotSupportedException for Browser version of System.Net.S…
marek-safar Jul 15, 2020
cd8759d
Apply arm64 intrinsics to System.Text.Encodings.Web (#38707)
eiriktsarpalis Jul 15, 2020
78fb02b
Remove debug only attributes when Debugger.IsSupported is false. (#39…
eerhardt Jul 15, 2020
4cc3750
Generate only unique entries in wasm pinvoke table generator (#39356)
marek-safar Jul 15, 2020
ef2ecfd
[interp] Intrinsify span ctor (#39195)
BrzVlad Jul 15, 2020
36a9444
Disable eventpipe/gcdump test against #39361 (#39362)
jkotas Jul 15, 2020
cb08ec5
Add Structured Console Log Formatting APIs
maryamariyan Jun 30, 2020
63b95c8
Move Console tests to get better coverage results
maryamariyan Jul 7, 2020
ad23a35
Fix for config file updates
maryamariyan Jul 7, 2020
df3320a
File renames. Deprecated corrections. Code cleanup
maryamariyan Jul 7, 2020
f494d21
feedback
maryamariyan Jul 8, 2020
a7bea5e
update json formatter
maryamariyan Jul 8, 2020
2638d34
Simplify scope information for json formatter
maryamariyan Jul 8, 2020
1373353
cleanup switch expressions
maryamariyan Jul 8, 2020
9faed8f
Apply resolved feedback
maryamariyan Jul 8, 2020
6a47933
Switch back to serializing scope and state for json formatter
maryamariyan Jul 8, 2020
8652b8c
Minor fixes + parser feedback
maryamariyan Jul 9, 2020
78897a0
update test
maryamariyan Jul 9, 2020
3daf638
FormatterOptionsMonitor won't react to changes
maryamariyan Jul 9, 2020
6ae6375
Add more tests - update csproj
maryamariyan Jul 10, 2020
b6d9733
Fix build
maryamariyan Jul 10, 2020
2acdf79
Using PooledByteBufferWriter (move to Common)
maryamariyan Jul 10, 2020
3e517bb
Add code coverage
maryamariyan Jul 10, 2020
e2f7753
nit fix
maryamariyan Jul 10, 2020
353050a
Fix TargetFrameworks
maryamariyan Jul 10, 2020
ba307fd
Separate ConsoleLoggerProvider into multiple files
maryamariyan Jul 10, 2020
1582ec7
nit cleanup
maryamariyan Jul 10, 2020
0b18a7a
Fix DoesNotReturnAttribute issue
maryamariyan Jul 10, 2020
21f6630
test cleanup
maryamariyan Jul 10, 2020
f536161
net472 fix
maryamariyan Jul 10, 2020
dd97483
PR feedback
maryamariyan Jul 11, 2020
4ac06b0
simplify VT check
maryamariyan Jul 13, 2020
0ec0908
Test failure on CI troubleshoot
maryamariyan Jul 13, 2020
2edb820
updating ifdef including netframework to condition
maryamariyan Jul 13, 2020
aea00df
Test cleanup
maryamariyan Jul 13, 2020
1c062c5
AnsiLogConsole improvement
maryamariyan Jul 13, 2020
c56ab02
Fix test
maryamariyan Jul 13, 2020
d5bdc9a
header licensing fixup
maryamariyan Jul 13, 2020
a1baaff
Same logic parser, if-else flipped. Adding tests
maryamariyan Jul 14, 2020
e65a28a
Improved deprecated workflow
maryamariyan Jul 14, 2020
c048216
Improve parser adds tests
maryamariyan Jul 14, 2020
c4e3eb5
Fixing expectations for deprecated workflow
maryamariyan Jul 14, 2020
8ca5613
Fixing new netfx builds
joperezr Jul 15, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/project/list-of-obsoletions.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ Currently the identifiers `MSLIB0001` through `MSLIB0999` are carved out for obs
| :--------------- | :---------- |
| __`MSLIB0001`__ | The UTF-7 encoding is insecure and should not be used. Consider using UTF-8 instead. |
| __`MSLIB0002`__ | `PrincipalPermissionAttribute` is not honored by the runtime and must not be used. |
| __`MSLIB0003`__ | `BinaryFormatter` serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for recommended alternatives. |
8 changes: 4 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@
<Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>b34a70799faa67f13c2e72852e4f3af463ff4d6c</Sha>
</Dependency>
<Dependency Name="Microsoft.NETCore.Runtime.ICU.Transport" Version="5.0.0-preview.8.20359.7">
<Dependency Name="Microsoft.NETCore.Runtime.ICU.Transport" Version="5.0.0-preview.8.20364.1">
<Uri>https://github.com/dotnet/icu</Uri>
<Sha>88c2807979f8762a121f8e4b217191672d334822</Sha>
<Sha>bf5a3a643815a8a46693d618d08dbc96f353ca9e</Sha>
</Dependency>
<Dependency Name="runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk" Version="9.0.1-alpha.1.20356.1">
<Uri>https://github.com/dotnet/llvm-project</Uri>
Expand Down Expand Up @@ -182,9 +182,9 @@
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>0375524a91a47ca4db3ee1be548f74bab7e26e76</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.ILLink.Tasks" Version="5.0.0-preview.3.20361.1">
<Dependency Name="Microsoft.NET.ILLink.Tasks" Version="5.0.0-preview.3.20363.5">
<Uri>https://github.com/mono/linker</Uri>
<Sha>3b524e4aa109ce5c8d9db5d6447386a0714d0d2d</Sha>
<Sha>e76321851c05c5016df3d1243885c02e875b9912</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="1.0.0-prerelease.20352.3">
<Uri>https://github.com/dotnet/xharness</Uri>
Expand Down
4 changes: 2 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@
<!-- Docs -->
<MicrosoftPrivateIntellisenseVersion>3.0.0-preview-20200602.3</MicrosoftPrivateIntellisenseVersion>
<!-- ILLink -->
<MicrosoftNETILLinkTasksVersion>5.0.0-preview.3.20361.1</MicrosoftNETILLinkTasksVersion>
<MicrosoftNETILLinkTasksVersion>5.0.0-preview.3.20363.5</MicrosoftNETILLinkTasksVersion>
<!-- ICU -->
<MicrosoftNETCoreRuntimeICUTransportVersion>5.0.0-preview.8.20359.7</MicrosoftNETCoreRuntimeICUTransportVersion>
<MicrosoftNETCoreRuntimeICUTransportVersion>5.0.0-preview.8.20364.1</MicrosoftNETCoreRuntimeICUTransportVersion>
<!-- Mono LLVM -->
<runtimelinuxarm64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>9.0.1-alpha.1.20356.1</runtimelinuxarm64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>
<runtimelinuxarm64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>9.0.1-alpha.1.20356.1</runtimelinuxarm64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>
Expand Down
134 changes: 134 additions & 0 deletions src/coreclr/src/debug/daccess/dacdbiimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "switches.h"
#include "generics.h"
#include "stackwalk.h"
#include "virtualcallstub.h"

#include "dacdbiimpl.h"

Expand Down Expand Up @@ -3570,6 +3571,139 @@ HRESULT DacDbiInterfaceImpl::GetDelegateTargetObject(
return hr;
}

static bool TrackMemoryRangeHelper(PTR_VOID pvArgs, PTR_VOID pvAllocationBase, SIZE_T cbReserved)
{
// The pvArgs is really pointing to a debugger-side container. Sadly the callback only takes a PTR_VOID.
CQuickArrayList<COR_MEMORY_RANGE> *rangeCollection =
(CQuickArrayList<COR_MEMORY_RANGE>*)(dac_cast<TADDR>(pvArgs));
TADDR rangeStart = dac_cast<TADDR>(pvAllocationBase);
TADDR rangeEnd = rangeStart + cbReserved;
rangeCollection->Push({rangeStart, rangeEnd});

// This is a tracking function, not a search callback. Pretend we never found what we were looking for
// to get all possible ranges.
return false;
}

void DacDbiInterfaceImpl::EnumerateMemRangesForLoaderAllocator(PTR_LoaderAllocator pLoaderAllocator, CQuickArrayList<COR_MEMORY_RANGE> *rangeAcummulator)
{
CQuickArrayList<PTR_LoaderHeap> heapsToEnumerate;

// We always expect to see these three heaps
_ASSERTE(pLoaderAllocator->GetLowFrequencyHeap() != NULL);
heapsToEnumerate.Push(pLoaderAllocator->GetLowFrequencyHeap());

_ASSERTE(pLoaderAllocator->GetHighFrequencyHeap() != NULL);
heapsToEnumerate.Push(pLoaderAllocator->GetHighFrequencyHeap());

_ASSERTE(pLoaderAllocator->GetStubHeap() != NULL);
heapsToEnumerate.Push(pLoaderAllocator->GetStubHeap());

// GetVirtualCallStubManager returns VirtualCallStubManager*, but it's really an address to target as
// pLoaderAllocator is DACized. Cast it so we don't try to to a Host to Target translation.
VirtualCallStubManager *pVcsMgr = PTR_VirtualCallStubManager(TO_TADDR(pLoaderAllocator->GetVirtualCallStubManager()));
LOG((LF_CORDB, LL_INFO10000, "DDBII::EMRFLA: VirtualCallStubManager 0x%x\n", PTR_HOST_TO_TADDR(pVcsMgr)));
if (pVcsMgr)
{
if (pVcsMgr->indcell_heap != NULL) heapsToEnumerate.Push(pVcsMgr->indcell_heap);
if (pVcsMgr->lookup_heap != NULL) heapsToEnumerate.Push(pVcsMgr->lookup_heap);
if (pVcsMgr->resolve_heap != NULL) heapsToEnumerate.Push(pVcsMgr->resolve_heap);
if (pVcsMgr->dispatch_heap != NULL) heapsToEnumerate.Push(pVcsMgr->dispatch_heap);
if (pVcsMgr->cache_entry_heap != NULL) heapsToEnumerate.Push(pVcsMgr->cache_entry_heap);
}

TADDR rangeAccumAsTaddr = TO_TADDR(rangeAcummulator);
for (uint32_t i = 0; i < (uint32_t)heapsToEnumerate.Size(); i++)
{
LOG((LF_CORDB, LL_INFO10000, "DDBII::EMRFLA: LoaderHeap 0x%x\n", heapsToEnumerate[i].GetAddr()));
heapsToEnumerate[i]->EnumPageRegions(TrackMemoryRangeHelper, rangeAccumAsTaddr);
}
}

void DacDbiInterfaceImpl::EnumerateMemRangesForJitCodeHeaps(CQuickArrayList<COR_MEMORY_RANGE> *rangeAcummulator)
{
// We should always have a valid EEJitManager with at least one code heap.
EEJitManager *pEM = ExecutionManager::GetEEJitManager();
_ASSERTE(pEM != NULL && pEM->m_pCodeHeap.IsValid());

PTR_HeapList pHeapList = pEM->m_pCodeHeap;
while (pHeapList != NULL)
{
CodeHeap *pHeap = pHeapList->pHeap;
DacpJitCodeHeapInfo jitCodeHeapInfo = DACGetHeapInfoForCodeHeap(pHeap);

switch (jitCodeHeapInfo.codeHeapType)
{
case CODEHEAP_LOADER:
{
TADDR targetLoaderHeap = CLRDATA_ADDRESS_TO_TADDR(jitCodeHeapInfo.LoaderHeap);
LOG((LF_CORDB, LL_INFO10000,
"DDBII::EMRFJCH: LoaderCodeHeap 0x%x with LoaderHeap at 0x%x\n",
PTR_HOST_TO_TADDR(pHeap), targetLoaderHeap));
PTR_ExplicitControlLoaderHeap pLoaderHeap = PTR_ExplicitControlLoaderHeap(targetLoaderHeap);
pLoaderHeap->EnumPageRegions(TrackMemoryRangeHelper, TO_TADDR(rangeAcummulator));
break;
}

case CODEHEAP_HOST:
{
LOG((LF_CORDB, LL_INFO10000,
"DDBII::EMRFJCH: HostCodeHeap 0x%x\n",
PTR_HOST_TO_TADDR(pHeap)));
rangeAcummulator->Push({
CLRDATA_ADDRESS_TO_TADDR(jitCodeHeapInfo.HostData.baseAddr),
CLRDATA_ADDRESS_TO_TADDR(jitCodeHeapInfo.HostData.currentAddr)
});
break;
}

default:
{
LOG((LF_CORDB, LL_INFO10000, "DDBII::EMRFJCH: unknown heap type at 0x%x\n\n", pHeap));
_ASSERTE("Unknown heap type enumerating code ranges.");
break;
}
}

pHeapList = pHeapList->GetNext();
}
}

HRESULT DacDbiInterfaceImpl::GetLoaderHeapMemoryRanges(DacDbiArrayList<COR_MEMORY_RANGE> *pRanges)
{
LOG((LF_CORDB, LL_INFO10000, "DDBII::GLHMR\n"));
DD_ENTER_MAY_THROW;

HRESULT hr = S_OK;

EX_TRY
{
CQuickArrayList<COR_MEMORY_RANGE> memoryRanges;

// Anything that's loaded in the SystemDomain or into the main AppDomain's default context in .NET Core
// and after uses only one global allocator. Enumerating that one is enough for most purposes.
// This doesn't consider any uses of AssemblyLoadingContexts (Unloadable or not). Each context has
// it's own LoaderAllocator, but there's no easy way of getting a hand at them other than going through
// the heap, getting a managed LoaderAllocators, from there getting a Scout, and from there getting a native
// pointer to the LoaderAllocator tos enumerate.
PTR_LoaderAllocator pGlobalAllocator = SystemDomain::System()->GetLoaderAllocator();
_ASSERTE(pGlobalAllocator);
EnumerateMemRangesForLoaderAllocator(pGlobalAllocator, &memoryRanges);

EnumerateMemRangesForJitCodeHeaps(&memoryRanges);

// This code doesn't enumerate module thunk heaps to support IJW.
// It's a fairly rare scenario and requires to enumerate all modules.
// The return for such added time is minimal.

_ASSERTE(memoryRanges.Size() < INT_MAX);
pRanges->Init(memoryRanges.Ptr(), (UINT) memoryRanges.Size());
}
EX_CATCH_HRESULT(hr);

return hr;
}

void DacDbiInterfaceImpl::GetStackFramesFromException(VMPTR_Object vmObject, DacDbiArrayList<DacExceptionCallStackData>& dacStackFrames)
{
DD_ENTER_MAY_THROW;
Expand Down
10 changes: 10 additions & 0 deletions src/coreclr/src/debug/daccess/dacdbiimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ class DacDbiInterfaceImpl :
OUT VMPTR_Object *ppTargetObj,
OUT VMPTR_AppDomain *ppTargetAppDomain);

HRESULT GetLoaderHeapMemoryRanges(OUT DacDbiArrayList<COR_MEMORY_RANGE> * pRanges);

// retrieves the list of COM interfaces implemented by vmObject, as it is known at
// the time of the call (the list may change as new interface types become available
// in the runtime)
Expand Down Expand Up @@ -394,6 +396,14 @@ class DacDbiInterfaceImpl :
OUT DacDbiArrayList<DebuggerIPCE_ExpandedTypeData> * pTypes);

private:
// Helper to enumerate all possible memory ranges help by a loader allocator.
void EnumerateMemRangesForLoaderAllocator(
PTR_LoaderAllocator pLoaderAllocator,
CQuickArrayList<COR_MEMORY_RANGE> *rangeAcummulator);

void EnumerateMemRangesForJitCodeHeaps(
CQuickArrayList<COR_MEMORY_RANGE> *rangeAcummulator);

// Given a pointer to a managed function, obtain the method desc for it.
// Equivalent to GetMethodDescPtrFromIp, except if the method isn't jitted
// it will look for it in code stubs.
Expand Down
7 changes: 5 additions & 2 deletions src/coreclr/src/debug/daccess/dacfn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ DacVirtualUnwind(ULONG32 threadId, PT_CONTEXT context, PT_KNONVOLATILE_CONTEXT_P
memset(contextPointers, 0, sizeof(T_KNONVOLATILE_CONTEXT_POINTERS));
}

HRESULT hr = S_OK;
HRESULT hr = E_NOINTERFACE;

#ifdef FEATURE_DATATARGET4
ReleaseHolder<ICorDebugDataTarget4> dt;
Expand All @@ -277,9 +277,12 @@ DacVirtualUnwind(ULONG32 threadId, PT_CONTEXT context, PT_KNONVOLATILE_CONTEXT_P
{
hr = dt->VirtualUnwind(threadId, sizeof(CONTEXT), (BYTE*)context);
}
else
#endif

if (hr == E_NOINTERFACE || hr == E_NOTIMPL)
{
hr = S_OK;

SIZE_T baseAddress = DacGlobalBase();
if (baseAddress == 0 || !PAL_VirtualUnwindOutOfProc(context, contextPointers, baseAddress, DacReadAllAdapter))
{
Expand Down
6 changes: 5 additions & 1 deletion src/coreclr/src/debug/daccess/dacimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1455,8 +1455,12 @@ class ClrDataAccess
private:
#endif

#ifdef FEATURE_COMINTEROP
protected:
// Populates a DacpJitCodeHeapInfo with proper information about the
// code heap type and the information needed to locate it.
DacpJitCodeHeapInfo DACGetHeapInfoForCodeHeap(CodeHeap *heapAddr);

#ifdef FEATURE_COMINTEROP
// Returns CCW pointer based on a target address.
PTR_ComCallWrapper DACGetCCWFromAddress(CLRDATA_ADDRESS addr);

Expand Down
48 changes: 28 additions & 20 deletions src/coreclr/src/debug/daccess/request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,27 +499,8 @@ ClrDataAccess::GetCodeHeapList(CLRDATA_ADDRESS jitManager, unsigned int count, s
unsigned int i = 0;
while ((heapList != NULL) && (i < count))
{
// What type of CodeHeap pointer do we have?
CodeHeap *codeHeap = heapList->pHeap;
TADDR ourVTablePtr = VPTR_HOST_VTABLE_TO_TADDR(*(LPVOID*)codeHeap);
if (ourVTablePtr == LoaderCodeHeap::VPtrTargetVTable())
{
LoaderCodeHeap *loaderCodeHeap = PTR_LoaderCodeHeap(PTR_HOST_TO_TADDR(codeHeap));
codeHeaps[i].codeHeapType = CODEHEAP_LOADER;
codeHeaps[i].LoaderHeap =
TO_CDADDR(PTR_HOST_MEMBER_TADDR(LoaderCodeHeap, loaderCodeHeap, m_LoaderHeap));
}
else if (ourVTablePtr == HostCodeHeap::VPtrTargetVTable())
{
HostCodeHeap *hostCodeHeap = PTR_HostCodeHeap(PTR_HOST_TO_TADDR(codeHeap));
codeHeaps[i].codeHeapType = CODEHEAP_HOST;
codeHeaps[i].HostData.baseAddr = PTR_CDADDR(hostCodeHeap->m_pBaseAddr);
codeHeaps[i].HostData.currentAddr = PTR_CDADDR(hostCodeHeap->m_pLastAvailableCommittedAddr);
}
else
{
codeHeaps[i].codeHeapType = CODEHEAP_UNKNOWN;
}
codeHeaps[i] = DACGetHeapInfoForCodeHeap(codeHeap);
heapList = heapList->hpNext;
i++;
}
Expand Down Expand Up @@ -547,6 +528,33 @@ ClrDataAccess::GetCodeHeapList(CLRDATA_ADDRESS jitManager, unsigned int count, s
return hr;
}

DacpJitCodeHeapInfo ClrDataAccess::DACGetHeapInfoForCodeHeap(CodeHeap *heapAddr)
{
DacpJitCodeHeapInfo jitCodeHeapInfo;

TADDR targetVtblPtrForHeapType = VPTR_HOST_VTABLE_TO_TADDR(*(LPVOID*)heapAddr);
if (targetVtblPtrForHeapType == LoaderCodeHeap::VPtrTargetVTable())
{
LoaderCodeHeap *loaderCodeHeap = PTR_LoaderCodeHeap(PTR_HOST_TO_TADDR(heapAddr));
jitCodeHeapInfo.codeHeapType = CODEHEAP_LOADER;
jitCodeHeapInfo.LoaderHeap =
TO_CDADDR(PTR_HOST_MEMBER_TADDR(LoaderCodeHeap, loaderCodeHeap, m_LoaderHeap));
}
else if (targetVtblPtrForHeapType == HostCodeHeap::VPtrTargetVTable())
{
HostCodeHeap *hostCodeHeap = PTR_HostCodeHeap(PTR_HOST_TO_TADDR(heapAddr));
jitCodeHeapInfo.codeHeapType = CODEHEAP_HOST;
jitCodeHeapInfo.HostData.baseAddr = PTR_CDADDR(hostCodeHeap->m_pBaseAddr);
jitCodeHeapInfo.HostData.currentAddr = PTR_CDADDR(hostCodeHeap->m_pLastAvailableCommittedAddr);
}
else
{
jitCodeHeapInfo.codeHeapType = CODEHEAP_UNKNOWN;
}

return jitCodeHeapInfo;
}

HRESULT
ClrDataAccess::GetStackLimits(CLRDATA_ADDRESS threadPtr, CLRDATA_ADDRESS *lower,
CLRDATA_ADDRESS *upper, CLRDATA_ADDRESS *fp)
Expand Down
33 changes: 33 additions & 0 deletions src/coreclr/src/debug/di/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2173,6 +2173,10 @@ HRESULT CordbProcess::QueryInterface(REFIID id, void **pInterface)
{
*pInterface = static_cast<ICorDebugProcess10*>(this);
}
else if (id == IID_ICorDebugProcess11)
{
*pInterface = static_cast<ICorDebugProcess11*>(this);
}
else if (id == IID_IUnknown)
{
*pInterface = static_cast<IUnknown*>(static_cast<ICorDebugProcess*>(this));
Expand Down Expand Up @@ -2531,6 +2535,35 @@ COM_METHOD CordbProcess::EnableGCNotificationEvents(BOOL fEnable)
return hr;
}

//-----------------------------------------------------------
// ICorDebugProcess11
//-----------------------------------------------------------
COM_METHOD CordbProcess::EnumerateLoaderHeapMemoryRegions(ICorDebugMemoryRangeEnum **ppRanges)
{
VALIDATE_POINTER_TO_OBJECT(ppRanges, ICorDebugMemoryRangeEnum **);
FAIL_IF_NEUTERED(this);

HRESULT hr = S_OK;

PUBLIC_API_BEGIN(this);
{
DacDbiArrayList<COR_MEMORY_RANGE> heapRanges;

hr = GetDAC()->GetLoaderHeapMemoryRanges(&heapRanges);

if (SUCCEEDED(hr))
{
RSInitHolder<CordbMemoryRangeEnumerator> heapSegmentEnumerator(
new CordbMemoryRangeEnumerator(this, &heapRanges[0], (DWORD)heapRanges.Count()));

GetContinueNeuterList()->Add(this, heapSegmentEnumerator);
heapSegmentEnumerator.TransferOwnershipExternal(ppRanges);
}
}
PUBLIC_API_END(hr);
return hr;
}

HRESULT CordbProcess::GetTypeForObject(CORDB_ADDRESS addr, CordbAppDomain* pAppDomainOverride, CordbType **ppType, CordbAppDomain **pAppDomain)
{
VMPTR_AppDomain appDomain;
Expand Down
13 changes: 11 additions & 2 deletions src/coreclr/src/debug/di/rspriv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1668,6 +1668,11 @@ typedef CordbEnumerator<COR_SEGMENT,
ICorDebugHeapSegmentEnum, IID_ICorDebugHeapSegmentEnum,
IdentityConvert<COR_SEGMENT> > CordbHeapSegmentEnumerator;

typedef CordbEnumerator<COR_MEMORY_RANGE,
COR_MEMORY_RANGE,
ICorDebugMemoryRangeEnum, IID_ICorDebugMemoryRangeEnum,
IdentityConvert<COR_MEMORY_RANGE> > CordbMemoryRangeEnumerator;

typedef CordbEnumerator<CorDebugExceptionObjectStackFrame,
CorDebugExceptionObjectStackFrame,
ICorDebugExceptionObjectCallStackEnum, IID_ICorDebugExceptionObjectCallStackEnum,
Expand Down Expand Up @@ -2931,6 +2936,7 @@ class CordbProcess :
public ICorDebugProcess7,
public ICorDebugProcess8,
public ICorDebugProcess10,
public ICorDebugProcess11,
public IDacDbiInterface::IAllocator,
public IDacDbiInterface::IMetaDataLookup,
public IProcessShimHooks
Expand Down Expand Up @@ -3144,6 +3150,11 @@ class CordbProcess :
//-----------------------------------------------------------
COM_METHOD EnableGCNotificationEvents(BOOL fEnable);

//-----------------------------------------------------------
// ICorDebugProcess11
//-----------------------------------------------------------
COM_METHOD EnumerateLoaderHeapMemoryRegions(ICorDebugMemoryRangeEnum **ppRanges);

//-----------------------------------------------------------
// Methods not exposed via a COM interface.
//-----------------------------------------------------------
Expand Down Expand Up @@ -11822,5 +11833,3 @@ struct RSDebuggingInfo
#include "rspriv.inl"

#endif // #if RSPRIV_H


Loading