Open ivan-mogilko opened 3 months ago
Supposedly we have
function Bar()
{
// there is a breakpoint here
}
function Foo()
{
int a = 2; // debug cursor is here
Bar();
int b = 3;
}
A step over would then step over Bar or in this case that we set a breakpoint inside it would stop at that breakpoint (like if we had hit the "continue" like button)?
It should break at the next found breakpoint along the execution, whether it's user's breakpoint or one added by another command. Yes, it must be consistent with "continue".
In regards to implementation: breaking is currently handled in this function in the engine: https://github.com/adventuregamestudio/ags/blob/de288ad3ec79a8e2726c1617b03837c79c40b126/Engine/debug/debug.cpp#L632-L633
The variables that control behavior are:
breakpoints
- array of breakpoints
break_on_next_script_step
- tells to break at next execution step.
I suppose that these may be amended with more instructions. The question is mostly in which conditions to use for making a break.
Debugger (Editor) currently supports stepping line by line, strictly following script execution; that results in next break occuring inside nested function calls as well. But that's not always convenient in case of complex scripts.
I propose to add 2 more step commands:
I suppose this may be implemented either: