Bug 144496 - C++ CMake hello world project cannot be debugged
Summary: C++ CMake hello world project cannot be debugged
Status: RESOLVED NOT A BUG
Alias: None
Product: kdevelop
Classification: Applications
Component: Application templates (show other bugs)
Version: 0.1
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-21 17:40 UTC by yzhh
Modified: 2009-01-22 23:59 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yzhh 2007-04-21 17:40:23 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    Debian testing/unstable Packages
OS:                Linux

Create a C++ CMake "hello world" project using the "New Project" Wizard. Then try to debug it. This happens:

1. When I hit F9 (or select menu item "Debug->Start"), the program simply runs to end, no matter how many and where I put break points (they are always grey, indicating not successfully added to the debugged program).

2. When trying to debug the compiled hello world program directly using gdb (ie. outside of kdevelop), setting a break point at main("break main"), run it("run"), the break point is hit but try "next" or "step" after this, gdb shows "Single stepping until exit from function main,which has no line number information." and stops in __libc_start_main ().

Finally I found out that I must manually modify CMakeLists.txt in the project folder, changing 
ADD_DEFINITIONS(-Wall -O2)
into 
ADD_DEFINITIONS(-Wall -g -O0)
to enable normal debug.

I think there should be some "Enable debug" option in the "project options" Dialog, or a "debug " target made avaiable in the "build targets" menu, or anything that do not require manual modification of CMakeLists.txt just to bring up debugging.
Comment 1 Andreas Pakulat 2007-04-22 02:52:52 UTC
We don't support CMake as buildsystem, so you're on your own with that. Note: What you really want is setting CMAKE_BUILD_TYPE to debug.