Overview
| Artifact ID: | 417b2e7afc92428ee7fcac4bbf3d63c22a269c31 |
|---|---|
| Ticket: | 403430ffffffffffffffffffffffffffffffffff
Tcl_CreateTrace() callback - a proposed 'enhancement' |
| User & Date: | daknol on 2001-01-26 00:18:44 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
this is a patch for which i didn't see any related PR, so i'm not entirely certain if this patch will be a popular one or not... as mentioned in patch#103420, my company's tools typically register a callback with Tcl_CreateTrace() so that we can automatically generate a command "history log" or "replay script" of a tool's usage. one of the problems we've had with the tcl trace involves the 'level' argument that gets passed to our trace callback function. specifically, bracketed commands whose results are passed as arguments to another command is the issue. consider two tcl commands, 'a' and 'b', where the results of 'b' are commonly passed as an argument to 'a'. ie, "a [ b ]". with today's implementation, a tcl trace callback will be invoked twice, once with the 'command' argument equal to "b", and then again with 'command' equal to "a [ b ]". the 'level' argument in both invocations is the *same* value, which presents a problem for me. if the 'level' provided in the first invocation was 'X', i would expect the second invocation to be 'X-1'. otherwise, i have no way of telling that the first invocation is merely being evaluated as another command's argument. since the bracketed command cannot be distinguished from a regular command, our resulting command log is faulty in that it will first print 'b' and then print 'a [ b ]'. the fix for this involves wrapping an increment/decrement of iPtr->numLevels before/after a call to a bracketed command. i'm not convinced the patch i've provided below is the absolute cleanest or best way to achieve our goal, but it seems to work just fine for us. it'd be nice to see this patch encorporated into a future release of tcl, but i also realize there may be some argument to the contrary that i haven't seen yet...
- foundin changed to: "None"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "daknol"
- subsystem changed to: ""
- title changed to:
Tcl_CreateTrace() callback - a proposed 'enhancement'
- type changed to: "Patch"