Skip to content

Commit

Permalink
Add ICLRDataEnumMemoryRegionsLoggingCallback callback to enummemory cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
mikem8361 committed Aug 8, 2022
1 parent 1d1c7b9 commit 5ca4d2a
Show file tree
Hide file tree
Showing 4 changed files with 213 additions and 18 deletions.
15 changes: 14 additions & 1 deletion src/SOS/Strike/strike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15696,7 +15696,7 @@ DECLARE_API(StopOnCatch)
return S_OK;
}

class EnumMemoryCallback : public ICLRDataEnumMemoryRegionsCallback
class EnumMemoryCallback : public ICLRDataEnumMemoryRegionsCallback, ICLRDataEnumMemoryRegionsLoggingCallback
{
private:
LONG m_ref;
Expand Down Expand Up @@ -15724,6 +15724,12 @@ class EnumMemoryCallback : public ICLRDataEnumMemoryRegionsCallback
AddRef();
return S_OK;
}
else if (InterfaceId == IID_ICLRDataEnumMemoryRegionsLoggingCallback)
{
*Interface = (ICLRDataEnumMemoryRegionsLoggingCallback*)this;
AddRef();
return S_OK;
}
else
{
*Interface = nullptr;
Expand Down Expand Up @@ -15757,6 +15763,13 @@ class EnumMemoryCallback : public ICLRDataEnumMemoryRegionsCallback
}
return S_OK;
}

HRESULT STDMETHODCALLTYPE LogMessage(
/* [in] */ LPCSTR message)
{
ExtOut("%s", message);
return S_OK;
}
};

DECLARE_API(enummemory)
Expand Down
15 changes: 15 additions & 0 deletions src/shared/inc/clrdata.idl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import "unknwn.idl";
interface ICLRDataEnumMemoryRegions;
interface ICLRDataEnumMemoryRegionsCallback;
interface ICLRDataEnumMemoryRegionsCallback2;
interface ICLRDataEnumMemoryRegionsCallback3;
interface ICLRDataTarget;
interface ICLRDataTarget2;
interface ICLRMetadataLocator;
Expand Down Expand Up @@ -287,6 +288,20 @@ interface ICLRDataEnumMemoryRegionsCallback2 : ICLRDataEnumMemoryRegionsCallback
[in, size_is(bufferSize)] BYTE* buffer);
}

/*
* Optional callback interface for logging EnumMemoryRegions operations and errors.
*/
[
object,
local,
uuid(F315248D-8B79-49DB-B184-37426559F703)
]
interface ICLRDataEnumMemoryRegionsLoggingCallback : IUnknown
{
HRESULT LogMessage(
[in] LPCSTR message);
}

/*
* Flags for controlling which memory regions are enumerated.
*/
Expand Down
14 changes: 7 additions & 7 deletions src/shared/pal/prebuilt/idl/clrdata_i.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.


/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */

/* link this file in with the server and any clients */


/* File created by MIDL compiler version 8.01.0622 */
/* at Mon Jan 18 19:14:07 2038
*/
/* Compiler settings for C:/ssd/runtime/src/coreclr/inc/clrdata.idl:
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.01.0622
/* File created by MIDL compiler version 8.01.0626 */
/* Compiler settings for clrdata.idl:
Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0626
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
Expand Down Expand Up @@ -89,6 +86,9 @@ MIDL_DEFINE_GUID(IID, IID_ICLRDataEnumMemoryRegionsCallback,0xBCDD6908,0xBA2D,0x
MIDL_DEFINE_GUID(IID, IID_ICLRDataEnumMemoryRegionsCallback2,0x3721A26F,0x8B91,0x4D98,0xA3,0x88,0xDB,0x17,0xB3,0x56,0xFA,0xDB);


MIDL_DEFINE_GUID(IID, IID_ICLRDataEnumMemoryRegionsLoggingCallback,0xF315248D,0x8B79,0x49DB,0xB1,0x84,0x37,0x42,0x65,0x59,0xF7,0x03);


MIDL_DEFINE_GUID(IID, IID_ICLRDataEnumMemoryRegions,0x471c35b4,0x7c2f,0x4ef0,0xa9,0x45,0x00,0xf8,0xc3,0x80,0x56,0xf1);

#undef MIDL_DEFINE_GUID
Expand Down
Loading

0 comments on commit 5ca4d2a

Please sign in to comment.