Forum > Editor

F8 - jump only to my code

(1/4) > >>

In Delphi there was an option, that the step F8 only stopped in the main unit.
Does this option exist in Lazarus?

Is that when you use F8 to step from one paused line to the next line?

Or is that, when you use F8 before you even started the app?

The latter is not supported. (well it works with gdb, but will stop in the lpr / in the main "program MyApp begin ... end;" block).

If you use F8 while you are paused at one line, it should step over to the next line? That would (usually) be a line in the same unit (unless we talk specialized generics).

Well ok, if you are on the last line of a procedure. Then it steps out. That will be to the direct caller.
There is NO option to search for a caller in your code....

Or do you mean "step in" F7?

Here you can simply compile the LCL without debug info => and it wont step into the LCL any more...

If that does not cover your question => more details please.

The idea is: F8 stops only at the user app's code, not in LCL nor in other components.


--- Quote from: AlexTP on August 02, 2022, 08:16:01 pm ---The idea is: F8 stops only at the user app's code, not in LCL nor in other components.

--- End quote ---

For now the only way is to change the settings for all those packages (and change "configure build lazarus" as many packages include those opts).
Of course that also affects what the stack window shows....

The idea of having certain units "prevented" by normal stepping is well known (and accepted as a "would be nice to have"). But it's on a long list, and not near the top.

The trouble I have with understanding this is, that I don't see where F8 is really affected by this?

F7, yes that I can see.

As I described: F8 does not enter another unit (except generics, and technically that is a matter of interpretation).
So as far as I know with F8 that never actually happens?

Maybe someone has an example?

Well, ok, it happens when F8 steps out.
But IF I use F8 on the end of "Form1.DoFormCreated" => then the code goes to the LCL. If F8 is not allowed to step to the LCL, then all it can do is
- open the asm window (and that would be worth)
- reject to step at all. (not much better)
- what else?

And otherwise, well example?

As for generics:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Unit MyCode; type   TFoo = specialize TFPGList<integer>;
TFPGList is in unit fgl.
But for TFoo the compiler creates a copy of the code in MyCode (maybe not all asm may will be copied, but some definitely will be / well copied with adaption for the specialized type)

Now if you are in any method of TFoo, the debugger could just keep showing that you are at the line "TFoo = specialize ..." => but that is crap.
So one can argue that since TFoo is in MyCode it should be stepped => and then the code in fgl would be selected...

Of course (if that feature existed) the implementation does not have to follow that view....

In a similar way, how to avoid F8 from going to assembly part of instructions?


[0] Message Index

[#] Next page

Go to full version