| Store | Cart

Debugging Embedded Python

From: Mark Charsley <mark...@REMOVE_THIS.radioscape.com>
Fri, 12 Jul 2002 14:44 +0100 (BST)
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 

- 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 

While this would work, it has two irritants
1) the work required to change the C++ executable into a python extension 
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
b) have source or pre-built debug builds available?

Many TIA


Mark - personal opinion only, could well be wrong, not representing 
company, don't sue us etc. etc.

Recent Messages in this Thread
Mark Charsley Jul 12, 2002 01:44 pm
nealj Jul 12, 2002 08:10 pm
Chris Liechti Jul 12, 2002 08:49 pm
Anurag Uniyal Jul 16, 2002 07:42 am
Mark Charsley Jul 17, 2002 09:40 am
Messages in this thread