1. 19 Oct, 2021 1 commit
    • Benedikt Meurer's avatar
      [inspector] Improve class name inference. · b141fedf
      Benedikt Meurer authored
      Previously having a `Symbol.toStringTag` property holding a string
      somewhere in the prototype chain would always take predence over trying
      to determine a reasonable name from the "constructor" (in case of
      subclassing). This would lead to confusing behavior when diagnosing
      objects in DevTools, for example
      
      ```js
      class A extends URLSearchParams {};
      new A()
      ```
      
      would show `URLSearchParam` as class name for the instance rather than
      `A`.
      
      With this CL, we change the lookup logic to explicitly check for
      `Symbol.toStringTag` and "constructor" along each step of the prototype
      chain (skipping the "constructor" for the leaf object) and pick the
      first one that yields a string (that is the function debug name in case
      of "constructor").
      
      Fixed: chromium:980018
      Change-Id: Ic920b4bae02f965bc383c711f8de89c0de55fcac
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3231078
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
      Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarKim-Anh Tran <kimanh@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#77453}
      b141fedf
  2. 01 Oct, 2021 1 commit
    • Benedikt Meurer's avatar
      [debug] Set breakpoints correctly right after function literals. · 6d25f20f
      Benedikt Meurer authored
      The logic to locate the correct function to set a breakpoint in based
      on script position was treating SharedFunctionInfo::EndPosition() as
      inclusive rather than exclusive. There are various assumptions all over
      the Debugger that seem to demand this treatment for the toplevel script.
      But it's definitely wrong for function literals.
      
      Fixed: chromium:1253277
      Change-Id: I3421703673f4d78aee28e923e03e2fca24bc06ac
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3197715
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
      Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarKim-Anh Tran <kimanh@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#77186}
      6d25f20f
  3. 28 Jul, 2021 2 commits
  4. 22 Jun, 2021 1 commit
    • Benedikt Meurer's avatar
      [debug] Default to last break index. · 01605d56
      Benedikt Meurer authored
      When looking up the break index for a given source position, default to
      the last break index if there is neither a precise match nor a breakable
      position after the source position (in which case we still pick the
      first candidate).
      
      Fixed: chromium:1222065
      Bug: chromium:901819, chromium:782461, chromium:1222060
      Change-Id: I10d6a086b2d5fadc9e6dca0c49ed4187eb0359ff
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2972917
      Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
      Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
      Reviewed-by: 's avatarKim-Anh Tran <kimanh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#75284}
      01605d56
  5. 19 May, 2021 1 commit
    • Benedikt Meurer's avatar
      [inspector] Derive breakpoint hint based on resolved location. · ea3ee6da
      Benedikt Meurer authored
      When setting a breakpoint on a line (in the DevTools front-end), the
      front-end sends a columnNumber of 0 and the inspector automatically
      resolves the actual location (in bytecode execution order). In order
      to also support changing source code, the inspector memorizes a text
      hint, and uses that to adjust the location upon reload. This hint was
      however taken based on the original line and column numbers, rather than
      the resolved location, which causes trouble when syntactic order doesn't
      match execution order, as in case of `await o.m()`.
      
      In order to address that we now remember the textual hint based on the
      resolved location.
      
      Fixed: chromium:1081162
      Also-By: kimanh@chromium.org
      Change-Id: I7d08373440693b7abc18c29c1a05929d771d3031
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2905606
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarKim-Anh Tran <kimanh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#74675}
      ea3ee6da
  6. 12 May, 2021 2 commits
  7. 30 Apr, 2021 1 commit
    • Benedikt Meurer's avatar
      [debugger] Don't attach source positions to implicit returns. · 379331b7
      Benedikt Meurer authored
      Previously we'd attach source positions to implicit returns that are
      generated when leaving an async function with a promise rejection. This
      was due to the use of `kNoSourcePosition` on the `end_position` in the
      `ReturnStatement` nodes as indicator to pick the return position from
      the function literal, instead of really not putting a source position on
      that specific `Return` bytecode.
      
      This CL adds a dedicated marker to `ReturnStatement` to express that the
      `BytecodeGenerator` should put the return position from the function
      literal there instead of overloading the meaning of `kNoSourcePosition`.
      
      Bug: chromium:901819, chromium:782461
      Fixed: chromium:1199919, chromium:1201706
      Change-Id: I3647e0c3d711e9c3d6ae44606b70ec92ad82e1cf
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2859945
      Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#74301}
      379331b7
  8. 28 Apr, 2021 1 commit
    • Benedikt Meurer's avatar
      [debug] Disallow LiveEdit of active frames. · 53fc4807
      Benedikt Meurer authored
      Previously we'd allow to replace the source of functions that are on the
      current execution stack under certain conditions, but this has resulted
      in an endless stream of bugs due to weird edge cases, and so we're now
      limiting LiveEdit to functions that don't have any activation (including
      not a suspended generator / async function activation).
      
      We might eventually add the ability to LiveEdit functions with
      activations and have them "upgrade upon next invocation", but that
      doesn't seem to be an extremely important use case right now.
      
      Fixed: chromium:1195927
      Change-Id: I87a45ba4d0ddcfbf867bd4e73738d76b2d789e04
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2846892
      Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#74249}
      53fc4807
  9. 11 Mar, 2021 1 commit
    • Benedikt Meurer's avatar
      [inspector] Properly filter by column number for inline scripts. · 81b91591
      Benedikt Meurer authored
      Previously `setBreakpointByUrl` and friends would only filter based on
      line number to find matching scripts. But that didn't work when there
      were multiple scripts in the same line (i.e. minified HTML), and we'd
      end up setting multiple breakpoints in different inline scripts, looking
      for the next possible break location in each of them individually.
      
      Fixed: chromium:1183664
      Also-By: pfaffe@chromium.org, kimanh@chromium.org
      Change-Id: I957811d30aa71609a38da75f33a24c0f720116f6
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2749155
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
      Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarKim-Anh Tran <kimanh@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#73332}
      81b91591
  10. 20 Jan, 2021 1 commit
    • Simon Zünd's avatar
      Forward exceptions while using DebugPropertyIterator · af7e6893
      Simon Zünd authored
      The V8 inspector is using the DebugPropertyIterator (a debug only
      interface) while building RemoteObjects. The DebugPropertyIterator
      uses the `KeyAccumulator::GetKeys` for this, which can potentially
      throw, but the DebugPropertyIterator ignores exceptions and keeps
      iterating. If multiple iteration steps throw an exception
      (e.g. due to a pending stack overflow), we run into a CHECK in
      Isolate::Throw, as we can't throw exceptions while another
      exception is still pending.
      
      This CL fixes the CHECK crash by properly propagating exceptions
      after the iterator is created or advanced and returning early
      in the inspector if an exception happens.
      
      Please note that the regression test that showcases this behavior
      is still disabled, as fixing the crash causes currently an
      endless loop. While the exception in `ValueMirror::getProperties`
      is handled by early returing, we still need to forward it as
      the result of the `Runtime::evaluate` all the way up the stack.
      
      R=bmeurer@chromium.org, yangguo@chromium.org
      
      Bug: chromium:1080638
      Change-Id: I1d55e0d70490a06a6bc1b0a3525236411da7f64b
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2639954Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
      Commit-Queue: Simon Zünd <szuend@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#72203}
      af7e6893
  11. 13 Nov, 2020 1 commit