Reputation: 2712
I got a quite complex distributed programming framework where there are:
BC
, written in Python as a twisted
plugin, which is running on some machine;BM
, written in Python but wrapping a C++ core as a shared library, in the following way:import imp
handle = imp.load_dynamic('mylib', '../libmy.so')
Then each BM
talks to the BC
via a jsonrpc
interaction, but we don't care about this.
What I would do is to debug, possibly in a step into/step over/step debug fashion but not limited to, a BM
process, which at the front-end appears as a homogeneous stream of characters in a single terminal.
I'm strongly interested into the C++ part, considering the Python code almost final to release and working well.
Due to this language mixture I'm a bit confused about what type of tool may be useful.
Upvotes: 6
Views: 3484
Reputation: 431
You can use gdb on any C/C++ extensions loaded through Python. The way this is done is:
(gdb) target exec python
(gdb) run
>>> import your_extension as ye
>>> ye.do_something ()
>>> # do your python here
>>> # or just run your python script from here
(gdb) do debugging stuff
You can also add breakpoints/do full C/C++ debugging via gdb. Tip from boost::python docs
Upvotes: 4