Hi,

Robert Bradshaw wrote:
> It would be really useful to have a mode/mechanism to get the  
> position of the code when an error like this occurs. I can think of  
> several ways to do it, but all would significantly impact speed.

Yes, I thought about that, too, a couple of times already. The stack traces
are not very helpful, what you'd need is a dump of the syntax tree nodes
that are along the trace path.

We could do that by catching all exceptions in Main.py, collecting all
objects that belong to method calls in the stack trace, and dumping all
that inherit from Node.

This won't work for compiled code, but exceptions inside the parser are
rare anyway. Most of the compiler crashes I had to deal with so far were in
Nodes or ExprNodes.

Something even simpler could work for transforms, where we control the
traversal in framework code. Here, we could just catch all exceptions in
visit() and dump the current tree path.

Stefan
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to