Core/Crash reporting: Add support to char* arrays

Add support to char* array showing the string value instead of the pointer address
This commit is contained in:
jackpoz
2018-01-01 13:17:15 +01:00
parent 318498ee27
commit 4c0c4ab271

View File

@@ -1084,6 +1084,7 @@ bool logChildren)
offset, bHandled, Name, "", false, false);
// Set Value back to an empty string since the Array object itself has no value, only its elements have
std::string firstElementValue = symbolDetails.top().Value;
symbolDetails.top().Value.clear();
DWORD elementsCount;
@@ -1115,10 +1116,30 @@ bool logChildren)
default:
for (DWORD index = 0; index < elementsCount && index < WER_MAX_ARRAY_ELEMENTS_COUNT; index++)
{
bool elementHandled = false;
PushSymbolDetail();
symbolDetails.top().Suffix += "[" + std::to_string(index) + "]";
FormatOutputValue(buffer, basicType, length, (PVOID)(offset + length * index), sizeof(buffer));
symbolDetails.top().Value = buffer;
if (index == 0)
{
if (firstElementValue.empty())
{
FormatOutputValue(buffer, basicType, length, (PVOID)(offset + length * index), sizeof(buffer));
firstElementValue = buffer;
}
symbolDetails.top().Value = firstElementValue;
}
else
{
DumpTypeIndex(modBase, innerTypeID, offset + length * index, elementHandled, "", "", false, false);
if (!elementHandled)
{
FormatOutputValue(buffer, basicType, length, (PVOID)(offset + length * index), sizeof(buffer));
symbolDetails.top().Value = buffer;
}
}
symbolDetails.top().Prefix.clear();
symbolDetails.top().Type.clear();
symbolDetails.top().Suffix = "[" + std::to_string(index) + "]";
symbolDetails.top().Name.clear();
PopSymbolDetail();
}
break;