-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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 exploration: Async Callstacks #5552
Comments
The v8 debugger protocol does not provide enough information for doing this. So this will require more code injection. |
Hijacking this issue for the async callstack exploration. Async callstacks show the origin of an asynchronous call. For example, if the debugger pauses in a In F12 and Chrome Devtools, async callstacks can be enabled or disabled with a button next to the callstack. In the inspector protocol, we use UI In Chrome Devtools, async sections are demarcated by a non-clickable label row with a description of the async call. Visual Studio is similar - it shows an extra row that says For VS Code, if we show the async frames and include their info in the existing callstack, it might look like this: But there are some downsides to this, like you can't tell how many different Promise.resolve calls are in that stack. Alternately, we could allow a debug adapter to add a non-clickable frame or even collapsible sections like F12. We either need to
Clicking an async call |
@roblourens great analysis! Following the "Do The Simplest Thing That Could Possibly Work" principle I suggest that we proceed along the lines of @roblourens bullets from above:
|
Sounds good. I would add a launch config option to disable this, since it can always be enabled/disabled in other devtools (I'm not totally sure why people would disable it, maybe they just want to eliminate noise). I was trying to return frames with no source, but was getting errors when I clicked on them. If it's supposed to work, I'll look at it again or file an issue. I'm not sure I want to 'deemphasize' them, since it may be user code. And there may be skipped async frames, and I don't want to eliminate the contrast between async user code and skipped async code. But it needs to be obvious that they're different, so maybe I will. |
Yep, launch config option sounds good to me. Yes, please file a bug for the source-less frames. I only meant to 'deemphasize' the label frames (which are basically "headers"), but not the async frames. In Chrome Devtools the label frames look 'deemphasized' as well (they are grey). |
Someone filed #20622 which is what I was seeing. |
There is nothing to test in this milestone because it was only an exploration. |
Reopening for implementing this in March |
@roblourens I've added an optional |
Implemented |
In chrome and node dev tools you enable async callstacks which means calls like setTimeout are not without parent but it shows where setTimeout was invoked when debugging its callback function. Pretty handy
The text was updated successfully, but these errors were encountered: