- 安装gdb
yum install gdb
- Cmake文件中添加编译标记:-g -rdynamic
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread -lboost_system -g -rdynamic -O0")
- 使用gdb 调试应用,gdb ./build/bin/flycontrol:
使用set args 设置参数:
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