aboutsummaryrefslogtreecommitdiff
path: root/jim_tcl.txt
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2011-12-02 13:24:38 +1000
committerSteve Bennett <steveb@workware.net.au>2021-01-09 11:06:48 +1000
commitfe37b8dc2536b70d0aba3c6a70ead466ebe5b9d6 (patch)
treef4e3db58f298facf7cf84272d3a3321144c23d32 /jim_tcl.txt
parentb8018299ad54fecfdcffe4b22ac994944a716f2a (diff)
downloadjimtcl-fe37b8dc2536b70d0aba3c6a70ead466ebe5b9d6.zip
jimtcl-fe37b8dc2536b70d0aba3c6a70ead466ebe5b9d6.tar.gz
jimtcl-fe37b8dc2536b70d0aba3c6a70ead466ebe5b9d6.tar.bz2
Add the [xtrace] command
Allows a debugger or tracing facility to be implemented Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim_tcl.txt')
-rw-r--r--jim_tcl.txt25
1 files changed, 24 insertions, 1 deletions
diff --git a/jim_tcl.txt b/jim_tcl.txt
index 24ea60b..6b25338 100644
--- a/jim_tcl.txt
+++ b/jim_tcl.txt
@@ -58,7 +58,8 @@ Changes since 0.80
2. Many commands now accept "safe" integer expressions rather than simple integers:
`loop`, `range`, `incr`, `string repeat`, `lrepeat`, `pack`, `unpack`, `rand`
3. String and list indexes now accept integer expressions (<<_string_and_list_index_specifications,STRING AND LIST INDEX SPECIFICATIONS>>)
-4. `loop` can now omit start value
+4. `loop` can now omit the start value
+5. Add the `xtrace` command for execution trace support
Changes between 0.79 and 0.80
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -4729,6 +4730,28 @@ termination of the `while` command.
The `while` command always returns an empty string.
+xtrace
+~~~~~~
++*xtrace* 'command'+
+
+Install an execution trace callback command. This is useful for implementing a debugger
+or tracing tool. On each command invocation, the given command is invoked as:
+
+----
+ command proc|cmd filename line result command arglist
+----
+
++'proc'+ or +'cmd'+ indicates whether a command or a proc body is being executed.
++'filename'+ and +'line'+ indicate the location where the command was invoked.
++'result'+ is the current interpreter result (from the previous command).
++'command'+ and +'arglist'+ indicate the command being executed.
+
+While the callback is executing, any further execution traces are temporarily disabled.
+If the callback returns +JIM_OK+ or +JIM_RETURN+, the execution trace is reinstalled. Otherwise
+the execution trace is removed.
+
+If +*xtrace*+ is called with an empty argument (""), any existing callback is removed.
+
OPTIONAL-EXTENSIONS
-------------------