| 1200 | } |
| 1201 | |
| 1202 | static cell_t LogStackTrace(IPluginContext *pContext, const cell_t *params) |
| 1203 | { |
| 1204 | char buffer[512]; |
| 1205 | g_pSM->FormatString(buffer, sizeof(buffer), pContext, params, 1); |
| 1206 | |
| 1207 | IFrameIterator *it = pContext->CreateFrameIterator(); |
| 1208 | std::vector<std::string> arr = g_DbgReporter.GetStackTrace(it); |
| 1209 | pContext->DestroyFrameIterator(it); |
| 1210 | |
| 1211 | IPlugin *pPlugin = scripts->FindPluginByContext(pContext); |
| 1212 | |
| 1213 | g_Logger.LogError("[SM] Stack trace requested: %s", buffer); |
| 1214 | g_Logger.LogError("[SM] Called from: %s", pPlugin->GetFilename()); |
| 1215 | for (size_t i = 0; i < arr.size(); ++i) |
| 1216 | { |
| 1217 | g_Logger.LogError("%s", arr[i].c_str()); |
| 1218 | } |
| 1219 | return 0; |
| 1220 | } |
| 1221 | |
| 1222 | REGISTER_NATIVES(coreNatives) |
| 1223 | { |
nothing calls this directly
no test coverage detected