summaryrefslogtreecommitdiff
path: root/tex/context/base/util-deb.lua
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2014-05-03 13:55:34 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2014-05-03 13:55:34 +0200
commit624cbb5da392e9403984dd1cf368c0d408b1c2a8 (patch)
tree489c049ac849bb5bbce7d32e4df477872c58373d /tex/context/base/util-deb.lua
parent088de88944c1f2254250bb448c7371a87ff7ee39 (diff)
downloadcontext-624cbb5da392e9403984dd1cf368c0d408b1c2a8.tar.gz
2014-01-03 00:42:00
Diffstat (limited to 'tex/context/base/util-deb.lua')
-rw-r--r--tex/context/base/util-deb.lua46
1 files changed, 21 insertions, 25 deletions
diff --git a/tex/context/base/util-deb.lua b/tex/context/base/util-deb.lua
index ee732b3b5..785373f86 100644
--- a/tex/context/base/util-deb.lua
+++ b/tex/context/base/util-deb.lua
@@ -92,41 +92,37 @@ end
function debugger.disable()
debug.sethook()
- -- counters[debug.getinfo(2,"f").func] = nil
+--~ counters[debug.getinfo(2,"f").func] = nil
end
--- debugger.enable()
---
--- print(math.sin(1*.5))
--- print(math.sin(1*.5))
--- print(math.sin(1*.5))
--- print(math.sin(1*.5))
--- print(math.sin(1*.5))
---
--- debugger.disable()
---
--- print("")
--- debugger.showstats()
--- print("")
--- debugger.showstats(print,3)
---
+--~ debugger.enable()
+
+--~ print(math.sin(1*.5))
+--~ print(math.sin(1*.5))
+--~ print(math.sin(1*.5))
+--~ print(math.sin(1*.5))
+--~ print(math.sin(1*.5))
+
+--~ debugger.disable()
+
+--~ print("")
+--~ debugger.showstats()
+--~ print("")
+--~ debugger.showstats(print,3)
+
-- from the lua book:
-local function showtraceback(rep) -- from lua site / adapted
- local level = 2 -- we don't want this function to be reported
- local reporter = rep or report
+function traceback()
+ local level = 1
while true do
- local info = getinfo(level, "Sl")
+ local info = debug.getinfo(level, "Sl")
if not info then
break
elseif info.what == "C" then
- reporter("%2i : %s",level-1,"C function")
+ print(format("%3i : C function",level))
else
- reporter("%2i : %s : %s",level-1,info.short_src,info.currentline)
+ print(format("%3i : [%s]:%d",level,info.short_src,info.currentline))
end
level = level + 1
end
end
-
-debugger.showtraceback = showtraceback
--- debug.showtraceback = showtraceback