Debugging Embedded Python

nealj mwarden22 at hotmail.com
Fri Jul 12 16:10:00 EDT 2002


Check out Hap www.sourceforge.net/projects/hapdebugger - it is very
close to what you need and I'll be posting an update in the next few
days that will make it even easier to use it to debug embedded python
scripts.

mark.charsley at REMOVE_THIS.radioscape.com (Mark Charsley) wrote in message news:<memo.20020712144413.1996A at a.a>...
> We've got a (win32) C++ program that has an embedded python interpreter 
> that runs a bunch of scripts. We've been asked to enable it's users to run 
> the python scripts under a debugger, allowing the users to put in 
> breakpoints, examine/alter values etc.
> 
> Now the C++ program basically does the following...
> 
> - Initialises some C++ stuff
> - loads in the python DLL
> - initialises some python stuff
> - starts a long complicated bunch of processing that bounces between 
> python and C++
> 
> One way to get the python running under a debugger is to tweak the system 
> so that the C++ executable becomes a C++ DLL that can be loaded as a 
> python extension. Then it's just a case of having a tiny python script 
> that
> 
> - initialises some python stuff
> - loads in the C++ DLL
> - initialises some C++ stuff
> - starts a long complicated bunch of processing that bounces between 
> python and C++
> 
> It's then a simple matter of running the above python script in a python 
> debugger.
> 
> While this would work, it has two irritants
> 1) the work required to change the C++ executable into a python extension 
> DLL
> 2) the python debugger will (presumably) be built to use release-build 
> DLL's. Which means that any build where we can run the whole thing under a 
> python debugger (i.e. a release build) can't easily be run under a C++ 
> debugger and vice versa.
> 
> Are there any win32-compatible python debuggers out there which can
> a) do an "Attach to process" and debug any executable that's using the 
> python DLL
> and/or
> b) have source or pre-built debug builds available?
> 
> Many TIA



More information about the Python-list mailing list