| 1154 | } |
| 1155 | |
| 1156 | void StackWalker::OnCallstackEntry(CallstackEntryType eType, CallstackEntry &entry) |
| 1157 | { |
| 1158 | CHAR buffer[STACKWALK_MAX_NAMELEN]; |
| 1159 | if ( (eType != lastEntry) && (entry.offset != 0) ) |
| 1160 | { |
| 1161 | if (entry.name[0] == 0) |
| 1162 | strcpy_s(entry.name, "(function-name not available)"); |
| 1163 | if (entry.undName[0] != 0) |
| 1164 | strcpy_s(entry.name, entry.undName); |
| 1165 | if (entry.undFullName[0] != 0) |
| 1166 | strcpy_s(entry.name, entry.undFullName); |
| 1167 | if (entry.lineFileName[0] == 0) |
| 1168 | { |
| 1169 | strcpy_s(entry.lineFileName, "(filename not available)"); |
| 1170 | if (entry.moduleName[0] == 0) |
| 1171 | strcpy_s(entry.moduleName, "(module-name not available)"); |
| 1172 | _snprintf_s(buffer, STACKWALK_MAX_NAMELEN, "%p (%s): %s: %s\n", (LPVOID) entry.offset, entry.moduleName, entry.lineFileName, entry.name); |
| 1173 | } |
| 1174 | else |
| 1175 | _snprintf_s(buffer, STACKWALK_MAX_NAMELEN, "%s (%d): %s\n", entry.lineFileName, entry.lineNumber, entry.name); |
| 1176 | OnOutput(buffer); |
| 1177 | } |
| 1178 | } |
| 1179 | |
| 1180 | void StackWalker::OnSymInit(LPCSTR szSearchPath, DWORD symOptions, LPCSTR szUserName) |
| 1181 | { |