Created
January 14, 2024 23:07
-
-
Save Be1zebub/b1f38d171f6f9c00dfd4b2af7dab3775 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function debug.Trace() | |
local level = 1 | |
Msg( "\nTrace:\n" ) | |
while true do | |
local info = debug.getinfo( level, "Sln" ) | |
if ( !info ) then break end | |
local indent = string.rep("\t", level) | |
if ( info.what ) == "C" then | |
Msg( string.format( "%s%i: %s - C function\n", indent, level, info.name ) ) | |
else | |
Msg( string.format( "%s%i: %s - %s:%d\n", indent, level, info.name, info.short_src, info.currentline ) ) | |
end | |
level = level + 1 | |
end | |
Msg( "\n" ) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment