WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 14469
40969
Web Inspector: Prettyprint the contents of the scripts tab in case it is minified.
https://bugs.webkit.org/show_bug.cgi?id=40969
Summary
Web Inspector: Prettyprint the contents of the scripts tab in case it is mini...
Pavel Feldman
Reported
2010-06-21 22:54:24 PDT
I think we should start with no heuristics, toggling pretty print using status bar button or context menu. We probably should start with the naive approach of pretty-printing on the front-end side + storing line / column mapping for breakpoints. For breakpoints to work, this would require setting them by line:column or offset. There is such a capability in V8, but it is not there (at least not exposed yet) in JSC. Timothy, Joe, how hard is it for you to add that?
Attachments
Add attachment
proposed patch, testcase, etc.
Joseph Pecoraro
Comment 1
2010-06-21 23:23:43 PDT
(In reply to
comment #0
)
> For breakpoints to work, this would require setting them by line:column or offset. > There is such a capability in V8, but it is not there (at least not exposed yet) in JSC. > Timothy, Joe, how hard is it for you to add that?
Good question. To date I have only scratched the surface of JavaScriptCore. So I took a look at this. It looks to me like JSC emits a possible debugger breakpoint message after each statement. And the location data provided for that statement (firstLine() and lastLine()) are originally set in the grammar via a call to setLoc(). So it would involve a change would need to be made to JavaScriptCore's grammar / parser. Incidentally there is already work underway for improvements to the parser:
https://bugs.webkit.org/show_bug.cgi?id=34019
@Oliver Hunt and Zoltan Herczeg, how difficult do you think this would be to add to your new JavaScript parsers or even the existing parser? I would appreciate your expert opinions!
Joseph Pecoraro
Comment 2
2010-06-21 23:27:03 PDT
(In reply to
comment #0
)
> I think we should start with no heuristics, toggling pretty > print using status bar button or context menu.
Also, what did you mean by no heuristics?
Zoltan Herczeg
Comment 3
2010-06-22 00:46:19 PDT
As for nodes in the Abstract Syntax Tree, there is an m_line (int) member for each nodes, but only StatementNodes where its value is trusted (moreover, m_lastLine is right for StatementNodes as well). It is the nature of the bison parser that it could not capture all line locations, since it usually reads some tokens ahead before it could make a decision (thus, the callback handlers do some guesswork to get some useful data). Those nodes, which inherites from ThrowableExpressionData, a "start" and an "end" offset are also provided. Basically, after the byte-code is generated, the AST is dropped, and the byte-code does not contain line info except for op_debug instructions. However, if an exception occurs, the code is reparsed again, and the line info for all nodes are stored in the CodeBlock (see CodeBlock->lineNumberForBytecodeOffset()) The recursive descent parsers would be capable to do this for all nodes without line info error.
Timothy Hatcher
Comment 4
2010-11-30 07:56:41 PST
*** This bug has been marked as a duplicate of
bug 14469
***
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