vscode下调试caffe源码
caffe目录:
├── build -> .build_release // make生成目录,生成各种可执行bin文件,直接调用入口;
├── cmake
├── CMakeLists.txt
├── CONTRIBUTING.md
├── CONTRIBUTORS.md
├── data
├── distribute
├── docker
├── docs
├── examples //很多demo可以尝试使用;
├── include
├── INSTALL.md
├── LICENSE
├── Makefile
├── Makefile.config
├── Makefile.config.example
├── matlab
├── models
├── python
├── README.md
├── scripts
├── src // src/caffe/solver.cpp,net.cpp,layer.cpp,blob.cpp等核心函数;
└── tools //主要使用caffe.cpp,进行调用src下面各个子函数;另外tools/extra下提供一些辅助函数
1. 使用gdb直接调试工程
配置参考:Caffe源码调试
主要打开:修改Makefile.config:DEBUG := 1 ;生成如下目录:
lrwxrwxrwx root root 1月 : build -> .build_debug/
drwxr-xr-x root root 1月 : .build_debug/
drwxr-xr-x root root 1月 : .build_release/
使用GDB启动调试,执行gdb --args build/tools/caffe train --solver examples/mnist/lenet_solver.prototxt ;可以直接调试;
rjw@rjw:~/caffe$ gdb --args build/tools/caffe train --solver examples/mnist/lenet_solver.prototxt
GNU gdb (Ubuntu 7.11.-0ubuntu1~16.5) 7.11.
Copyright (C) Free Software Foundation, Inc.
License GPLv3+: GNU GPL version or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from build/tools/caffe...(no debugging symbols found)...done.
(gdb)
(gdb) q
2. 使用Vscode进行调试:
配置c_cpp_properties.json 和launch.json ;
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/tools/caffe",
"args": ["train","--solver","${workspaceFolder}/examples/mnist/lenet_solver.prototxt"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
- 查看函数调用流程;caffe.cpp(main)->solver.cpp->sgd_solverc.pp->data_layer.cpp

vscode下调试caffe源码的更多相关文章
- 比特币学习笔记(二)---在windows下调试比特币源码
根据我一贯的学习经验,学习开源代码的话,单单看是不够的,必须一边看一边调试才能尽快理解,所以我们要想法搭建windows下bitcoin源码的调试环境. 紧接着昨天的进度,想要调试linux下的比特币 ...
- VS2010下调试.NET源码
微软走向开源,是时候用vs去单步调试进入源码了.参考地址:http://blog.csdn.net/waxgourd0/article/details/6600182 可供参考的文章:https:// ...
- caffe源码学习
本文转载自:https://buptldy.github.io/2016/10/09/2016-10-09-Caffe_Code/ Caffe简介 Caffe作为一个优秀的深度学习框架网上已经有很多内 ...
- 使用“Cocos引擎”创建的cpp工程如何在VS中调试Cocos2d-x源码
前段时间Cocos2d-x更新了一个Cocos引擎,这是一个集合源码,IDE,Studio这一家老小的整合包,我们可以使用这个Cocos引擎来创建我们的项目. 在Cocos2d-x被整合到Cocos引 ...
- Android动态方式破解apk进阶篇(IDA调试so源码)
一.前言 今天我们继续来看破解apk的相关知识,在前一篇:Eclipse动态调试smali源码破解apk 我们今天主要来看如何使用IDA来调试Android中的native源码,因为现在一些app,为 ...
- Android动态方式破解apk前奏篇(Eclipse动态调试smail源码)
一.前言 今天我们开始apk破解的另外一种方式:动态代码调试破解,之前其实已经在一篇文章中说到如何破解apk了: Android中使用静态方式破解Apk 主要采用的是静态方式,步骤也很简单,首先使用 ...
- 使用VS2012调试ReactOS源码
目录 一 下载并安装VS2012 二 下载并安装WDK80 三 下载ReactOS0315源码 四 下载并安装RosBE211 五 用RosBE命令行编译ReactOS源码 六 用VS2012编译nt ...
- eclipse调试jdk源码
摘要 介绍使用eclipse调试jdk源码 java是一门开源的程序设计语言,喜欢研究源码的java开发者总会忍不住debug一下jdk源码.虽然官方的jdk自带了源码包src.zip,然而在debu ...
- Android NDK调试C++源码(转)
[原创文章,转载请保留或注明出处,http://download.csdn.net/download/bigmaxim/5474055] 1. 相关软件 adt-bundle-windows-x86. ...
随机推荐
- Vue.js学习笔记之修饰符详解
本篇将简单介绍常用的修饰符. 在上一篇中,介绍了 v-model 和 v-on 简单用法.除了常规用法,这些指令也支持特殊方式绑定方法,以修饰符的方式实现.通常都是在指令后面用小数点“.”连接修饰符名 ...
- cf343c 二分答案+模拟
/* 怎么判断能否在时间k内完成扫描 贪心:每次取出最靠左边的磁头去扫描最左边的,然后再往右扫描即可 如果当前点无法扫到最左侧点,那么后继点一样无法扫到 */ #include<bits/std ...
- 步步为营-64-进程&线程
1 进程 using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; us ...
- HttpClient + Testng实现接口测试
HttpClient教程 : https://www.yeetrack.com/?p=779 一,所需要的环境: 1,testng .httpclient和相关的依赖包 二.使用HttpClient登 ...
- Ext.js入门:Window对象与FormPanel(六)
一:Ext.Window类 二:Ext.Window类实例 三:Ext.FormPanel类 四:Ext.FormPanel类实例 1.类Ext.Window 包: Ext 定义的文件 Windo ...
- SSL证书的类型区别和配置教程
证书类型 参考: https://cloud.tencent.com/product/ssl 我们能申请到的免费证书就是DV SSL,个人站长不二之选.免费证书从哪申请,我就介绍几个,具体申请步骤百 ...
- Mysql linux -N命令
一.-e 和 -N /usr/local/bin/mysql -h127.0.0.1 -uroot -pxxxx -N -e "use abc; show tables;" -e ...
- P1219 八皇后 含优化 1/5
题目描述 检查一个如下的6 x 6的跳棋棋盘,有六个棋子被放置在棋盘上,使得每行.每列有且只有一个,每条对角线(包括两条主对角线的所有平行线)上至多有一个棋子. 上面的布局可以用序列2 4 6 1 3 ...
- 【Java】 剑指offer(4) 替换空格
本文参考自<剑指offer>一书,代码采用Java语言. 更多:<剑指Offer>Java实现合集 题目 请实现一个函数,把字符串中的每个空格替换成"%20&quo ...
- 044 HIVE中的几种排序
1.order by:全局排序 select * from emp order by sal; 对于一个reduce才有用. 2.sort by:对于每个reduce进行排序 set mapreduc ...