Sorry for necroposting, but can we please get one menu item for both debugger backends (in the sake of general sanity)
I'm sure there's a mighty hero somewhere who can add an if/then clause in the right place of the source code?
"both debugger backends"
There are 3 main variants: FpDebug, Gdb, Lldb - and then variants thereof....
https://wiki.freepascal.org/Debugger_Status#Available_Debuggers
"get one menu item"
There are 2 different commands. They perform a different action.
(And iirc FpDebug and GDB support both commands.)
"Run to cursor"
"Step over to cursor"
"Run to cursor" => Works like
- breakpoint at cursor
- run(F9)
"Step over to cursor" => Works like
- While
- not AtCursor()
- or
- HasSteppedOut
- do Step Over(F8)
"Step over to cursor" means you must be able to reach the location at cursor, without leaving the current function.
(But you will not stop at it, inside a recursive call)
"Run to cursor" will stop inside a recursive call
And this is why both commands are important.
- If I am in a function, that has recursion, I may need "Step over to cursor".
- But if I want to run to just any location then I need "Run to cursor"
If you want to start the debugger, and stop at some location, then you need "Run to cursor" - because you aren't inside a function (as the app is not yet running), and so "Step over to cursor" can not work.
----
All this is independent of the Debugger Backend.
As indicated, some backends support both commands.
At the time this thread was created, it may have been the case that any backend supported only one (or none) of those 2 commands. But that is no longer the case.