summaryrefslogtreecommitdiff
path: root/tex/context/base/trac-deb.tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/trac-deb.tex')
-rw-r--r--tex/context/base/trac-deb.tex43
1 files changed, 43 insertions, 0 deletions
diff --git a/tex/context/base/trac-deb.tex b/tex/context/base/trac-deb.tex
new file mode 100644
index 000000000..870c452ad
--- /dev/null
+++ b/tex/context/base/trac-deb.tex
@@ -0,0 +1,43 @@
+%D \module
+%D [ file=trac-deb,
+%D version=2005.11.06,
+%D title=\CONTEXT\ Tracing Macros,
+%D subtitle=Debugger,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright=PRAGMA]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{ConTeXt Tracing Macros / Debugger}
+
+\registerctxluafile{trac-deb}{1.001}
+
+\def\showdebuginfo{\ctxlua{tracers.showdebuginfo()}}
+\def\overloaderror{\ctxlua{tracers.overloaderror()}}
+
+\def\breakpoint{\showdebuginfo\wait}
+
+\appendtoks
+ \ctxlua {
+ if debugger.tracing() then
+ debugger.enable() ;
+ end
+ }%
+\to \everyjob
+
+\appendtoks
+ \ctxlua {
+ if debugger.tracing() then
+ debugger.disable() ;
+ debugger.savestats("\jobname-luacalls.log") ;
+ end
+ }%
+\to \everybye
+
+\def\showtrackers {\ctxlua{trackers.show()}}
+\def\resettrackers {\ctxlua{trackers.reset()}}
+\def\enabletrackers [#1]{\ctxlua{trackers.enable("#1")}}
+\def\disabletrackers[#1]{\ctxlua{trackers.disable("#1")}}