https://stackoverflow.com/questions/38898459/debugging-python-and-c-exposed-by-boost-together
And it provides a useful approach to deal with this kind of debugging Python and C++ together as follows: http://www.boost.org/doc/libs/1_61_0/libs/python/doc/html/faq/how_do_i_debug_my_python_extensi.html
I use its way to try debugging a little bit and it works well. Here is a simple example using Caffe Python.
$ gdb python
(gdb) target exec python
(gdb) run
>>> import caffe
>>> [C-c] # Ctrl + C
(gdb) break caffe::set_mode_cpu() # Please refer to $(CAFFE_ROOT)/python/caffe/_caffe.cpp
(gdb) cont
>>>
>>> caffe.set_mode_cpu()
Breakpoint 2, 0x00007ffff0e21750 in caffe::set_mode_cpu() ()
from /home/liudanny/git/py-faster-rcnn/caffe-fast-rcnn/python/caffe/_caffe.so
(gdb)
Continuing.
(gdb) ... you can then do debugging stuff ...
No comments:
Post a Comment