WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
ASSIGNED
151584
Web Inspector: No way to easily turn off/on a source map while debugging
https://bugs.webkit.org/show_bug.cgi?id=151584
Summary
Web Inspector: No way to easily turn off/on a source map while debugging
Ricci Adams
Reported
2015-11-24 00:48:07 PST
I'm a heavy user of source maps due to various transpilers and code minifiers. When the debugger stops on a breakpoint or an exception is thrown, the source mapped file is displayed rather than the raw .js file. This is normally what I want. However, there are times when I need to see the raw JavaScript in order to properly debug an issue. Due to #142091, I also need to be able to turn off the source map in order to see type information / code coverage.
Attachments
[Animated GIF] No way to show non-source-mapped JS while debugging
(1.89 MB, image/gif)
2015-11-25 03:04 PST
,
Nikita Vasilyev
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2015-11-24 00:48:19 PST
<
rdar://problem/23653918
>
Nikita Vasilyev
Comment 2
2015-11-25 00:56:56 PST
> However, there are times when I need to see the raw JavaScript in order to > properly debug an issue. Due to #142091, I also need to be able to turn off > the source map in order to see type information / code coverage.
Could you specify a use case for turning off source maps besides seeing information / code coverage (
bug 142091
)? If that's the only use case, we should just fix it.
Ricci Adams
Comment 3
2015-11-25 01:18:03 PST
Inability to see the actual variable name is often an issue. The debugger displays the generated/minified variable name in the right panel, but the actual source shows the original non-minified name. Source maps can optionally include identifier name information, but not all tools support this. I'm not sure if the Web Inspector will display the original variable name if such information is provided. I'm also not sure if 142091 is fixable for all source maps - I've seen some complex ones generated by UglifyJS due to its rearranging of code.
Nikita Vasilyev
Comment 4
2015-11-25 02:58:49 PST
(In reply to
comment #3
)
> Inability to see the actual variable name is often an issue. The debugger > displays the generated/minified variable name in the right panel, but the > actual source shows the original non-minified name.
We may want to show source mapped variable names in the right sidebar and the console. It seems to be theoretically possible.
> > Source maps can optionally include identifier name information, but not all > tools support this. I'm not sure if the Web Inspector will display the > original variable name if such information is provided.
Could you show a tool that supports this?
Nikita Vasilyev
Comment 5
2015-11-25 03:04:39 PST
Created
attachment 266150
[details]
[Animated GIF] No way to show non-source-mapped JS while debugging In the resources left sidebar, we allow to expand source-mapped files to select their non-source-mapped versions. We should do the same in Debugger. In addition to that, we should make sure jumping through the stack trace works for both source-mapped and non-source-mapped files.
Ricci Adams
Comment 6
2015-11-25 03:32:43 PST
> Could you show a tool that supports this?
https://github.com/mozilla/source-map/
is the standard module that many JS tools use. SourceMapGenerator#addMapping supports a name property, which specifies "An optional original token name for this mapping". The actual spec is vague on this, however (see
https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit
)
Ricci Adams
Comment 7
2015-11-25 03:36:51 PST
> In the resources left sidebar, we allow to expand source-mapped files to > select their non-source-mapped versions. > > We should do the same in Debugger.
Ideally, I wouldn't need to expand any file while in the Debugger - I would just toggle off/on the map, and the Debugger would update the source view and take me to the correct line in the alternate file.
Joseph Pecoraro
Comment 8
2015-12-01 15:44:17 PST
> Ideally, I wouldn't need to expand any file while in the Debugger - I would > just toggle off/on the map, and the Debugger would update the source view > and take me to the correct line in the alternate file.
I agree. We've discussed a Global Setting / Preference for this.
> > Could you show a tool that supports this? > >
https://github.com/mozilla/source-map/
is the standard module that many JS > tools use. SourceMapGenerator#addMapping supports a name property, which > specifies "An optional original token name for this mapping". > > The actual spec is vague on this, however (see >
https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b
- > _2gc6fAH0KY0k/edit)
Yes this is pretty vague. We could probably start by assuming, if there is a name, try using that name in the debugger. But this is still an assumption that could be broken if names are used for another purpose across SourceMap generators.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug