Error on stepping-state after end of a function

Features wanted...
Post Reply
PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Error on stepping-state after end of a function

Post by PeterH »

1) If, while stepping = on, a function is called, it starts *without* stepping. I think this is fine.

2) If, in the function:
- there is a step;
- (maybe after come Continue) you click "Continue without stepping"
- and somewhen return to the caller
=> it continues *without* stepping!

For me this is absolutely wrong!
If stepping mode is on *before* call to a function, it always must be on *after* return from it! No matter what happens inside the function!

Example:

Code: Select all

//	Test step; outside/inside a function

"Main : steptest"
   $a = 1;
   step;   // start stepping for "Main"
   $b = 2;
   f();
   $c = 3;   // stepping should be on here!
   echo "behind f()";
   step;

function f()   {
   $x = 9;
   step;
   $y = 8;	// after this: click "Continue without steping"
   $z = 9;
}
Win11 Pro 223H2 Gerrman

admin
Site Admin
Posts: 60637
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Error on stepping-state after end of a function

Post by admin »

Well, currently the stepping mode is totally scope unaware. That's not a bug but the way it is for many years.

I move this thread to Wishes.

PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Re: Error on stepping-state after end of a function

Post by PeterH »

admin wrote: 13 May 2023 08:31 Well, currently the stepping mode is totally scope unaware.
Though if calling a function with stepping=on, the function runs *without* stepping.
And if I got it right: after return from the non-stepping function the prev mode will continue.
So it seems not just be all or nothing...

Now, if a function call is reached with stepping=on (thats dynamic), there must be a step; behind the call (that's static) :(

OK: if my wish for a variable to querry stepping state would exist, it could be "dynamically" handled :D
Win11 Pro 223H2 Gerrman

admin
Site Admin
Posts: 60637
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Error on stepping-state after end of a function

Post by admin »

Yes, you are right, it's indeed not totally scope-unaware.

I added that stepping state query.

PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Re: Error on stepping-state after end of a function

Post by PeterH »

As said in the other thread: thanks a lot!
(And more :beer: - though it should be red wine)
Win11 Pro 223H2 Gerrman

PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Re: Error on stepping-state after end of a function

Post by PeterH »

Code: Select all

   ...
   $cstep = <get stepping>;
   $dings = f($cmd1, ...);
   if $cstep { step; }
   ...
Doesn't it look strange? :roll:
But at least: it helps to make things work as they should! :ugeek:
(Without it I sometimes had a 'runaway'! :blackstorm: )
Win11 Pro 223H2 Gerrman

Post Reply