diff options
author | jackpoz <giacomopoz@gmail.com> | 2018-01-01 13:17:15 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-04-16 21:03:23 +0200 |
commit | 5b4f61d915475e44369430994cb636d14c2976b8 (patch) | |
tree | a484d738f5831114a361a01d5edb399230c44ebd /src | |
parent | 4f643e3f32ac6f906a6d642fe4102f8075b7e975 (diff) |
Core/Crash reporting: Add support to char* arrays
Add support to char* array showing the string value instead of the pointer address
(cherry picked from commit 4c0c4ab271ddc2d200cd9ccda98e16553dcaf391)
Diffstat (limited to 'src')
-rw-r--r-- | src/common/Debugging/WheatyExceptionReport.cpp | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/common/Debugging/WheatyExceptionReport.cpp b/src/common/Debugging/WheatyExceptionReport.cpp index 8d7f3905505..5521d574404 100644 --- a/src/common/Debugging/WheatyExceptionReport.cpp +++ b/src/common/Debugging/WheatyExceptionReport.cpp @@ -1096,6 +1096,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; @@ -1127,10 +1128,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; |