Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Cannot debug cmake project
icon9.gif  Cannot debug cmake project [message #1726682] Tue, 15 March 2016 16:57 Go to next message
Andrew Swoncen is currently offline Andrew SwoncenFriend
Messages: 2
Registered: March 2016
Junior Member
Hi,

I've recently switched to eclipse and I would like to debug my code step by step. My project is a cmake projects something like this:

- build/
- bin/
- src/
--- CMakeLists.txt
--- mainProject/
------ CMakeLists.txt
------ function1/
--------- something.h
--------- something.cpp
------ function2/
------ function3/
------ function4/
--- examples/
------ CMakeLists.txt
------ proj1/
--------- CMakeLists.txt
--------- main.cpp
------ proj2/
--------- CMakeLists.txt
--------- main.cpp
------ proj3/
--------- CMakeLists.txt
--------- main.cpp


When I run cmake from the build folder, I use:

cmake -D_ECLIPSE_VERSION=4.5 -DCMAKE_BUILD_TYPE=Debug ../src -G"Eclipse CDT4 - Unix Makefiles"


I've manually downloaded eclipse 4.5.2 and installed it into /opt/eclipse/. Eclipse is found and I start importing it into the IDE, which works. It also detects, that I've configured it as Debug.

In the run configuration, I add the executable in "Main -> Location" and the working directory, which is the "bin" folder. The code executes and the program runs without a problem. However, when I put breakpoints in the code, it won't stop there. I have no Idea, what I'm doing wrong - it should work like this.

I would be glad if someone could help me.

Thanks
Re: Cannot debug cmake project [message #1726732 is a reply to message #1726682] Tue, 15 March 2016 21:55 Go to previous messageGo to next message
Andrew Swoncen is currently offline Andrew SwoncenFriend
Messages: 2
Registered: March 2016
Junior Member
Ok, I just found out, that there is a separate debug configuration. It works now. I still have to find out, how to set the current working directory, but this issue is solved.
Re: Cannot debug cmake project [message #1826510 is a reply to message #1726732] Sun, 26 April 2020 08:47 Go to previous messageGo to next message
Gabi Mising name is currently offline Gabi Mising nameFriend
Messages: 1
Registered: April 2020
Junior Member
please write how do you solved it.

Thanks
Re: Cannot debug cmake project [message #1826596 is a reply to message #1826510] Mon, 27 April 2020 15:00 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
The OP launched the program using the Debug Configuration dialog.
https://help.eclipse.org/2020-03/topic/org.eclipse.cdt.doc.user/reference/cdt_o_run_dbg_pages.htm?cp=10_4_9

There really is no difference between the Run and Launch configurations -- only the dialog changes.

You should familiarize yourself with the C/C++ Development User Guide if you are going to be using Eclipse CDT.
https://help.eclipse.org/2020-03/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Fconcepts%2Fcdt_o_home.htm&cp%3D10


Previous Topic:Error with command: gdb --version Cannot run program "gdb": Unknown reason
Next Topic:2019-12 "Problems ->Description " configuration ??
Goto Forum:
  


Current Time: Tue Mar 19 02:19:26 GMT 2024

Powered by FUDForum. Page generated in 0.03219 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top