Skip to content
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

Debug JavaScript with Safari stuck when press Continue or Step over #946

Closed
loongliu opened this issue Nov 9, 2021 · 6 comments
Closed
Assignees
Milestone

Comments

@loongliu
Copy link

loongliu commented Nov 9, 2021

Describe the bug
I tried to debug javascript with safari for iOS target and macOS target.
The Safari connected to the JSC successfully.
I can see the console, view the source code, put a breakpoint,
and the JSC stoped at the breakpoint.

But when I click Continue or Step over, the gui just stuck and nothing happened.
Tried debug for iOS target and macOS target, all the same situation.

To Reproduce
Steps to reproduce the behavior:

  1. Build and run iOS target for default experience.js
  2. Open safari and debug for the iOS target.
  3. Put a breakpoint in babylon.max.js or experience.js.
  4. the breakpoint worked, and the JSC stoped.
  5. But Continue or Step over does not has any effect.

Expected behavior
Continue or Step over should work.

Screenshots
image

Other

  • macOS 11.5.2
  • XCode 13.0 (13A233)
  • Safari 15.0 (16612.1.29.41.4, 16612)
  • iOS 13.8
@darraghjburke
Copy link
Contributor

darraghjburke commented Nov 9, 2021

Hi, thanks for the reporting this issue. I was able to repro it. I'll do some investigation and see if I can find a solution. Hopefully it's not a Safari bug :)

@darraghjburke
Copy link
Contributor

I tested on another version of Safari but it was still broken. Do you happen to know if there's a version of Safari/MacOS/BabylonNative where this did work?

We think it may have worked at one point, but we're not sure.

@bghgary bghgary assigned bghgary and unassigned darraghjburke Apr 21, 2022
@bghgary bghgary added help wanted Extra attention is needed rendering and removed help wanted Extra attention is needed labels May 16, 2022
@bghgary
Copy link
Contributor

bghgary commented May 17, 2022

I investigated this a tiny bit. It looks like calling engine.runRenderLoop somehow interferes with the JSC debugger. Just commenting out this section makes the JSC debugger work fine.

    //engine.runRenderLoop(function () {
    //    scene.render();
    //});

I also tried just running the render loop with nothing in it, but this also breaks the JSC debugger.

    engine.runRenderLoop(function () {
    //    scene.render();
    });

@thomlucc thomlucc added the 6.0 label Sep 23, 2022
@thomlucc thomlucc added this to the 6.0 milestone Sep 23, 2022
@thomlucc thomlucc removed the 6.0 label Sep 23, 2022
@bghgary bghgary modified the milestones: 6.0, Future Jan 26, 2023
@bghgary bghgary modified the milestones: Future, 7.0 May 11, 2023
@thomlucc thomlucc modified the milestones: 7.0, 8.0 Mar 26, 2024
@bghgary
Copy link
Contributor

bghgary commented Sep 9, 2024

The reason why this doesn't work is because the main thread is blocked and can't receive messages from the debugger. We need to rework the way rendering work to fix this. See #1416. Closing as fixing the other issue should fix this.

@bghgary bghgary closed this as completed Sep 9, 2024
@AJTech2002
Copy link

The reason why this doesn't work is because the main thread is blocked and can't receive messages from the debugger. We need to rework the way rendering work to fix this. See #946. Closing as fixing the other issue should fix this.

Hey @bghgary this makes sense, this is still an issue and makes debugging very difficult - you've linked back to the same thread, is there another issue that's tracking this and are there any temporary work arounds in the meantime?

Thanks :)

@bghgary
Copy link
Contributor

bghgary commented Jan 23, 2025

Oops, I fixed the link. It should be #1416. Unfortunately, I don't know of a workaround. I know this is annoying. The fix is unfortunately a bigger change to how rendering works and will take some time before we can get to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants