Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kdevelop steps and breakpoints not working

I need using steps (Step over, Step over instruction...) and breakpoints.

But the options Step over, Step over instruction and ect. are disabled in menu Run.

And when I put breakpoint into program, program don´t stop on this breakpoint.

I found that I must turn off optimization of compiler and linker. But I don´t know how turn off optimization in Kdevelop 4.4.1.

Where I can find this setting? Or cause of problem with steps and breakpoints is other than compiler optimization?

like image 539
Ondřej Ryška Avatar asked Jun 20 '14 08:06

Ondřej Ryška


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 activate breakpoints?

To set a breakpoint in source code: Click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint. The breakpoint appears as a red dot in the left margin.

How do breakpoints work in GDB?

They work by patching the code you are trying to execute with an instruction that triggers a debug event in some fashion. This is accomplished by injecting a breakpoint instruction or when that is not supported by inserting an instruction that causes a fault that halts the core.

Do breakpoints stop before or after line?

(See section Stack frames, for a description of stack frames.) Set a breakpoint at line linenum in the current source file. The current source file is the last file whose source text was printed. The breakpoint will stop your program just before it executes any of the code on that line.


1 Answers

You need to compile in debug mode. What toolchain do you use for compiling? CMake? If so, set CMAKE_BUILD_TYPE to Debug.

like image 118
milianw Avatar answered Oct 06 '22 12:10

milianw