951 if (!SymGetTypeInfo(
m_hProcess, modBase, dwTypeIndex, TI_GET_SYMTAG, &typeTag))
952 return pszCurrBuffer;
956 WCHAR * pwszTypeName;
957 if (SymGetTypeInfo(
m_hProcess, modBase, dwTypeIndex, TI_GET_SYMNAME,
961 if (wcscmp(pwszTypeName, L
"std::basic_string<char,std::char_traits<char>,std::allocator<char> >") == 0)
963 LocalFree(pwszTypeName);
968 if (Name !=
NULL && Name[0] !=
'\0')
971 return pszCurrBuffer;
975 wcstombs(buffer, pwszTypeName,
sizeof(buffer));
977 if (Name !=
NULL && Name[0] !=
'\0')
982 else if (buffer[0] !=
'\0')
985 LocalFree(pwszTypeName);
987 else if (Name !=
NULL && Name[0] !=
'\0')
993 if (typeTag == SymTagBaseClass)
995 return pszCurrBuffer;
1001 case SymTagPointerType:
1002 if (SymGetTypeInfo(
m_hProcess, modBase, dwTypeIndex, TI_GET_TYPEID, &innerTypeID))
1004 if (Name !=
NULL && Name[0] !=
'\0')
1008 SymGetTypeInfo(
m_hProcess, modBase, dwTypeIndex, TI_GET_IS_REFERENCE, &isReference);
1010 char addressStr[40];
1011 memset(addressStr, 0,
sizeof(addressStr));
1026 logChildren =
false;
1030 logChildren =
false;
1032 pszCurrBuffer =
DumpTypeIndex(pszCurrBuffer, modBase, innerTypeID, nestingLevel + 1,
1033 address, bHandled, Name, addressStr,
false, logChildren);
1041 if (address ==
NULL)
1049 SymGetTypeInfo(
m_hProcess, modBase, innerTypeID, TI_GET_LENGTH, &length);
1055 return pszCurrBuffer;
1057 else if (address ==
NULL)
1063 return pszCurrBuffer;
1068 if (SymGetTypeInfo(
m_hProcess, modBase, dwTypeIndex, TI_GET_TYPEID, &innerTypeID))
1071 if (!SymGetTypeInfo(
m_hProcess, modBase, innerTypeID, TI_GET_SYMTAG, &innerTypeTag))
1074 switch (innerTypeTag)
1078 logChildren =
false;
1079 pszCurrBuffer =
DumpTypeIndex(pszCurrBuffer, modBase, innerTypeID, nestingLevel + 1,
1080 offset, bHandled,
symbolDetails.top().Name.c_str(),
"",
false, logChildren);
1082 case SymTagPointerType:
1083 if (Name !=
NULL && Name[0] !=
'\0')
1085 pszCurrBuffer =
DumpTypeIndex(pszCurrBuffer, modBase, innerTypeID, nestingLevel + 1,
1086 offset, bHandled,
symbolDetails.top().Name.c_str(),
"",
false, logChildren);
1088 case SymTagArrayType:
1089 pszCurrBuffer =
DumpTypeIndex(pszCurrBuffer, modBase, innerTypeID, nestingLevel + 1,
1090 offset, bHandled,
symbolDetails.top().Name.c_str(),
"",
false, logChildren);
1097 case SymTagArrayType:
1098 if (SymGetTypeInfo(
m_hProcess, modBase, dwTypeIndex, TI_GET_TYPEID, &innerTypeID))
1103 pszCurrBuffer =
DumpTypeIndex(pszCurrBuffer, modBase, innerTypeID, nestingLevel + 1,
1104 offset, bHandled, Name,
"",
false,
false);
1109 DWORD elementsCount;
1110 if (SymGetTypeInfo(
m_hProcess, modBase, dwTypeIndex, TI_GET_COUNT, &elementsCount))
1111 symbolDetails.top().Suffix +=
"[" + std::to_string(elementsCount) +
"]";
1125 SymGetTypeInfo(
m_hProcess, modBase, innerTypeID, TI_GET_LENGTH, &length);
1132 FormatOutputValue(buffer, basicType, length, (PVOID)offset,
sizeof(buffer), elementsCount);
1139 symbolDetails.top().Suffix +=
"[" + std::to_string(index) +
"]";
1140 FormatOutputValue(buffer, basicType, length, (PVOID)(offset + length * index),
sizeof(buffer));
1147 return pszCurrBuffer;
1150 case SymTagBaseType:
1153 return pszCurrBuffer;
1159 DWORD dwChildrenCount = 0;
1160 SymGetTypeInfo(
m_hProcess, modBase, dwTypeIndex, TI_GET_CHILDRENCOUNT, &dwChildrenCount);
1162 if (!dwChildrenCount)
1163 return pszCurrBuffer;
1168 struct FINDCHILDREN : TI_FINDCHILDREN_PARAMS
1170 ULONG MoreChildIds[1024*2];
1171 FINDCHILDREN(){
Count =
sizeof(MoreChildIds) /
sizeof(MoreChildIds[0]);}
1174 children.Count = dwChildrenCount;
1178 if (!SymGetTypeInfo(
m_hProcess, modBase, dwTypeIndex, TI_FINDCHILDREN,
1181 return pszCurrBuffer;
1185 for (
unsigned i = 0; i < dwChildrenCount; i++)
1188 SymGetTypeInfo(
m_hProcess, modBase, children.ChildId[i], TI_GET_SYMTAG, &symTag);
1190 if (symTag == SymTagFunction ||
1191 symTag == SymTagEnum ||
1192 symTag == SymTagTypedef ||
1193 symTag == SymTagVTable)
1198 SymGetTypeInfo(
m_hProcess, modBase, children.ChildId[i], TI_GET_DATAKIND, &dataKind);
1209 return pszCurrBuffer;
1217 DWORD dwMemberOffset;
1218 SymGetTypeInfo(
m_hProcess, modBase, children.ChildId[i],
1219 TI_GET_OFFSET, &dwMemberOffset);
1222 DWORD_PTR dwFinalOffset = offset + dwMemberOffset;
1225 children.ChildId[i], nestingLevel+1,
1226 dwFinalOffset, bHandled2,
"",
"",
true,
true);
1237 SymGetTypeInfo(
m_hProcess, modBase, children.ChildId[i],
1238 TI_GET_TYPEID, &typeId);
1242 SymGetTypeInfo(
m_hProcess, modBase, typeId, TI_GET_LENGTH, &length);
1245 FormatOutputValue(buffer, basicType, length, (PVOID)dwFinalOffset,
sizeof(buffer));
1253 return pszCurrBuffer;
static HANDLE m_hProcess
Definition: WheatyExceptionReport.h:196
const char *const rgBaseType[]
Definition: WheatyExceptionReport.h:58
static BasicType GetBasicType(DWORD typeIndex, DWORD64 modBase)
Definition: WheatyExceptionReport.cpp:1335
static std::stack< SymbolDetail > symbolDetails
Definition: WheatyExceptionReport.h:198
#define WER_MAX_ARRAY_ELEMENTS_COUNT
Definition: WheatyExceptionReport.h:15
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: WheatyExceptionReport.h:52
static void FormatOutputValue(char *pszCurrBuffer, BasicType basicType, DWORD64 length, PVOID pAddress, size_t bufferSize, size_t countOverride=0)
Definition: WheatyExceptionReport.cpp:1256
Definition: WheatyExceptionReport.h:48
BasicType
Definition: WheatyExceptionReport.h:19
Definition: WheatyExceptionReport.h:54
static char * PopSymbolDetail(char *pszCurrBuffer)
Definition: WheatyExceptionReport.cpp:1438
unsigned long DWORD_PTR
Definition: CascPort.h:140
Definition: WheatyExceptionReport.h:41
Definition: WheatyExceptionReport.h:23
unsigned int DWORD
Definition: CascPort.h:139
#define ULONG64
Definition: stdsoap2.h:921
float length(float v)
Definition: vectorMath.h:208
Definition: WheatyExceptionReport.h:22
static bool StoreSymbol(DWORD type, DWORD_PTR offset)
Definition: WheatyExceptionReport.cpp:1418
#define WER_MAX_NESTING_LEVEL
Definition: WheatyExceptionReport.h:16
Definition: WheatyExceptionReport.h:21
static char * DumpTypeIndex(char *, DWORD64, DWORD, unsigned, DWORD_PTR, bool &, const char *, char *, bool, bool)
Definition: WheatyExceptionReport.cpp:933
static DWORD_PTR DereferenceUnsafePointer(DWORD_PTR address)
Definition: WheatyExceptionReport.cpp:1359
static char * PushSymbolDetail(char *pszCurrBuffer)
Definition: WheatyExceptionReport.cpp:1430