• Benedikt Meurer's avatar
    [inspector] Align async task frame reporting for `await`. · d6c01059
    Benedikt Meurer authored
    The V8 Inspector was sending an additional frame as part of async stack
    traces for async functions, which pointed to the first executed `await`
    in the async function. This is leaking an implementation detail of how
    (and more precisely when) the inspector decides to collect this stack
    trace. From the users perspective the async part of the stack trace is
    supposed to capture what happened _prior to the task_ - meaning in case
    of async functions: What lead to the execution of the async function.
    This is reflected by the fact that the DevTools front-end (and the V8
    Inspector itself) performs post-processing on these async call stacks,
    removing the misleading top frame from it. But this post-processing is
    not applied consistently to all async stack traces (i.e. the Console
    message stack traces don't get this), and potentially also not applied
    consistently across consumers of the Chromium debugger backend.
    
    Instead the V8 Inspector now removes the top frame itself and thus
    reports `await` consistently with how other async tasks are reported to
    debugger front-ends.
    
    Note: This preserves backwards compatibility with old versions of
    devtools-frontend, which do post-processing (for the Call Stack) only on
    async stack traces marked with "async function", while we now mark these
    async stack traces with "await" instead (aligned with what the front-end
    is using as user visibile string anyways in the Call Stack section, and
    this matching will be updated in a separate follow up CL to look for
    "await" instead of "async function").
    
    Before: https://imgur.com/kIrWcIc.png
    After: https://imgur.com/HvZGqiP
    Fixed: chromium:1254259
    Bug: chromium:1229662
    Change-Id: I57ce051a28892177b6b96221f083ae957f967e52
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3193535
    Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
    Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
    Reviewed-by: 's avatarKim-Anh Tran <kimanh@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#77157}
    d6c01059
Name
Last commit
Last update
..
BUILD.gn Loading commit data...
DEPS Loading commit data...
DIR_METADATA Loading commit data...
OWNERS Loading commit data...
custom-preview.cc Loading commit data...
custom-preview.h Loading commit data...
injected-script.cc Loading commit data...
injected-script.h Loading commit data...
inspected-context.cc Loading commit data...
inspected-context.h Loading commit data...
inspector_protocol_config.json Loading commit data...
remote-object-id.cc Loading commit data...
remote-object-id.h Loading commit data...
search-util.cc Loading commit data...
search-util.h Loading commit data...
string-16.cc Loading commit data...
string-16.h Loading commit data...
string-util.cc Loading commit data...
string-util.h Loading commit data...
test-interface.cc Loading commit data...
test-interface.h Loading commit data...
v8-console-agent-impl.cc Loading commit data...
v8-console-agent-impl.h Loading commit data...
v8-console-message.cc Loading commit data...
v8-console-message.h Loading commit data...
v8-console.cc Loading commit data...
v8-console.h Loading commit data...
v8-debugger-agent-impl.cc Loading commit data...
v8-debugger-agent-impl.h Loading commit data...
v8-debugger-id.cc Loading commit data...
v8-debugger-id.h Loading commit data...
v8-debugger-script.cc Loading commit data...
v8-debugger-script.h Loading commit data...
v8-debugger.cc Loading commit data...
v8-debugger.h Loading commit data...
v8-heap-profiler-agent-impl.cc Loading commit data...
v8-heap-profiler-agent-impl.h Loading commit data...
v8-inspector-impl.cc Loading commit data...
v8-inspector-impl.h Loading commit data...
v8-inspector-session-impl.cc Loading commit data...
v8-inspector-session-impl.h Loading commit data...
v8-profiler-agent-impl.cc Loading commit data...
v8-profiler-agent-impl.h Loading commit data...
v8-regex.cc Loading commit data...
v8-regex.h Loading commit data...
v8-runtime-agent-impl.cc Loading commit data...
v8-runtime-agent-impl.h Loading commit data...
v8-schema-agent-impl.cc Loading commit data...
v8-schema-agent-impl.h Loading commit data...
v8-stack-trace-impl.cc Loading commit data...
v8-stack-trace-impl.h Loading commit data...
v8-string-conversions.cc Loading commit data...
v8-string-conversions.h Loading commit data...
v8-value-utils.cc Loading commit data...
v8-value-utils.h Loading commit data...
value-mirror.cc Loading commit data...
value-mirror.h Loading commit data...