Reputation: 1
I am trying to debug using Code Blocks but I cannot make it working. I get the following message:
Building to ensure sources are up-to-date
Build succeeded
Selecting target:
femtosim
Adding source dir: /home/dlopez/Simulator/build/
Adding source dir: /home/dlopez/Simulator/
Changing directory to: /home/dlopez/Simulator/build/femtosim
Adding file: /home/dlopez/Simulator/build/femtosim/femtosim
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
(no debugging symbols found)...done.
Debugger name and version: GNU gdb (GDB) 7.1-ubuntu
No symbol table is loaded. Use the "file" command.
Breakpoint 1 ("/home/dlopez/Simulator/femtosim/main.cpp:71) pending.
Program exited with code 01.
Debugger finished with status 0
Build log:
cd /home/dlopez/Simulator/build && /usr/bin/make -f CMakeFiles/Makefile2 femtosim/CMakeFiles/femtosim.dir/rule
make[1]: Entering directory `/home/dlopez/Simulator/build'
/usr/bin/cmake -H/home/dlopez/Simulator -B/home/dlopez/Simulator/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/dlopez/Simulator/build/CMakeFiles 83
/usr/bin/make -f CMakeFiles/Makefile2 femtosim/CMakeFiles/femtosim.dir/all
make[2]: Entering directory `/home/dlopez/Simulator/build'
/usr/bin/make -f femtosim/CMakeFiles/femtosim-lib.dir/build.make femtosim/CMakeFiles/femtosim-lib.dir/depend
make[3]: Entering directory `/home/dlopez/Simulator/build'
cd /home/dlopez/Simulator/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/dlopez/Simulator /home/dlopez/Simulator/femtosim /home/dlopez/Simulator/build /home/dlopez/Simulator/build/femtosim /home/dlopez/Simulator/build/femtosim/CMakeFiles/femtosim-lib.dir/DependInfo.cmake --color=
make[3]: Leaving directory `/home/dlopez/Simulator/build'
/usr/bin/make -f femtosim/CMakeFiles/femtosim-lib.dir/build.make femtosim/CMakeFiles/femtosim-lib.dir/build
make[3]: Entering directory `/home/dlopez/Simulator/build'
make[3]: Nothing to be done for `femtosim/CMakeFiles/femtosim-lib.dir/build'.
make[3]: Leaving directory `/home/dlopez/Simulator/build'
/usr/bin/cmake -E cmake_progress_report /home/dlopez/Simulator/build/CMakeFiles 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
[ 34%] Built target femtosim-lib
/usr/bin/make -f json/CMakeFiles/json.dir/build.make json/CMakeFiles/json.dir/depend
make[3]: Entering directory `/home/dlopez/Simulator/build'
cd /home/dlopez/Simulator/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/dlopez/Simulator /home/dlopez/Simulator/json /home/dlopez/Simulator/build /home/dlopez/Simulator/build/json /home/dlopez/Simulator/build/json/CMakeFiles/json.dir/DependInfo.cmake --color=
make[3]: Leaving directory `/home/dlopez/Simulator/build'
/usr/bin/make -f json/CMakeFiles/json.dir/build.make json/CMakeFiles/json.dir/build
make[3]: Entering directory `/home/dlopez/Simulator/build'
make[3]: Nothing to be done for `json/CMakeFiles/json.dir/build'.
make[3]: Leaving directory `/home/dlopez/Simulator/build'
/usr/bin/cmake -E cmake_progress_report /home/dlopez/Simulator/build/CMakeFiles 75 76 77
[ 38%] Built target json
/usr/bin/make -f lemon/CMakeFiles/lemon.dir/build.make lemon/CMakeFiles/lemon.dir/depend
make[3]: Entering directory `/home/dlopez/Simulator/build'
cd /home/dlopez/Simulator/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/dlopez/Simulator /home/dlopez/Simulator/lemon /home/dlopez/Simulator/build /home/dlopez/Simulator/build/lemon /home/dlopez/Simulator/build/lemon/CMakeFiles/lemon.dir/DependInfo.cmake --color=
make[3]: Leaving directory `/home/dlopez/Simulator/build'
/usr/bin/make -f lemon/CMakeFiles/lemon.dir/build.make lemon/CMakeFiles/lemon.dir/build
make[3]: Entering directory `/home/dlopez/Simulator/build'
make[3]: Nothing to be done for `lemon/CMakeFiles/lemon.dir/build'.
make[3]: Leaving directory `/home/dlopez/Simulator/build'
/usr/bin/cmake -E cmake_progress_report /home/dlopez/Simulator/build/CMakeFiles 78 79 80 81 82 83 84
[ 46%] Built target lemon
/usr/bin/make -f cwind/CMakeFiles/cwind.dir/build.make cwind/CMakeFiles/cwind.dir/depend
make[3]: Entering directory `/home/dlopez/Simulator/build'
cd /home/dlopez/Simulator/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/dlopez/Simulator /home/dlopez/Simulator/cwind /home/dlopez/Simulator/build /home/dlopez/Simulator/build/cwind /home/dlopez/Simulator/build/cwind/CMakeFiles/cwind.dir/DependInfo.cmake --color=
make[3]: Leaving directory `/home/dlopez/Simulator/build'
/usr/bin/make -f cwind/CMakeFiles/cwind.dir/build.make cwind/CMakeFiles/cwind.dir/build
make[3]: Entering directory `/home/dlopez/Simulator/build'
make[3]: Nothing to be done for `cwind/CMakeFiles/cwind.dir/build'.
make[3]: Leaving directory `/home/dlopez/Simulator/build'
/usr/bin/cmake -E cmake_progress_report /home/dlopez/Simulator/build/CMakeFiles 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
[ 98%] Built target cwind
/usr/bin/make -f femtosim/CMakeFiles/femtosim.dir/build.make femtosim/CMakeFiles/femtosim.dir/depend
make[3]: Entering directory `/home/dlopez/Simulator/build'
cd /home/dlopez/Simulator/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/dlopez/Simulator /home/dlopez/Simulator/femtosim /home/dlopez/Simulator/build /home/dlopez/Simulator/build/femtosim /home/dlopez/Simulator/build/femtosim/CMakeFiles/femtosim.dir/DependInfo.cmake --color=
make[3]: Leaving directory `/home/dlopez/Simulator/build'
/usr/bin/make -f femtosim/CMakeFiles/femtosim.dir/build.make femtosim/CMakeFiles/femtosim.dir/build
make[3]: Entering directory `/home/dlopez/Simulator/build'
make[3]: Nothing to be done for `femtosim/CMakeFiles/femtosim.dir/build'.
make[3]: Leaving directory `/home/dlopez/Simulator/build'
/usr/bin/cmake -E cmake_progress_report /home/dlopez/Simulator/build/CMakeFiles 45
[100%] Built target femtosim
make[2]: Leaving directory `/home/dlopez/Simulator/build'
/usr/bin/cmake -E cmake_progress_start /home/dlopez/Simulator/build/CMakeFiles 0
make[1]: Leaving directory `/home/dlopez/Simulator/build'
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings
Note that:
I had used an external cmake to build my project
In the project build options, I am checking Produce debugging symbols [-g].
Is there any other path I need to set
This is my Cmake file:
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
SET(PROJECT_NAME "CWIND-NG")
SET(PROJECT_VERSION_MAJOR "0")
SET(PROJECT_VERSION_MINOR "1")
SET(PROJECT_VERSION_PATCH "0")
SET(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
PROJECT(${PROJECT_NAME})
CONFIGURE_FILE(
${CMAKE_SOURCE_DIR}/doc/Doxyfile.in
${CMAKE_BINARY_DIR}/doc/Doxyfile
@ONLY
)
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
SET(ENABLE_MPI OFF CACHE BOOL "MPI support.")
IF(ENABLE_MPI)
FIND_PACKAGE(MPI REQUIRED)
FIND_PACKAGE(Boost 1.36.0 REQUIRED serialization mpi)
ADD_DEFINITIONS(-DENABLE_MPI)
ENDIF(ENABLE_MPI)
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -ansi")
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
IF(MSVC)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE)
ENDIF(MSVC)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DCWIND_ASSERTS_ENABLED")
SET(ENABLE_CUFDSIM OFF CACHE BOOL "Build CuFDSim as subproject.")
IF(ENABLE_CUFDSIM)
ADD_SUBDIRECTORY(CuFDSim)
ENDIF(ENABLE_CUFDSIM)
ADD_SUBDIRECTORY(json)
ADD_SUBDIRECTORY(lemon)
ADD_SUBDIRECTORY(cwind)
ADD_SUBDIRECTORY(bin)
ADD_SUBDIRECTORY(femtosim)
ADD_SUBDIRECTORY(ltesim)
IF(UNIX)
ADD_CUSTOM_TARGET(html
# COMMAND rm -rf html
COMMAND doxygen Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc)
ELSEIF(WIN32)
ADD_CUSTOM_TARGET(html
# COMMAND if exist html rmdir /s /q html
COMMAND doxygen Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc)
ENDIF(UNIX)
Upvotes: 0
Views: 2122
Reputation: 11
(no debugging symbols found)...done.
This is the main reason for debug failure.
The project is compiled using cmake configuration the -g setting in IDE is no use at all, so lack of debug configuration in CMakeListes.txt caused the missing of debug symbol.
Please refer to this link.
Use debug configuration to regenerate Makefile and the target will contain debug symbols.
Upvotes: 1