First make sure that you caffe compile successfully, and makefile.config the Debug:=1 line to uncomment, my Caffe root directory is caffe-master. You can also compile caffe in Eclipse, I'm going to compile the Caffe first and then debug in eclipse
1, Eclipse download URL http://www.eclipse.org/downloads/
Download the Eclipse IDE for C + +. (Note that you can download the C + + version of Eclipse directly in the link without downloading the JRE, etc installation packages)
Download after completion of the download directory: TAR-ZXVF eclipse-cpp-mars-r-linux-gtk-x86_64.tar.gz
Enter the extract directory Eclipse and open the Eclipse software.
2. Import Caffe Makefile Project to eclipse (due to the English version, the following description also in English, provincial translation, convenient for everyone to debug)
(1) File→new→project→c/c++→makefile Project with Existing Code.
(2) Create a new Makefile Project from existing code
ProjectName:
Caffe-master
Existing Code Location
/home/user/caffe-workspace/caffe-master
Language:
Choose c and C + +
Toolchain:
Choose Linux GCC
(3) Then click on Caffe-master in Project Explorer (set Window→open perspective→c/c++).
(4) Now go file→properties→run/debug settings. Click New ..., choose c + + Application
(5) Fill launch configurationproperties
· Arguments:
Fill Train–solver=examples/mnist/lenet_solver.prototxt
and change working directory out of default To/home/user/caffe-workspace/caffe-master (change to your own directory)
(6) Now, can use debug Caffe code:run-> debug:
Note: Debugging techniques in Eclipse you can Baidu, you can open in eclipse in the src file in the layer layer of the original function, in front of each line set breakpoints to debug. Common command F5 into function internal F6 step run (not inside the function) F8 run to the next breakpoint