Breakpoints. lazarus / 21-General ---------------------------------------------------------------------- OC DelGuy · 2025-04-07 08:37 No matter what application is open in the IDE, whenever I add a breakpoint, and I click on Step Into (F7), the IDE starts opening all kinds of files in the source editor window: Application.inc, Win32Object.inc, Control.inc, CustomEdit.inc, WinControl.inc I know these are background processes, but I also know there is no problem with them.  The problem is in my code!  And I really wouldn't mind if it stepped into a few lines of code in these files, but it seems to take forever to return to my little bit of code.  I mean, the lines in all the extra files are endless.  I keep clicking and clicking the Step Into button.  Pressing and pressing the F7 to no end! Is there a way to Step Into the next line of MY CODE without having to look at code I really have no business viewing (much less editing)? ---------------------------------------------------------------------- alpine · 2025-04-07 08:56 Quote ...keep clicking and clicking the Step Into button.  Pressing and pressing the F7 to no end!Try pressing the F8 (Step Over) instead. ---------------------------------------------------------------------- OC DelGuy · 2025-04-07 09:26 Quote from: alpine on April 07, 2025, 10:56:02 amTry pressing the F8 (Step Over) instead. Yeah, but doesn't that just skip over what the line of code is supposed to do? ---------------------------------------------------------------------- alpine · 2025-04-07 09:50 Quote from: OC DelGuy on April 07, 2025, 11:26:32 amQuote from: alpine on April 07, 2025, 10:56:02 amTry pressing the F8 (Step Over) instead. Yeah, but doesn't that just skip over what the line of code is supposed to do? No. It just executes it without digging inside. ---------------------------------------------------------------------- Martin_fr · 2025-04-07 16:26 You need to recompile your LCL (and maybe other packages) without debug info. Then it will not step into those. If they have debug info, then the debugger assumes it is there because you want to step into them. Also check if "Configure Build lazarus" has any options for debug info, as they are included by many packages. Same for the RTL, in case you build your own. (Though the units you listed are not RTL). F7 / F8 only differ if there are function calls on the line. (Including hidden function calls, to e.g. range checking, if your RTL has debug info). So if your line is 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   Edit1.Text := s;Then you can just use F8 / step over. (if you don't want to debug inside TEdit) But if your line is So if your line is 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   Edit1.Text := YourFunctionReturningText;And you want to step into YourFunctionReturningText, then you need F7 / Step in. As I said, if the LCL is compiled without debug info, then it will skip the Edit1.SetText. Though in that case F7 will first step into your code, and if you come back you are on the next line already. Yet, if your code is 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   MyProcHandlingTheText( Edit1.Text );then F7 will first step into Edit1.GetText (if it has debug info). In that case use Shift F8 (IIRC) => "Step out", and then immediately F7 Step in. Step out will return INTO the line that called the function. So you are still in front of the call to MyProcHandlingTheText. If you have 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 s:= MyFunc1 + MyFunc2;and you want to step into/through both of them, then do NOT use "F8 step over" on the last line of Func1. If you do, then you return to the caller, but step over the calling line. You can use F7 "Step into" on the last line of MyFunc1, and that should get you directly into MyFunc2. Or you can at some point use Shift-F8 "Step Out" to leave MyFunc1, and then use F7 Step in to enter MyFunc2. Based on FpDebug. GDB/LLDB may differ, I would need to double check. ---------------------------------------------------------------------- H₂SO₄ · 2025-04-08 05:08 One more reason to learn a bit of assembly  In the assembler window you can see exactly which functions you're about to step into, even implicit ones like e.g.  fpc_ansistr_concat  when concatenating strings. You can also mix line stepping and instruction stepping. Say you want to debug a function result being assigned to a writable property: 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 Foo.CustomProperty := Bar(); If you're interested in what  CustomProperty  does under the hood but absolutely do not want to step into  Bar,  line stepping is insufficient -  F7  would step into both and  F8  into neither. So what I ususally do is line step over to the line of interest, then instruction step over to the target  call  instruction of the function I want to examine. Any kind of step into will then take you into that function.