Hello!
I’m trying to walk through the codebase step by step using gdb. However I’m having some troubles…
I can’t put breakpoints in every line… many times when I put in some line It puts in the last line, where the return of the main function is.
I thinks that this is for some optimization or something when I compile, but I can’t figure it out.
Things I did:
- I compile OpenFHE using
cmake -DCMAKE_BUILD_TYPE=Debug -DWITH_OPENMP=OFF ..
. - I copy the CMakeList.User.txt from there to my project directory.
- I add only one file like the example
add_executable( enc encrypt.cpp )
- In that directory i make
cmake -DCMAKE_BUILD_TYPE=Debug .
(i don’t know it this flags is needed but I try with and without it)
gdb encrypt.cpp
file enc
- Example
b 20
- Output:
Breakpoint 1 at hexa..: filepath/encrypt.cpp, line 28.......
What I’m missing?
PD: Maybe it has no sense but I also try adding this to the CMakeList.txt
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -g -O0")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -g -O0")