MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / LogStackTrace

Function LogStackTrace

core/logic/smn_core.cpp:1202–1220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1200}
1201
1202static 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
1222REGISTER_NATIVES(coreNatives)
1223{

Callers

nothing calls this directly

Calls 7

GetStackTraceMethod · 0.80
FormatStringMethod · 0.45
FindPluginByContextMethod · 0.45
LogErrorMethod · 0.45
GetFilenameMethod · 0.45
sizeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected