aboutsummaryrefslogtreecommitdiff
path: root/src/common/Debugging/WheatyExceptionReport.cpp
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2018-01-01 13:17:15 +0100
committerjackpoz <giacomopoz@gmail.com>2018-01-01 13:17:15 +0100
commit4c0c4ab271ddc2d200cd9ccda98e16553dcaf391 (patch)
tree0681d1953af334c6067b3c5d694bb53a2f225e09 /src/common/Debugging/WheatyExceptionReport.cpp
parent318498ee278ab77f0fc9018a4137ef6f2813e1d6 (diff)
Core/Crash reporting: Add support to char* arrays
Add support to char* array showing the string value instead of the pointer address
Diffstat (limited to 'src/common/Debugging/WheatyExceptionReport.cpp')
-rw-r--r--src/common/Debugging/WheatyExceptionReport.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/common/Debugging/WheatyExceptionReport.cpp b/src/common/Debugging/WheatyExceptionReport.cpp
index f541efcc001..61992c9b487 100644
--- a/src/common/Debugging/WheatyExceptionReport.cpp
+++ b/src/common/Debugging/WheatyExceptionReport.cpp
@@ -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;