mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Foundation for WoW-compatible addon support: - Vendor Lua 5.1.5 source as a static library (extern/lua-5.1.5) - TocParser: parses .toc files (## directives + file lists) - LuaEngine: Lua 5.1 VM with sandboxed stdlib (no io/os/debug), WoW-compatible print() that outputs to chat, GetTime() stub - AddonManager: scans Data/interface/AddOns/ for .toc files, loads .lua files on world entry, skips LoadOnDemand addons - /run <code> slash command for inline Lua execution - HelloWorld test addon that prints to chat on load Integration: AddonManager initialized after asset manager, addons loaded once on first world entry, reset on logout. XML frame parsing is deferred to a future step.
32 lines
749 B
Lua
32 lines
749 B
Lua
-- trace calls
|
|
-- example: lua -ltrace-calls bisect.lua
|
|
|
|
local level=0
|
|
|
|
local function hook(event)
|
|
local t=debug.getinfo(3)
|
|
io.write(level," >>> ",string.rep(" ",level))
|
|
if t~=nil and t.currentline>=0 then io.write(t.short_src,":",t.currentline," ") end
|
|
t=debug.getinfo(2)
|
|
if event=="call" then
|
|
level=level+1
|
|
else
|
|
level=level-1 if level<0 then level=0 end
|
|
end
|
|
if t.what=="main" then
|
|
if event=="call" then
|
|
io.write("begin ",t.short_src)
|
|
else
|
|
io.write("end ",t.short_src)
|
|
end
|
|
elseif t.what=="Lua" then
|
|
-- table.foreach(t,print)
|
|
io.write(event," ",t.name or "(Lua)"," <",t.linedefined,":",t.short_src,">")
|
|
else
|
|
io.write(event," ",t.name or "(C)"," [",t.what,"] ")
|
|
end
|
|
io.write("\n")
|
|
end
|
|
|
|
debug.sethook(hook,"cr")
|
|
level=0
|