Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

KDevelop can't debug in ubuntu?

Tags:

c

ubuntu

kdevelop

i am a new to KDevelop. I am using ubuntu to develop C.

My problems as follows: I have already trigger breakpoint in KDevelop. After I click F9. The KDevelop just show "*****Exit normally******". I am not quite sure what the problem it is?

Looks Like I can't debug.

And I can't see the print. enter image description here

like image 434
fhlkm Avatar asked Oct 07 '14 21:10

fhlkm


People also ask

How do I debug Kdevelop?

Once you have a launch configured (see Running programs), you can also run it in a debugger: Select the menu item Run → Debug Launch, or hit Alt+F9. If you are familiar with gdb, the effect is the same as starting gdb with the executable specified in the launch configuration and then saying Run .

How do I debug a program in Ubuntu?

You can use GDB to debug programs written in C, C@t{++}, Fortran and Modula-2. GDB is invoked with the shell command "gdb". Once started, it reads commands from the terminal until you tell it to exit with the GDB command "quit".

Can you debug using Vim?

Vimspector is a powerful graphical debugger plugin for Vim. However, it also will take you a while to get started.


2 Answers

Check the CMakeLists.txt. In my case, even in Project-> Open Configuration... I make CMAKE_BUILD_TYPE as Debug, but in CMakeLists.txt is Release, the build still uses Release mode. Hopefully it is helpful.

like image 97
willSapgreen Avatar answered Sep 18 '22 16:09

willSapgreen


Go to Run -> Configure Launches, [Add New...] -> Compiled Binary, select Debug on the left side, Debugger executable: and select /usr/bin/gdb.

Hope it helps.

like image 42
dom0 Avatar answered Sep 21 '22 16:09

dom0