Set the "wasm://dwarf" fake source map URL on scripts only when the
Wasm DWARF debugging experiment is disabled. This way the Gimli based
prototype will not interfere with the language plugin manager based
extension.
Bug: chromium:1150029, chromium:1083146
Change-Id: I4ce070798d57f819fc11af6217f4f6e1bddfd6fc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2550644
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
The following context menu options don't currently behave correctly with
WebAssembly or simply don't make sense, and are thus hidden from the UI
for now:
- 'Add condition breakpoint'
- 'Add logpoint'
- 'Edit breakpoint'
- 'Never pause here'
- 'Blackbox script'
- 'Continue to here'
Introduce a `DebuggerWorkspaceBinding.scripts()` method to iterate all
the scripts that are related to a given `UISourceCode`. We use that
method to check that every script related to the current `UISourceCode`
is JavaScript, and thus supports the full range of debugging
capabilities.
Bug: chromium:1136484
Change-Id: If6277b43b2fb2fb73e9f3aae53e09074b614f6ed
Fixed: chromium:1142275
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2498222
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
This CL introduces an initiator object for loads that go through
the PageResourceLoader. This enables the page resource loader to
forbid certain resource loads based on the URL of the resource and
the URL of the initiator. This is important, for example, for loading
extension source maps.
Bug: chromium:974543
Change-Id: If2b1d8f93be60ad0d3ca8261074b92625ed58c02
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2339316
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
This CL extends the existing extension API to support debugger language
plugins hosted inside chrome extensions. The patch adds a new
experimental interface to allow extensions to egister a language plugin,
which then gets called by the debugger to provide debug information.
Drive-By: Drop the experimental out-of-process language plugin made
obsolete by the language extensions.
Bug: chromium:1083146
Change-Id: Icbf755e5761f6b7a5df6406a725e38eba965683e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2245146
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
The content of the `Script` is lazily loaded, but wasn't properly
encapsulated in a Promise and `await`ed correctly everywhere. This
change fixes that and removes the `_source` and `_originalSource`
fields from the `Script`. There are still data races left with
respect to Wasm source mapping, and those will be fixed in a later
CL once it's clear how we propagate this information.
Bug: chromium:1056632
Change-Id: I43b47825cfa41a8595c353b4205c0ef471ed524d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2218008
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
After the DebugSymbols CDP change landed, the backend stopped reporting
the fake wasm://dwarf source map urls. Until we properly support
DebugSymbols in the frontend, bring the fak url back in the frontend to
fix the DWARF SourceMap approach.
Bug: chromium:1082720
Change-Id: I366993c7183b9d47b7f42f7d2517571907f913f3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2201636
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
To enable full parallelization of all files in sdk/, we can add the
@ts-nocheck annotation to all files. This suppresses existing
TypeScript errors in these files.
We can then one-by-one remove these annotations and fix the issues
reported in these files. This allows us to parallelize the work
and work on many files at the same time.
As a starter, I typechecked sdk/Connections.js to verify that
typechecking works while all other files are not checked yet.
I did do so by locally suppressing all TypeScript errors in
SDKModel.js and remove the `instance` method on `TargetManager`.
I then confirmed that rebuilding with TypeScript correctly
fails on the missing method, but does not require SDKModel.js
itself to be typechecked.
Bug: 1011811
Change-Id: I46de3839f7d837e951967dd932218bda00c6ad5b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2156352
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
This changes the Common.Worker to create Workers that use the module
scope rather than the global scope. It allows us to use es-imports,
which consequently allows us to remove the bundling during the build
step. This should hopefully improve the Ninja non-determinism that we
were facing when making changes to files that are used in the various
workers.
Bug: 1006759
Change-Id: I7ac209817b1576d2accd790f1bf7ef6a658f5605
Fixed: 1013129
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1981615
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
This adds native location resolver, written in Rust and compiled to
WebAssembly, that can parse DWARF information from other given
WebAssembly modules and resolve addresses <-> source location mappings
in both directions.
From V8 side, this depends on recently added Debugger.getWasmBytecode
command and on a special "wasm://dwarf" source map URL reported for Wasm
modules that contain DWARF information.
On the JavaScript side, this uses autogenerated JavaScript bindings by
wasm-bindgen to an internal context which contains all parsed data and
lazily creates SDK.SourceMapEntry when requested. These bindings are
further wrapped into a public class that implements SDK.SourceMap
interface.
---
Always auto-step over Wasm DWARF
Wasm doesn't have any other source when DWARF is used for source
mapping, so it will step into an empty source pane.
This is not very useful, so let's always auto-step to the next resolved
location.
There are talks about stabilising auto-stepping for JS source maps as
well, but for now limiting to just the new functionality should be
safer.
Change-Id: I6e981dcd33a03a5db2f2b1e39a93372c5ba09b97
Bug: 1016772
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1872581
Commit-Queue: Ingvar Stepanyan <rreverser@google.com>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Translation between source locations of inline scripts with #sourceURL=
did not work correctly, because the SourceFormatter handled them like
inline scripts. DevTools opens them in its own window, and then
continues to refer to locations in the file by the original positions
in the containing document; however, the line endings used for
formatting are line endings for the script only (in contrast to line
endings for other inline scripts, which just reuse the line endings
of the containing document).
This CL adds a hack to handle inline scripts with #sourceURL= separately
which entails that the SourceFormatter now also needs to know that
such scripts are displayed in their own frame (as it is supposed to
produce valid uiLocations). A redesign at some point in the future must
clean this up; at the moment only fragmental knowledge about how this is
supposed to work exists.
Bug: chromium:1003497, chromium:1005789
Fixes: chromium:1017738
Change-Id: I3e13c6bc76b8692ce6badc09880c41d1a7e444c4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1875713
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
The source editor, when it cannot load a particular file, will simply
display a blank file instead. At the bottom, this is because the APIs
used to load the files do not have a way to propagate an error up to
the call site. Rather, the callback either is never called, or is
called with just an empty string.
This refactor changes the way the project system loads file contents
by replacing the callback model with a Promise-based model. However,
in this version, rather than propagating an error (handled via
catch), the error is exposed as a property on the object passed via
the the load functions. Although it might be preferable to use
async throw/catch, because there are ~4-5 layers of redirection
through the project system, the added complexity seems to not really
justify that work. I'm open to reconsidering this design, though.
Attempting to load a file via file:// which does not exist previously
produced no error because the DevToolsUIBindings handler would just
always resolve with no content and HTTP status 200. I had previously
addressed that bug in this changeset, but I've split it out to
https://chromium-review.googlesource.com/c/chromium/src/+/1847833 .
Sample "after" screenshot: https://imgur.com/a/tlm90sg
Bug: 961940
Bug: 941035
Change-Id: If121611090e9c35eeb1de162b59f8a9f72f696d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1817677
Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
Reviewed-by: Jeff Fisher <jeffish@microsoft.com>
Commit-Queue: Lorne Mitchell <lomitch@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#705438}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 61ec2a233d9a7bf4bb4b3e610de6fc233ae0d46e
Previously the DevTools UI would strip out //# sourceURL=... and
//@ sourceURL=... lines from the script in the frontend no matter
where they showed up in the source code, which means that all the
positions after this line will be off by 1 between frontend
and backend. It's generally also very confusing to developers that
we're removing code from the script before showing it.
In general, we should just display exactly the code that the developer
wrote (similar to Firefox DevTools and Safari WebInspector), however
there's quite a bit of internal logic relying on the special handling
of sourceURL comments (at the end), for example when it comes to
snippets. So meanwhile we only remove the comments when they are found
at the end of the source code, which is where tools put them.
Bug: chromium:1003497
Change-Id: I4404e2f7b6b61d50f85e44bbd9e0ae56675670af
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1840512
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#703244}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 41700f354fcb17636b6d8a280a5f291423e22813
The Chromium/Google style guides does not enforce curly braces for
single-line if-statements, but does strongly recommend doing so. Adding
braces will improve code readability, by visually separating code
blocks. This will also prevent issues where accidental additions are
pushed to the "else"-clause instead of in the if-block.
This CL also updates the presubmit `eslint` to run the fix with the
correct configuration. It will now fix all issues it can fix.
Change-Id: I4b616f21a99393f168dec743c0bcbdc7f5db04a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1821526
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jeff Fisher <jeffish@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#701070}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7e0bdbe2d7f9fc2386bfaefda3cc29c66ccc18f9
Both Bindings.cssWorkspaceBinding.uiLocationToRawLocations and well as
Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations resolve
locations to non-existing CSS and Script locations. This patch fixes
Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations to not do
this anymore, and hacks
Bindings.cssWorkspaceBinding.uiLocationToRawLocations to not do it
for formatted sources anymore. For the ultimate fix, we need to get
the end position for inline CSS from the back-end. This will allow
us to clean-up the hack as well.
The significance of this change is that it enables precise coverage
gutters for inline CSS and inline scripts.
Bug: chromium:1004203, chromium:1005708, chromium:1005789
Change-Id: Ieadb2aef7e610ecec35e28f5f1cc4516a28a0780
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1814299
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#698431}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0a2176832ad71200173bab203b83a4128062683c
The new compiler caught a lot of pre-existing issues in the codebase.
Sadly, the old compiler version was not smart enough to understand the
new changes. Therefore, the changes have be included in the same CL as
the compiler update.
Most of the changes are related to better handling of prototype and
class inheritance, as well as handling of null/undefined tracking.
Change-Id: I3941a3a240a4d09c4945e1e20d2521090ef837c9
Bug: 991710
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1762081
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@google.com>
Auto-Submit: Tim van der Lippe <tvanderlippe@google.com>
Cr-Original-Commit-Position: refs/heads/master@{#696761}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ca93474213278e32e36d6ace1474c56884030757
Current logic produces one Debugger.setBlackboxedRanges call on each
scriptParsed event. It makes our frontend too much chatty.
This CL simplify blackbox manager. With new logic blackbox manager
sends Debugger.setBlackboxedRanges iff script has sourceMap and at
least one sourceURL from sourceMap is blackboxed.
When blackbox pattern changed frontend will send setBlackboxedRanges
iff ranges are affected by change.
R=lushnikov@chromium.org
Change-Id: I8b9511f9feba50127de4add98c8d191877103145
Reviewed-on: https://chromium-review.googlesource.com/1162308
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#580742}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 2ba8a2397295a119aa848a1067ff1960ce2bb3f7