• Seth Brenith's avatar
    Fix v8windbg Locals pane behavior · 607ad422
    Seth Brenith authored
    Background:
    
    In order to show custom content in the "Locals" pane in WinDbg, v8windbg
    replaces the getter function for a built-in debug model property named
    "Debugger.Models.StackFrame.LocalVariables". This is the property that
    the debugger fetches when determining what to display in "Locals". The
    new implementation of that getter, V8LocalVariables::GetValue, can
    either call the original getter (so that WinDbg displays the usual
    content for normal C++ frames) or produce a custom result (for builtins
    and JIT-compiled JS frames).
    
    The current problem:
    
    In new builds of WinDbg, users of v8windbg no longer see any content in
    the Locals pane for stack frames that correspond to builtins or
    JIT-compiled code. This is because of a behavior change in WinDbg:
    previously, attempting to get Debugger.Models.StackFrame.LocalVariables
    would eagerly attempt to find the symbols for the frame and return an
    error code if symbols were not found, but now it returns a lazy object
    which does not perform symbol lookup until you iterate its properties.
    V8LocalVariables::GetValue currently starts with an early-exit path
    based on checking whether the original getter succeeded, so the new lazy
    implementation causes us to always take that early exit.
    
    Proposed fix:
    
    Rather than relying on the return value from the original getter, which
    is not guaranteed to work consistently, we can base our decisions on the
    instruction pointer. If it points outside any module, or if it points to
    within a function in the module containing V8 whose name starts with
    "Builtins_", then we can build a custom result for the Locals pane.
    
    Change-Id: I6644071d5d83a25b964d9f4018265532528cc85c
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3759228Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
    Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
    Cr-Commit-Position: refs/heads/main@{#81856}
    607ad422
Name
Last commit
Last update
.github Loading commit data...
bazel Loading commit data...
build_overrides Loading commit data...
custom_deps Loading commit data...
docs Loading commit data...
gni Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.bazelrc Loading commit data...
.clang-format Loading commit data...
.clang-tidy Loading commit data...
.editorconfig Loading commit data...
.flake8 Loading commit data...
.git-blame-ignore-revs Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.mailmap Loading commit data...
.style.yapf Loading commit data...
.vpython Loading commit data...
.vpython3 Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.bazel Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
COMMON_OWNERS Loading commit data...
DEPS Loading commit data...
DIR_METADATA Loading commit data...
ENG_REVIEW_OWNERS Loading commit data...
INFRA_OWNERS Loading commit data...
INTL_OWNERS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LOONG_OWNERS Loading commit data...
MIPS_OWNERS Loading commit data...
OWNERS Loading commit data...
PPC_OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
RISCV_OWNERS Loading commit data...
S390_OWNERS Loading commit data...
WATCHLISTS Loading commit data...
WORKSPACE Loading commit data...
codereview.settings Loading commit data...