* Update DumpObj command to show TrackedType and TaggedMemory if applicable.
* Update DML for tagged memory to compute the pointer size of memory dynamically.
}
}
+ // Check for Tracked Type and tagged memory
+ ReleaseHolder<ISOSDacInterface11> sos11;
+ if (SUCCEEDED(g_sos->QueryInterface(__uuidof(ISOSDacInterface11), &sos11)))
+ {
+ CLRDATA_ADDRESS objAddr = TO_CDADDR(taObj);
+ BOOL isTrackedType;
+ BOOL hasTaggedMemory;
+ if (SUCCEEDED(sos11->IsTrackedType(objAddr, &isTrackedType, &hasTaggedMemory)))
+ {
+ ExtOut("Tracked Type: %s\n", isTrackedType ? "true" : "false");
+ if (hasTaggedMemory)
+ {
+ CLRDATA_ADDRESS taggedMemory = NULL;
+ size_t taggedMemorySizeInBytes = 0;
+ (void)sos11->GetTaggedMemory(objAddr, &taggedMemory, &taggedMemorySizeInBytes);
+ DMLOut("Tagged Memory: %s (%" POINTERSIZE_TYPE "d(0x%" POINTERSIZE_TYPE "x) bytes)\n",
+ DMLTaggedMemory(taggedMemory, taggedMemorySizeInBytes / sizeof(void*)), taggedMemorySizeInBytes, taggedMemorySizeInBytes);
+ }
+ }
+ }
+
DWORD_PTR size = (DWORD_PTR)objData.Size;
ExtOut("Size: %" POINTERSIZE_TYPE "d(0x%" POINTERSIZE_TYPE "x) bytes\n", size, size);
"<exec cmd=\"!DumpIL /i %s\">%s</exec>", // DML_IL
"<exec cmd=\"!DumpRCW -cw /d %s\">%s</exec>", // DML_ComWrapperRCW
"<exec cmd=\"!DumpCCW -cw /d %s\">%s</exec>", // DML_ComWrapperCCW
+ "<exec cmd=\"dps %s L%d\">%s</exec>", // DML_TaggedMemory
};
void ConvertToLower(__out_ecount(len) char *buffer, size_t len)
return ret;
}
+CachedString Output::BuildHexValueWithLength(CLRDATA_ADDRESS addr, size_t len, FormatType type, bool fill)
+{
+ CachedString ret;
+ if (ret.IsOOM())
+ {
+ ReportOOM();
+ return ret;
+ }
+
+ if (IsDMLEnabled())
+ {
+ char hex[POINTERSIZE_BYTES*2 + 1];
+ GetHex(addr, hex, _countof(hex), fill);
+ sprintf_s(ret, ret.GetStrLen(), DMLFormats[type], hex, len, hex);
+ }
+ else
+ {
+ GetHex(addr, ret, ret.GetStrLen(), fill);
+ }
+
+ return ret;
+}
+
CachedString Output::BuildVCValue(CLRDATA_ADDRESS mt, CLRDATA_ADDRESS addr, FormatType type, bool fill)
{
_ASSERTE(type == DML_ValueClass);
DML_Async,
DML_IL,
DML_ComWrapperRCW,
- DML_ComWrapperCCW
+ DML_ComWrapperCCW,
+ DML_TaggedMemory
};
/**********************************************************************\
\**********************************************************************/
CachedString BuildHexValue(CLRDATA_ADDRESS addr, FormatType type, bool fill = true);
+ /**********************************************************************\
+ * This function builds a DML string for an object. If DML is enabled, *
+ * this function returns a DML string based on the format type. *
+ * Otherwise this returns a string containing only the hex value of *
+ * addr. *
+ * *
+ * Params: *
+ * addr - the address of the object *
+ * len - associated length *
+ * type - the format type to use to output this object *
+ * fill - whether or not to pad the hex value with zeros *
+ * *
+ \**********************************************************************/
+ CachedString BuildHexValueWithLength(CLRDATA_ADDRESS addr, size_t len, FormatType type, bool fill = true);
+
/**********************************************************************\
* This function builds a DML string for an managed variable name. *
* If DML is enabled, this function returns a DML string that will *
#define DMLIL(addr) Output::BuildHexValue(addr, Output::DML_IL).GetPtr()
#define DMLComWrapperRCW(addr) Output::BuildHexValue(addr, Output::DML_ComWrapperRCW).GetPtr()
#define DMLComWrapperCCW(addr) Output::BuildHexValue(addr, Output::DML_ComWrapperCCW).GetPtr()
+#define DMLTaggedMemory(addr, len) Output::BuildHexValueWithLength(addr, len, Output::DML_TaggedMemory).GetPtr()
bool IsDMLEnabled();
HRESULT IsComWrappersRCW(CLRDATA_ADDRESS rcw, BOOL *isComWrappersRCW);
HRESULT GetComWrappersRCWData(CLRDATA_ADDRESS rcw, CLRDATA_ADDRESS *identity);
}
+
+[
+ object,
+ local,
+ uuid(96BA1DB9-14CD-4492-8065-1CAAECF6E5CF)
+]
+interface ISOSDacInterface11 : IUnknown
+{
+ HRESULT IsTrackedType(CLRDATA_ADDRESS objAddr, BOOL* isTrackedType, BOOL* hasTaggedMemory);
+ HRESULT GetTaggedMemory(CLRDATA_ADDRESS objAddr, CLRDATA_ADDRESS* taggedMemory, size_t* taggedMemorySizeInBytes);
+}
MIDL_DEFINE_GUID(IID, IID_ISOSDacInterface10,0x90B8FCC3,0x7251,0x4B0A,0xAE,0x3D,0x5C,0x13,0xA6,0x7E,0xC9,0xAA);
+MIDL_DEFINE_GUID(IID, IID_ISOSDacInterface11,0x96BA1DB9,0x14CD,0x4492,0x80,0x65,0x1C,0xAA,0xEC,0xF6,0xE5,0xCF);
+
+
#undef MIDL_DEFINE_GUID
#ifdef __cplusplus
#endif /* __ISOSDacInterface10_INTERFACE_DEFINED__ */
+#ifndef __ISOSDacInterface11_INTERFACE_DEFINED__
+#define __ISOSDacInterface11_INTERFACE_DEFINED__
+
+/* interface ISOSDacInterface11 */
+/* [uuid][local][object] */
+
+
+EXTERN_C const IID IID_ISOSDacInterface11;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("96BA1DB9-14CD-4492-8065-1CAAECF6E5CF")
+ ISOSDacInterface11 : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE IsTrackedType(
+ CLRDATA_ADDRESS objAddr,
+ BOOL *isTrackedType,
+ BOOL *hasTaggedMemory) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetTaggedMemory(
+ CLRDATA_ADDRESS objAddr,
+ CLRDATA_ADDRESS *taggedMemory,
+ size_t *taggedMemorySizeInBytes) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ISOSDacInterface11Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ISOSDacInterface11 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ISOSDacInterface11 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ISOSDacInterface11 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *IsTrackedType )(
+ ISOSDacInterface11 * This,
+ CLRDATA_ADDRESS objAddr,
+ BOOL *isTrackedType,
+ BOOL *hasTaggedMemory);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTaggedMemory )(
+ ISOSDacInterface11 * This,
+ CLRDATA_ADDRESS objAddr,
+ CLRDATA_ADDRESS *taggedMemory,
+ size_t *taggedMemorySizeInBytes);
+
+ END_INTERFACE
+ } ISOSDacInterface11Vtbl;
+
+ interface ISOSDacInterface11
+ {
+ CONST_VTBL struct ISOSDacInterface11Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ISOSDacInterface11_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ISOSDacInterface11_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ISOSDacInterface11_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ISOSDacInterface11_IsTrackedType(This,objAddr,isTrackedType,hasTaggedMemory) \
+ ( (This)->lpVtbl -> IsTrackedType(This,objAddr,isTrackedType,hasTaggedMemory) )
+
+#define ISOSDacInterface11_GetTaggedMemory(This,objAddr,taggedMemory,taggedMemorySizeInBytes) \
+ ( (This)->lpVtbl -> GetTaggedMemory(This,objAddr,taggedMemory,taggedMemorySizeInBytes) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ISOSDacInterface11_INTERFACE_DEFINED__ */
+
/* Additional Prototypes for ALL interfaces */