Serkan Göktaş
Serkan Göktaş

Reputation: 73

Boost Python - debugging python code embedded in C++

I am using boost::python to embed python interpreter to my executable. I call python functions from C++ side. However, I cannot debug python side of the code. It seems that this is not a popular issue but I really need to debug the python code called from C++. It seems that visual studio has a support for this but I am using ubuntu. Is there a way that I can achieve debugging python code called from C++. I can use another library if boost::python does not support that.

Upvotes: 1

Views: 291

Answers (1)

unddoch
unddoch

Reputation: 6014

Python has a native debugger called pdb. Use the lines:

import pdb
pdb.set_trace()

to start an interactive debugging session at any point in your python code.

Upvotes: 1

Related Questions