How do I debug embedded python code?

Martin von Loewis loewis at informatik.hu-berlin.de
Tue Mar 21 14:59:07 EST 2000


Cesar Lopez <clopez at abo.fi> writes:

> I have to call a python module from a C program, and I don´t know how to
> debug this python code.

I guess you don't have much options. Depending on how complex your
Python code is, and depending on what exactly you want to find out, a
C debugger may be your best bet. For example, when the Python code
calls back into C functions, you could set break-points on those C
functions, and see if it gets there. Or, you could single-step through
the Python interpreter and watch it execute byte-code instructions.

It may be possible to have a Python debugger invoked as well from C,
but if you've got a Heisenbug, that may not actually help.

Regards,
Martin




More information about the Python-list mailing list