Skip to content

How do you use gdb for debugging? #2356

Answered by VR314
ConstStar asked this question in Q&A
Discussion options

You must be logged in to vote

In your CMakeFiles.txt for your deployment, include the following lines (I included them below the cmake_minimum_required line:

set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")

After building, run gdb ./path/to/executable and it should work.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ConstStar
Comment options

Answer selected by ConstStar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants