添加后,我使用cmake在github.com/RainerKuemmerle/g2o编译了github.com/RainerKuemmerle/g2o代码库。
set(CMAKE_BUILD_TYPE Debug)
以便能够调试应用程序。然后创建一个名为"g2o“的构建文件。但是当我尝试用gdb进行调试时,这就是我得到的输出。
user2@arm_machine:~/g2o/trunk/bin$ gdb g2o
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 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 "arm-linux-gnueabihf".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /scratch/mbaxkms7/ARM_Programs_mbaxkms7/g2o/trunk/bin/g2o...(no debugging symbols found)...done.
(gdb)
在使用cmake时,还有其他方法生成调试信息吗?
发布于 2014-07-20 09:22:44
添加set(CMAKE_BUILD_TYPE Debug)
的方法很好。
但是g2o
是使用Release
选项构建的程序。Debug
版本的g2o
称为g2o_d
。因此,要进行调试,需要以以下方式启动调试器:
user2@arm_machine:~/g2o/trunk/bin$ gdb g2o_d
Note
不同的名称不是CMake
的常见特性,而仅是g2o
项目的特性
# postfix, based on type
SET(CMAKE_DEBUG_POSTFIX "_d" CACHE STRING "postfix applied to debug build of libraries")
SET(CMAKE_RELEASE_POSTFIX "" CACHE STRING "postfix applied to release build of libraries")
https://stackoverflow.com/questions/24848983
复制相似问题