Fix array elements walking
authorIgor Kulaychuk <i.kulaychuk@samsung.com>
Tue, 11 Jul 2017 15:53:39 +0000 (18:53 +0300)
committerIgor Kulaychuk <i.kulaychuk@samsung.com>
Mon, 13 Nov 2017 19:22:40 +0000 (22:22 +0300)
src/debug/debugger/valuewalk.cpp
src/debug/debugger/varobj.cpp

index 34534ac..9351580 100644 (file)
@@ -131,7 +131,9 @@ static HRESULT WalkMembers(ICorDebugValue *pInputValue, ICorDebugILFrame *pILFra
 
         for (ULONG32 i = 0; i < cElements; ++i)
         {
-            IfFailRet(cb(mdMethodDefNil, nullptr, nullptr, nullptr, true, "[" + std::to_string(i) + "]"));
+            ToRelease<ICorDebugValue> pElementValue;
+            pArrayValue->GetElementAtPosition(i, &pElementValue);
+            IfFailRet(cb(mdMethodDefNil, nullptr, nullptr, pElementValue, false, "[" + std::to_string(i) + "]"));
         }
 
         return S_OK;
index 7633f8e..6e60aec 100644 (file)
@@ -119,7 +119,8 @@ static HRESULT FetchFieldsAndProperties(ICorDebugValue *pInputValue,
             return S_OK;
 
         std::string className;
-        TypePrinter::GetTypeOfValue(pType, className);
+        if (pType)
+            TypePrinter::GetTypeOfValue(pType, className);
 
         ICorDebugValue *pResultValue = nullptr;