If you press the "Step" button on the commander, then a dialog box appears that shows every Logo instruction and asks you to confirm or cancel its execution (single step).
FMSLogo can run Logo instructions in the background. For example, timer events that are scheduled with SETTIMER continue to run without anyone typing in a new instruction. Logo instructions may also be run in response to keyboard/mouse input (KEYBOARDON and MOUSEON). These "background instructions" will also pop up the "Single Step" dialog box. If these come frequently, such as a SETTIMER that runs every 10 milliseconds, they can appear very quickly and flood the screen before the user can cancel them.
This was reported by Manfred Zindel. He reported that he had to use the Task Manager to terminate FMSLogo.
Certainly you shouldn't lose control of FMSLogo by pressing the "Step" button. I'm not sure if, when the first "Single Step" window appears, FMSLogo should stop processing all Logo instructions that are scheduled in response to windows events (SETTIMER, KEYBOARDON, MOUSEON, etc.) or if those should run as normal but simply not show a second "Single Step" window if one is already shown. I was thinking that it would be nice to combine the "Pause" and "Single Step" dialog boxes for the purpose of debugging so that you could run instructions while single stepping, so I don't think it should prevent all logo instructions from running.
How Reproducible:
Every Time
Steps to Reproduce:
1) Run a non-primitive procedure from the context of a timer event, like
SETTIMER 17 100 [IGNORE XCOR]
2) Press the "Step" button on the commander
What Happens:
Dialog boxes with the title "Single Step" will start to appear cascade down your screen. See attached screenshot.
Expected Result:
Only one "Single Step" window appears at a time.
You have put the bug reported by me in a more general context and so made it easier to reproduce and to handle. Many thanks!
Diff:
I have committed [r5762] to fix the problem. It will be available in FMSLogo 8.2.0.
I have attached a pre-release version of FMSLogo 8.2.0 which has this fix so that people can benefit from the fix before FMSLogo 8.2.0 is released.
I fixed this by disallowing two "Single Step" dialog boxes to visible at the same time.
Callback instructions lists still run when single stepping. I thought that if I stopped callbacks from running, then single stepping would interfere too much with a running program and it would also require queueing all of the events to be run later, potentially running out of memory and causing a flood of behavior when the "Single Step" dialog was dismissed.
My fix is not ideal. Programming environments for other languages have debuggers that allow single stepping each thread independently. This is currently not an option for FMSLogo, since all execution happens on the same thread, with callbacks interrupting whatever was running previously. This makes it impossible to single step a procedure that was interrupted without running the interrupting event to completion.
Related
Commit: [r5762]
Hello from Paderborn, Germany,
after weeks of high project stress we are back and will be able in approximately one week to return to our logo curriculum project, in which David has helped us a lot so far. For today I just want to share some new experiences we made meanwhile.
In our highly professional project of continuous development in the background of supporting competence analysis, there was a central component, a growing program system with thousands of lines and a lot of data storage and retrieval. We wrote, maintained and expanded this very demanding component of the project entirely in FMSLogo.
Against all requests to switch to a mainstream programming language, we stayed with FMSLogo, regardless of our own fear of not being able to cope with the growing complexity and size of the program and thus causing difficulties or loss of time for the whole project. Last week we achieved the completion of another stage and it was fully successful, and in the end our really big and complicated program worked perfectly and free of errors.
Since the preliminary completion of "Little Helper" in the aftermath of version 5, we have risked doing without an external editor altogether and using the very good FMSLogo editor under the control of Little Helper so versatile that we always could keep track of things and progressed surprisingly quickly coping with a mountain of work to do.
It should be noted that "Little Helper" is still written in FMSLogo and must be introduced with the help of the LogoLib. Nevertheless, it works surprisingly quickly and easily and as a very good team player for the other FMSLogo IDE components. And since getting the preview of 8.20 there is nothing more that requires a workaround.
I just want to briefly outline that we have introduced some other enhancements to the use of FMSLogo. They refer to the clearer organization of global variables and their networking with the help of a comment convention for global variables which allows all global variables to work together as state variables, and a dot naming convention for the procedures, which allows procedures that belong together to be kept together in the alphabetical list. Our solutions are very preliminary and can be expanded, but they are already helping decisively to let the complexity only grow linearly with the program length and not quadratic or even exponential.
If the success continues, there is more work to be done to make FMSLogo a still more powerful development tool for serious offline projects. Even now, despite all its limitations, the language is astonishingly versatile and, above all, very reliable. And together with Little Helper, the built-in editor with its well-chosen colors is a great help for the developer.
We've introduced more new features that deal with formatting and with loading and saving files, but I'll report about that later. Just one thing in advance: Instead of "Store All Procedures" we now prefer "Store Package".
We hope that at some point it will be possible to insert Little Helper or an extension of it as a genuine part of the FMSLogo-IDE itself.
So much for today. We will all be under great time pressure still here for about a week and then hopefully turn back to the curriculum project with FMS logo. So is our plan.