Commit 925a6942 authored by ussrhero's avatar ussrhero

print for .Net Array

parent f10481a4
......@@ -222,7 +222,6 @@ std::wstring NetObjectClass::str()
sstr << L"Managed class: " << typeInfo->getName() << L" at " << std::hex << m_address << std::endl;
for ( auto field : m_fields )
{
CComPtr<ICorDebugValue> fieldValue;
......@@ -313,6 +312,8 @@ size_t NetObjectArray::getElementCount()
return m_dimensions.back();
}
///////////////////////////////////////////////////////////////////////////////
MEMOFFSET_64 NetObjectArray::getAddress() const
{
MEMOFFSET_64 address;
......@@ -325,6 +326,31 @@ MEMOFFSET_64 NetObjectArray::getAddress() const
///////////////////////////////////////////////////////////////////////////////
std::wstring NetObjectArray::printValue() const
{
std::wstringstream sstr;
sstr << L"Array of ";
CORDB_ADDRESS address;
HRESULT hres = m_arrayValue->GetAddress(&address);
if (FAILED(hres))
throw DbgException("Failed ICorDebugArrayValue::GetAddress");
COR_TYPEID typeId;
hres = g_netMgr->targetProcess5()-> GetTypeID(address, &typeId);
if (FAILED(hres))
throw DbgException("Failed ICorDebugProcess5::GetTypeID");
TypeInfoPtr arrayType = getNetTypeById(typeId);
sstr << arrayType->getName();
return sstr.str();
}
///////////////////////////////////////////////////////////////////////////////
std::wstring NetObjectString::getStrValue() const
{
ULONG32 strLength = 0;
......
......@@ -260,9 +260,7 @@ private:
virtual MEMOFFSET_64 getAddress() const;
virtual std::wstring printValue() const {
return L"Array";
}
virtual std::wstring printValue() const;
private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment