summaryrefslogtreecommitdiffstats
path: root/share/txr/stdlib/trace.tl
Commit message (Collapse)AuthorAgeFilesLines
* trace: wrong function printed in traces.Kaz Kylheku2017-03-241-3/+4
| | | | | | | | | | | | When tracing for two or more functions is enabled in a single trace form, the the function tracing hooks print the wrong name for all but the rightmost function. * share/txr/stdlib/trace.tl (sys:trace): Fix code which assumes that the each operator binds fresh lexical variables on each iteration. Bind a fresh lexical variable lex-n which copies the current value of the loop variable n, and refer to this lexical out of the tracing lambda.
* trace: implement redefinition checks.Kaz Kylheku2017-03-171-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The tracing module should warn when traced functions or methods are being redefined, and stop tracing the original methods. * eval.c (trace_check): New function. Calls sys:trace-redefined-check if the trace module has been loaded, otherwise does nothing. (op_defun, op_defmacro): Call trace_check to have a warning issued for a redefined traced function or macro. * eval.h (trace_check): Declared. * lisplib.c (trace_loaded): New global variable. (trace_instantiate): Flip trace_loaded to t. * lisplib.h (trace_loaded): Declared. * share/txr/stdlib/trace.tl (sys:trace-redefine-check): New function. Checks two situations: traced function or method is redefined (neither old nor new is traced any longer), and traced method is overridden (base method continues to be traced, override is not traced). * struct.c (static_slot_ensure): Do a trace check here, taking care of defmeth.
* trace: detect inheritance, change name and warn.Kaz Kylheku2017-03-171-10/+32
| | | | | | | | | | | | When a method is traced that is actually derived from another struct type, we convert the (meth ...) name to refer to that type and issue a warning. * share/txr/stdlib/trace.tl (sys:trace-canonicalize-name): New function. (sys:trace): Canonicalize name, and trace the canonicalized name. Warn if it is different from the original name. (sys:untrace): Likewise for untracing.
* Diagnose undefined functions in trace.Kaz Kylheku2016-11-191-1/+3
| | | | | | | | | * share/txr/stdlib/trace.tl (sys:trace): If symbol-function returns nil, throw exception. * txr.1: Document the behavior, along with return values of trace and untrace, and the tolerance of untrace to bad arguments.
* Bugfix: cannot untrace individual method.Kaz Kylheku2016-11-191-1/+1
| | | | | * share/txr/stdlib/trace.tl (sys:*trace-hash*): Hash must be equal-based to correctly support compound places.
* Adding function tracing support.Kaz Kylheku2016-10-291-0/+50
New variable *trace-output*, and macros trace and untrace. * lisplib.c (trace_set_entries, trace_instantiate): new static functions. (dlt_register): Register new functions to auto-load trace module. * share/txr/stdlib/trace.tl: New file. * txr.1: Documented.