1. 07 Feb, 2022 1 commit
  2. 31 Jan, 2022 1 commit
  3. 05 Jan, 2022 1 commit
    • Benedikt Meurer's avatar
      [inspector] Gracefully ignore non-dictionary values as session state. · dc3eb449
      Benedikt Meurer authored
      The V8InspectorSessionImpl constructor accepts a state, as either text
      or CBOR encoded, and generally ignores all invalid inputs, except for
      the case where it's a valid value, but not a dictionary value, in which
      case it'll leak the value and crash upon casting to a `DictionaryValue`.
      
      This is purely an issue with the test driver, so no security impact on
      Chromium in the wild.
      
      Fixed: chromium:1281031
      Change-Id: I7b4d0aea83370499b1274d3fa214a14dc098d2f2
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3361838
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78490}
      dc3eb449
  4. 29 Dec, 2021 1 commit
    • Benedikt Meurer's avatar
      [inspector] Correct location for inline scripts with sourceURL. · a81e8d16
      Benedikt Meurer authored
      Previously the `Debugger.CallFrame`s in `Debugger.paused` events would
      report locations relative to the surrounding document in case of inline
      scripts with `//@ sourceURL` annotations (while `Runtime.CallFrame` was
      already fixed previously as part of crrev.com/c/3069289). With this CL
      the locations in `Debugger.CallFrame` are also appropriately adjusted.
      
      Drive-by-fix: Several inspector tests were (incorrectly) relying on this
      wrong treatment, and were also unnecessarily using //# sourceURL
      annotations. So part of this CL also addresses that problem and makes
      the tests more robust, using addInlineScript() helper.
      
      Fixed: chromium:1283049
      Bug: chromium:1183990, chromium:578269
      Change-Id: I6e3b215d951c3453c0a9cfc9bccf3dc3d5e92fd6
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3359619
      Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
      Commit-Queue: Yang Guo <yangguo@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78450}
      a81e8d16
  5. 29 Nov, 2021 1 commit
    • Benedikt Meurer's avatar
      [inspector] Account for dynamic nature of the `fn.name` property. · f1ddb2fa
      Benedikt Meurer authored
      With https://crrev.com/c/3272577 we introduced a `StackFrame` cache for
      the inspector, which is keyed on the script ID, line and column number,
      so the syntactic properties of the function. However, the name that we
      report for functions is dynamic and can change (per closure) by
      explicitly reconfiguring the "name" property via
      
      ```js
      var f = function() { /* ... */ }
      Object.defineProperty(f, "name", {value: "super duper function"});
      ```
      
      for example, so we need to take that into account as well, and only use
      the cached `StackFrame` instance if the dynamic names still match up.
      Otherwise we just overwrite the cached entry with a new instance (the
      assumption here is that "name" isn't reconfigured often).
      
      Fixed: chromium:1274529
      Bug: chromium:1268436
      Change-Id: I519017c762aed5b4f93b9dc4553fa81d5979f1a1
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3306376
      Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
      Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
      Reviewed-by: 's avatarSimon Zünd <szuend@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78127}
      f1ddb2fa
  6. 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
  7. 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
  8. 28 Jul, 2021 2 commits
  9. 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
  10. 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
  11. 12 May, 2021 2 commits
  12. 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
  13. 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
  14. 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
  15. 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
  16. 13 Nov, 2020 1 commit