1

I casted/extracted a python class inherited from a C++ class that I want to debbug, I am only using gdb to do that task. I tried to add a breakpoint in the python file, but obviously it did not work. Recently I asked this and this to cast/extract a python class inherited from a C++, so I am not calling eval neither exec functions. How can I solve this?

Burutsu
  • 21
  • 2
  • If you own the c++ code, you could add some debug logging. – Benjam May 16 '20 at 08:38
  • There is no way to debug the python code like the c++? Maybe I don't understand your proposition, but it seems not to work on every future python extension. I would like to set a break point on a python file. Any way, thank you for the idea. – Burutsu May 16 '20 at 09:03
  • 1
    If you want to debug extensions you need to run the python interpreter under gdb. See this question: https://stackoverflow.com/questions/7412708/debugging-stepping-through-python-script-using-gdb – darcamo May 16 '20 at 15:49
  • That solution didn't work for me the program I want to debug is not python, it is a program that uses a python extension through pybind. I tried this solution https://gitter.im/pybind/Lobby?at=5ec00264f3ce603074c16817 and it didn't work for me. – Burutsu May 17 '20 at 09:41
  • No cpython function is called by my program so I must use another solution... Any idea? – Burutsu May 17 '20 at 10:44
  • Any reason why you are not using [pdb](https://docs.python.org/3/library/pdb.html) ? – ChrisD May 18 '20 at 10:32

0 Answers0