diff options
author | David Walter Seikel | 2014-04-21 20:59:39 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-04-21 20:59:39 +1000 |
commit | 9621add2918cc4943e6693b74ae85d51dd264fcf (patch) | |
tree | fff1edf2c69d7a08a0e12885eecc9b96ed847a6a /LuaSL/testLua/yueliang-0.4.1/test_lua/5.0/trace-calls.lua | |
parent | LuaSL_test's window doesn't need to be so huge. (diff) | |
download | SledjHamr-9621add2918cc4943e6693b74ae85d51dd264fcf.zip SledjHamr-9621add2918cc4943e6693b74ae85d51dd264fcf.tar.gz SledjHamr-9621add2918cc4943e6693b74ae85d51dd264fcf.tar.bz2 SledjHamr-9621add2918cc4943e6693b74ae85d51dd264fcf.tar.xz |
We don't need the testlua directory any more.
Diffstat (limited to '')
-rw-r--r-- | LuaSL/testLua/yueliang-0.4.1/test_lua/5.0/trace-calls.lua | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/LuaSL/testLua/yueliang-0.4.1/test_lua/5.0/trace-calls.lua b/LuaSL/testLua/yueliang-0.4.1/test_lua/5.0/trace-calls.lua deleted file mode 100644 index 63c8b8f..0000000 --- a/LuaSL/testLua/yueliang-0.4.1/test_lua/5.0/trace-calls.lua +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | -- trace calls | ||
2 | -- example: lua -ltrace-calls.lua bisect.lua | ||
3 | |||
4 | local level=0 | ||
5 | |||
6 | function hook(event) | ||
7 | local t=debug.getinfo(3) | ||
8 | io.write(level," >>> ",string.rep(" ",level)) | ||
9 | if t~=nil and t.currentline>=0 then io.write(t.short_src,":",t.currentline," ") end | ||
10 | t=debug.getinfo(2) | ||
11 | if event=="call" then | ||
12 | level=level+1 | ||
13 | else | ||
14 | level=level-1 if level<0 then level=0 end | ||
15 | end | ||
16 | if t.what=="main" then | ||
17 | if event=="call" then | ||
18 | io.write("begin ",t.short_src) | ||
19 | else | ||
20 | io.write("end ",t.short_src) | ||
21 | end | ||
22 | elseif t.what=="Lua" then | ||
23 | -- table.foreach(t,print) | ||
24 | io.write(event," ",t.name or "(Lua)"," <",t.linedefined,":",t.short_src,">") | ||
25 | else | ||
26 | io.write(event," ",t.name or "(C)"," [",t.what,"] ") | ||
27 | end | ||
28 | io.write("\n") | ||
29 | end | ||
30 | |||
31 | debug.sethook(hook,"cr") | ||
32 | level=0 | ||