How to get the python sourcecode line, when debuging the Python C sources?
Aahz Maruch
aahz at netcom.com
Tue Sep 7 20:49:22 EDT 1999
In article <7r4alh$7gl$1 at m2.c2.telstra-mm.net.au>,
Mark Hammond <MHammond at skippinet.com.au> wrote:
>Stefan Knappmann <101.139915 at germanynet.de> wrote in message
>>
>>Does anybody know in which C variable I can find the Python Stack?
>>Or how to get the activ Python source code line from within the C
>>debugger?
>
>Move down the stack to eval2() in ceval.c. f->f_lineno will tell you the
>line number. f->f_code->co_filename + 20 bytes is the start of the ASCII
>string containing the filename. Adding something like "(char *)(((char
>*)f->f_code->co_filename))+20)" to the watch window should do the trick.
And people wonder why I think C is a dead language.
--
--- Aahz (@netcom.com)
Androgynous poly kinky vanilla queer het <*> http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6 (if you want to know, do some research)
More information about the Python-list
mailing list