Pecularities - why? or why not? lazarus / 9-Editor ---------------------------------------------------------------------- Birger52 · 2020-07-23 17:51 When debugging, I often find that the "step over" function, does not step over, but steps into code - my own, LCL or even assembler. Likewise "step into" often actually steps over - sometimes just a few lines, other times, entire procedures or functions. Marking/HiLite one or more lines by clicking with the mouse in the gutter, the line(s) can be copied to the clipboard or deleted - but it can not be dragged using the mouse. Marking one or more lines, by moving the mouse in the text with the left button down, the text can be moved or copied - but it can not be copied next to itself. Moving a marked/HiLited text, removes the HiLiting. So if you need to f.ex. copy the same text to more than one place, you have to either mark it several times or is forced to use keyboard - and thus denied the use of the clipboard for other texts. Other tools keeps a HiLited copied or moved text HiLited at the new location. Just wondering ---------------------------------------------------------------------- Martin_fr · 2020-07-23 19:28 Quote from: Birger52 on July 23, 2020, 07:51:19 pmWhen debugging, I often find that the "step over" function, does not step over, but steps into code - my own, LCL or even assembler. That is a known problem with the gdb based debugger. Though it is not known if the fault is with gdb or otherwise. Under menu: Tools > Options > Debugger   (for Lazarus Trunk: > Backend) you will find (in the property grid) the option "FixIncorrectStepOver", which if set to true should remedy the issue. QuoteLikewise "step into" often actually steps over - sometimes just a few lines, other times, entire procedures or functions. That I have not yet encountered.... Mind though that FPC does not generate debug info for inlined code. So any inlined function will always step over (but should go no further than the next line). IIRC even with -O- any function marked with the "inline" modifier will be inlined. You can start the unit with "{$inline off}". Likewise, smart-linking -XX can cause issues (at least it used to do that...). ("Smart linkable -CX" can be set) https://wiki.lazarus.freepascal.org/Debugger_Setup Check if the code that gets skipped has blue dots. Also make sure the compiler did not identify it as "dead code" (i.e. inside a condition that can never be true). For all else: - OS? -32/64 bit? - GDB version?  - Log: https://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Log_info_ for_debug_session   For the LOG: right after the stepping went wrong, add a new watch "STEPERROR" or the like. This will appear in the log, marking the location.   Also note down which line you started and ended. And keep a copy of the source (to be not modified), in case that should be needed (likely not). Mind that the ability to fix gdb issues is limited, and this may be as good as it gets. As an alternative try FpDebug. https://wiki.lazarus.freepascal.org/LazDebuggerFp QuoteMarking/HiLite one or more lines by clicking with the mouse in the gutter, the line(s) can be copied to the clipboard or deleted - but it can not be dragged using the mouse. Please report on the bugtracker QuoteMarking one or more lines, by moving the mouse in the text with the left button down, the text can be moved or copied - but it can not be copied next to itself. Add that to the same bug-report. QuoteMoving a marked/HiLited text, removes the HiLiting. So if you need to f.ex. copy the same text to more than one place, you have to either mark it several times or is forced to use keyboard - and thus denied the use of the clipboard for other texts. Other tools keeps a HiLited copied or moved text HiLited at the new location. Add a feature request. I.e. open a second/separate issue for this on the bug tracker. Note that the next major release (that will be Lazarus 2.2) will have keyboard shortcuts for (without using the clipboard): - duplicate/move entire lines.  (either current line, or the lines that are (partly) selected) - duplicate/move any selection (does not need to be a full line) QuoteJust wondering  As for the "why" / regarding drag/drop/selection: No-one had either though about it, or people who did have not voiced there thoughts. ---------------------------------------------------------------------- Martin_fr · 2020-07-23 19:36 Also - about stepping: Certain blocks can have peculiar execution order.  Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Func(OtherFunct,OtherFunct_2,OtherFunct_3)Will enter the first line, then the last, then maybe the first, then the 2nd last, then go to "func" begin/end  (and maybe others) can jump several times between the begin and end line. This is caused by FPC internal code generation. ---------------------------------------------------------------------- Birger52 · 2020-07-24 10:08 Thx for explanations and fixes