New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix debugger code highlighting while stepping, enable Game Lab breakpoints for project level #19918
Fix debugger code highlighting while stepping, enable Game Lab breakpoints for project level #19918
Conversation
We pulled your branch and have been playing around. Here's some scenarios we came across.
There is a lot of cool functionality here, and there is a lot that works, but my concern is that the last two of these examples might cause more confusion for students than good. |
Yes, I noticed that we never stop on the first line inside Personally, I think if your step will take you out of user code (essentially, out of I'll look at the 3rd issue: (no |
@caleybrock The issue you found is very interesting. It has to do with how we run this code with respect to p5.play's notion of the |
I like the idea of going back to "running" when you step out of user code.
We were kind of enjoying the loop back to the top of draw (), but that's
easy to recreate with a breakpoint, and there are weird cases where the
next user code is a queued callback instead of the draw loop.
…On Jan 10, 2018 4:52 PM, "Chris Pirich" ***@***.***> wrote:
@caleybrock <https://github.com/caleybrock> The issue you found is very
interesting. It has to do with how we run this code with respect to
p5.play's notion of the preload and setup phase. I have an idea of how to
fix this so it will work in the way that you might expect.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#19918 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABinkayiN6Pz40WAK8BMX9cIo3gkljwdks5tJVtigaJpZM4RaDd9>
.
|
PR has been amended to fix @caleybrock 3rd issue discovered. You can now step through global code and see what it is doing. The "setup epilogue" is now broken into two phases. The first phase runs earlier, so the p5.play canvases are visible after we start running the user's code. But we still don't tell p5.play that "setup is really done" until after the global code is complete. Also, new |
@islemaster PR has been amended to cause the debugger to go back into a running state when you exit from a callback or event while stepping (step in/out/over). Verified in gamelab's |
Awesome, I'll pull and try it out in a little bit. |
Gave this a try. I feel really good about the new behavior, with one exception: When I step out of user code and end up back in "running" state, the highlight of the last line I was broken on doesn't clear. @caleybrock @epeach are you okay with going back to "running" when we step out of |
var breakpointsEnabled = false; | ||
// NOTE: We will go back to using !config.level.debuggerDisabled soon, | ||
// but are testing with project levels only for now | ||
var breakpointsEnabled = config.level.isProjectLevel; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why isn't this logic the same as line 283?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just made it match what it previously did (by reverting your PR from 1 year ago). My guess is that there was no need to check hideSource
for enabling breakpoints, since you can't see the UI component needed to enable the breakpoints.
In its current form (without the addition hideSource
check), we match the previous behavior - and we match the current applab behavior / source code.
Adding the additional check certainly wouldn't hurt anything, but it doesn't seem strictly necessary either.
I think this fixes the scenarios I was concerned with, with the exception of the last highlight at the end. |
I'd also like to see tests over this fixed behavior, because in the past we've broken debugger behavior in game lab without noticing right away. This might be a great job for gamelab level tests - if we can set up a small example program, set breakpoints, use the debug commands and verify that we stop on the expected lines, that would be great validation. Maybe Caley or Erin can help with this, they've written game lab level tests recently. |
Here's the PR with Erin's tests: #19677 |
@islemaster the last line of the debugger staying highlighted is another known issue that I had been tracking. What do you think are next steps here? Should we merge and then resolve adding tests? |
I'm okay with tackling tests in a follow-up PR - they may be a good bit of work, especially if we try to detect what's been drawn at each step. I've got mixed feelings about merging before the "last line staying highlighted" gets fixed. On one hand this is mostly working as expected. On the other hand, we disabled this in the first place because it was visually misleading, becoming more confusing than helpful to students. Still having that incorrect visual cue worries me a bit. If we merge this now, any sense of how long it will be before we address it? Any thoughts on Caley's question in GameLab.js? |
I'm fine with test as follow-on PR, and I don't have strong feelings on the last line being highlighted. We could give @poorvasingal a demo tomorrow for her to make a call. |
@islemaster the "last line stays highlighted" impacts Applab as well, where the debugger has always been enabled. Just hit a breakpoint, then press "Continue", and you'll see that the highlighting doesn't go away. Since no one has reported that as a problem there, I don't see it as a deal-breaker here (where it is only being enabled for /p/gamelab for now) |
Awesome. I'm satisfied. Thanks for doing the work to re-enable this! Let's
merge, and follow up with some tests (which I'm happy to help with).
…On Jan 12, 2018 8:55 AM, "Chris Pirich" ***@***.***> wrote:
@islemaster <https://github.com/islemaster> the "last line stays
highlighted" impacts Applab as well, where the debugger has stayed on for
all this time. Just hit a breakpoint, then press "Continue". So, since no
one has reported that as a problem there, I don't see it as a deal-breaker
here (where it is only being enabled for /p/gamelab for now)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#19918 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABinkbJJ_NKl7nPsV6aQgfehTQ7uSEYLks5tJ4t_gaJpZM4RaDd9>
.
|
paused
means that we are stopped or in one of the stepping states). Rather than restore that code exactly, I've setreachedBreak = true
when we complete a step operation (which was already occurring for "step in"). This targeted change avoids a perf issue when you try to "Step Out" from thedraw()
loop in Gamelab - since we can't really step out of that function.