Supporting #line directives
mwh21 at cam.ac.uk
Mon Mar 6 18:20:01 CET 2000
Andrew Csillag <drew.csillag at starmedia.net> writes:
> I don't really want a debugger for it (although it would be neat), I
> just want to make it so that I don't have to do so much work in order to
> render a traceback that shows source lines in the original source file.
> Python's bytecode already has a SET_LINENO instruction, if there were a
> SET_FILENAME instruction, that would handle it nicely (of cource ceval.c
> would probably require a bit of modification, but that's just a "simple
> matter of programming" <0.3 wink>).
> Unfortunately, introspection doesn't help a bit here. With
> introspection I can find out where functions and classes are defined in
> python source, but not in the original (non-python) source.
>>> def f():
... raise "hiya!"
>>> from bytecodehacks import common
>>> import new
Traceback (innermost last):
File "<stdin>", line 1, in ?
File "whatever.c", line 2, in f
Is this helping?
very few people approach me in real life and insist on proving they are
drooling idiots. -- Erik Naggum, comp.lang.lisp
More information about the Python-list