{"name":"diag_stacktrace","title":"diag stacktrace","type":"command","url":"https://community.bistudio.com/wiki/diag_stacktrace","revid":379209,"updated":"2026-10-30T21:14:48Z","groups":["Diagnostic"],"status":"ok","games":{"arma3":"2.06"},"since":"arma3 2.06","arma3_since":"2.06","description":"Returns an array containing the function name, line number, scope name and all local variables in form of a hashmap.","syntaxes":[{"syntax":"diag_stacktrace","params":[],"returns":{"type":"Array of Arrays","type_expr":"Array<Array>","description":"in format:\n```sqf params [\"_functionName\", \"_lineNumber\", \"_scopeName\", \"_variablesHashmap\"]; ``` - _functionName: String - function name - _lineNumber: Number - line number - _scopeName: String - scope name - _variablesHashmap: HashMap - all local variables","text":"Array of Arrays, in format:\n\n```sqf\nparams [\"_functionName\", \"_lineNumber\", \"_scopeName\", \"_variablesHashmap\"];\n```\n\n- _functionName: String - function name\n- _lineNumber: Number - line number\n- _scopeName: String - scope name\n- _variablesHashmap: HashMap - all local variables"},"form":"nullary"}],"examples":[{"text":"```sqf\nprivate _testvar = 1;\nprivate _testother = 2;\ncall\n{\n    _testvar = 3;\n    if (_testvar == 3) then\n    {\n        _myVariable = 4;\n        hint str diag_stacktrace;\n    };\n};\n/*\n[\n    [\"\", 3, \"\", [[\"_this\", []], [\"_testother\", 2], [\"_testvar\", 3]]],\n    [\"\", 6, \"\", []],\n    [\"\", 8, \"\", [[\"_myvariable\", 4]]]\n]\n*/\n```","code":["private _testvar = 1;\nprivate _testother = 2;\ncall \n{\n\t_testvar = 3;\n\tif (_testvar == 3) then \n\t{\n\t\t_myVariable = 4;\n\t\thint str diag_stacktrace;\n\t};\n};\n/*\n[\n\t[\"\", 3, \"\", [[\"_this\", []], [\"_testother\", 2], [\"_testvar\", 3]]],\n\t[\"\", 6, \"\", []],\n\t[\"\", 8, \"\", [[\"_myvariable\", 4]]]\n]\n*/"]}],"see_also":["arma.RPT","diag_dumpCalltraceToLog","diag_log"]}