[Swift-devel] changes in trunk (tracing and usability)
Mihael Hategan
hategan at mcs.anl.gov
Fri Nov 9 23:54:45 CST 2012
Hello,
I added a few things in trunk meant to make it easier to debug issues
with scripts.
The major one is tracing. It's disabled by default, but can be enabled
with -tracing.enabled on the command line (or with the tracing.enabled
property).
What it does is it traces app calls, compound calls, assignments, etc.
It does it with line numbers, threads, and run-time information where
available (such as the exact values of the k, v pair for an iteration,
the exact arguments to a function or app, etc.).
Not all things are traced yet, but I wanted to see if it's useful before
putting too much effort into it.
The minor ones are:
- stack traces for errors. When swift fails, it prints a swift stack
trace instead of just the error message with no location information.
This is in non-lazy error mode, and lazy errors might need more work.
- the "invalid path" errors are gone. You now get "Array index <value>
not found for <array> of <size>" or "Invalid field name <name> for
<struct_variable> of type <type>". These types of errors should be
caught at compile-time, but there are still places where the static
system can be bypassed.
- there was a race condition in the creation of array elements of struct
type which would sometimes produce the "Invalid path
<valid_struct_field> for <variable>". It's fixed now.
Mihael
More information about the Swift-devel
mailing list