question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Heads-up: `Debugger#restartFrame` now working again

See original GitHub issue

We recently re-implemented the Debugger#restartFrame CDP method that allows restarting of functions while paused (CL).

This is just a heads-up in case folks are interested in bringing this feature also to JS debugging in VS Code.

The new semantics are a bit different though, in that V8 won’t always allow functions to be restarted. We communicate this info in the Debugger.paused event where each call frame now has a canBeRestarted flag. This info is accurate as long as the user doesn’t mess with stack between pausing and requesting a frame restart. Calling the restartFrame CDP method also continues execution immediately, but will pause automatically at the beginning of the restarted function.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
szuendcommented, Jul 18, 2022

Let’s say you have a function foo and a function myCallback in your script and foo calls some Web/Node API:

function foo() {
  //...
  someNodeAPI(function myCallback() {
    debugger;
  });

When stopped in myCallback you won’t be able to restart foo (assuming its still on the stack).

As a side note, this is different to e.g. async/generator functions, which can’t be restarted for other reasons.

1reaction
szuendcommented, Jul 18, 2022

It’s a bit technical: Essentially we can’t restart across C++ frames (because destructors need to run when dropping C++ frames), which means restarting across Web APIs or Node APIs is now prohibited.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Heads Up! (@HeadsUp) / Twitter
“Heads Up!” has arrived for Zoom! You can now play your favorite game with your favorite people without being in the same room....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found