mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 23:50:44 +01:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user