Mark Wege wrote:
> I was wondering if anyone knows of a reliable method of obtaining the
> line of code being executed; specifically, I want to see how a proc was
> called from within that proc.
You can examine how tkcon implements hot errors for one.
There is also command tracing, although you are mostly just
able to trace, not runtime alter results. From your later
description, I don't see how you can do what you need
without a debugger. You have changed some architectural
bits, and know that an error will be thrown now, and you
want to modify that behavior ... that requires either
modifying the interpreter (which you can't use) or running
in a debugger environment.
> I'm looking for this because I need to fix an issue in a large
> application (many files in many directories containing over 500,000
> lines of Tcl code) where a change in the underlying architecture has
> required us to periodically refresh the contents of the variable with
> updated information, and I don't want to manually change all of the
> calls to several procedures in all of this code.
The Tcl Dev Kit has a Tcl code Cross-Reference Tool. If
you run it over your codebase, it would indicate all calls
to MyProc (statically analyzed), with line numbers. That
may point to a var, which you could in turn see how that
is used, etc.
--
Jeff Hobbs, The Tcl Guy
http://www.ActiveState.com/, a division of Sophos
Received on Sun Apr 30 02:19:10 2006