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
--
Mark - personal opinion only, could well be wrong, not representing
company, don't sue us etc. etc.