• Simon Zünd's avatar
    [debug] Fix bug in locals blocklist and refactor scope iterator · 98880d5d
    Simon Zünd authored
    This CL shuffles around some code in `ScopeIterator` to better reflect
    the two (internal) iteration modes:
    
      - While "inside" the paused function we iterate based on lexical
        scopes.
      - Once we move past the paused function we iterate based on runtime
        contexts.
    
    This CL renames the advancing functions to `AdvanceScope` and
    `AdvanceContext` respectively which operate in the following way:
    
      - `AdvanceScope` first checks if the current lexical scope requires
        a context. If so, we move one context up the chain, since the next
        lexical scope belongs to that next context. Then we move up one
        lexical scope.
    
      - `AdvanceContext` moves one context up the context chain. Then we
        we move up through all the lexical scopes until we find the next
        lexical scope that requires a context.
    
    The tricky bit is the transition from scope iteration mode to context
    iteration mode. This is where the bug fix comes in. After doing one
    standard `AdvanceScope` from the `closure_scope_` to the next
    lexical scope, we need to keep moving up through the lexical scope
    until we find the next lexical scope that requires a context.
    
    The CL also changes how we collect the locals blocklist. The
    locals blocklist is always put on the current context. So every
    time we move up one context we reset the locals blocklist and
    every time we move up the lexical scope we collect the scope
    locals into the blocklist.
    
    
    R=bmeurer@chromium.org, jarin@chromium.org
    
    Fixed: chromium:1354464
    Change-Id: I7b37687a8827c20d0660a25413d2c9117b5fe5ba
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3842158
    Commit-Queue: Simon Zünd <szuend@chromium.org>
    Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
    Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#82615}
    98880d5d
Name
Last commit
Last update
..
wasm/gdb-server Loading commit data...
DIR_METADATA Loading commit data...
OWNERS Loading commit data...
debug-coverage.cc Loading commit data...
debug-coverage.h Loading commit data...
debug-evaluate.cc Loading commit data...
debug-evaluate.h Loading commit data...
debug-frames.cc Loading commit data...
debug-frames.h Loading commit data...
debug-interface.cc Loading commit data...
debug-interface.h Loading commit data...
debug-property-iterator.cc Loading commit data...
debug-property-iterator.h Loading commit data...
debug-scope-iterator.cc Loading commit data...
debug-scope-iterator.h Loading commit data...
debug-scopes.cc Loading commit data...
debug-scopes.h Loading commit data...
debug-stack-trace-iterator.cc Loading commit data...
debug-stack-trace-iterator.h Loading commit data...
debug-type-profile.cc Loading commit data...
debug-type-profile.h Loading commit data...
debug-wasm-objects-inl.h Loading commit data...
debug-wasm-objects.cc Loading commit data...
debug-wasm-objects.h Loading commit data...
debug-wasm-objects.tq Loading commit data...
debug.cc Loading commit data...
debug.h Loading commit data...
interface-types.h Loading commit data...
liveedit-diff.cc Loading commit data...
liveedit-diff.h Loading commit data...
liveedit.cc Loading commit data...
liveedit.h Loading commit data...