Debug .so file created with Boost.Python from QtCreator
I have created a Python module using Boost.Python. I want to debug this module using QtCreator. The module is simply a MyModule.so file.
In Python, I will do
import MyModule
a = MyModule.MyObject()
a.do_something()
The do_something method is implemented in C++ and I want to debug it. Does any have a recommendation on how to achieve this?
Re: Debug .so file created with Boost.Python from QtCreator
You need to launch "python" executable in the debugger, then set breakpoint on do_something (e.g. with "rbreak do_something").
rbreak is a gdb command - you can execute gdb commands by enabling Window -> View -> Log, entering the command to the log pane that pops up, and pressing ctrl+enter.
In your case, though, it may just be easier to use cgdb or plain gdb.
EDIT:
- You need to ensure that your module has been loaded before invoking "rbreak". You can do this by letting your program run for a while (without entering the position where do_something is called), then interrupting the debugger (shift+f5, or ctrl+c in cgdb).
- If you just want to track a crash, you don't need to set breakpoints, just do post-mortem analysis of the program. If you don't know how to do this, let us know.