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?
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 .
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.
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.
(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.
You need to compile in debug mode. What toolchain do you use for compiling? CMake? If so, set CMAKE_BUILD_TYPE to Debug.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With