haikuwebkit/LayoutTests/inspector/debugger/paused-scopes-expected.txt

337 lines
12 KiB
Plaintext
Raw Permalink Normal View History

Web Inspector: Wrong function name next to scope https://bugs.webkit.org/show_bug.cgi?id=158210 <rdar://problem/26543093> Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-06-30 Reviewed by Timothy Hatcher. Source/JavaScriptCore: * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: Add DebuggerLocation. A helper for describing a unique location. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::setConstantRegisters): When compiled with debug info, add a SymbolTable rare data pointer back to the CodeBlock. This will be used later to get JSScope debug info if Web Inspector pauses. * runtime/SymbolTable.h: * runtime/SymbolTable.cpp: (JSC::SymbolTable::cloneScopePart): (JSC::SymbolTable::prepareForTypeProfiling): (JSC::SymbolTable::uniqueIDForVariable): (JSC::SymbolTable::uniqueIDForOffset): (JSC::SymbolTable::globalTypeSetForOffset): (JSC::SymbolTable::globalTypeSetForVariable): Rename rareData and include a CodeBlock pointer. (JSC::SymbolTable::rareDataCodeBlock): (JSC::SymbolTable::setRareDataCodeBlock): Setter and getter for the rare data. It should only be set once. (JSC::SymbolTable::visitChildren): Visit the rare data code block if we have one. * runtime/JSSymbolTableObject.h: * runtime/JSSymbolTableObject.cpp: (JSC::JSSymbolTableObject::deleteProperty): (JSC::JSSymbolTableObject::getOwnNonIndexPropertyNames): Give JSSymbolTable its own class info. JSWithScope was unexpectedly inheriting from JSSymbolTable since it did not have its own and was using JSScope's class info. Also do a bit of cleanup. * debugger/DebuggerLocation.cpp: Added. (JSC::DebuggerLocation::DebuggerLocation): * debugger/DebuggerLocation.h: Added. (JSC::DebuggerLocation::DebuggerLocation): Construction from a ScriptExecutable. * runtime/JSScope.cpp: (JSC::JSScope::symbolTable): * runtime/JSScope.h: * debugger/DebuggerScope.h: * debugger/DebuggerScope.cpp: (JSC::DebuggerScope::name): (JSC::DebuggerScope::location): Name and location for a scope. This uses: JSScope -> SymbolTable -> CodeBlock -> Executable * inspector/protocol/Debugger.json: * inspector/InjectedScriptSource.js: (InjectedScript.CallFrameProxy.prototype._wrapScopeChain): (InjectedScript.CallFrameProxy._createScopeJson): * inspector/JSJavaScriptCallFrame.cpp: (Inspector::valueForScopeType): (Inspector::valueForScopeLocation): (Inspector::JSJavaScriptCallFrame::scopeDescriptions): (Inspector::JSJavaScriptCallFrame::scopeType): Deleted. * inspector/JSJavaScriptCallFrame.h: * inspector/JSJavaScriptCallFramePrototype.cpp: (Inspector::JSJavaScriptCallFramePrototype::finishCreation): (Inspector::jsJavaScriptCallFramePrototypeFunctionScopeDescriptions): (Inspector::jsJavaScriptCallFramePrototypeFunctionScopeType): Deleted. Simplify this code to build the objects we will send across the protocol to descript a Scope. Source/WebInspectorUI: * UserInterface/Controllers/DebuggerManager.js: (WebInspector.DebuggerManager.prototype._scopeChainNodeFromPayload): Include new payload data in the construction call. All the new data is optional, so we gracefully handle legacy backends. * UserInterface/Models/ScopeChainNode.js: (WebInspector.ScopeChainNode): (WebInspector.ScopeChainNode.prototype.get type): (WebInspector.ScopeChainNode.prototype.get objects): (WebInspector.ScopeChainNode.prototype.get name): (WebInspector.ScopeChainNode.prototype.get location): (WebInspector.ScopeChainNode.prototype.get hash): Hash is a rough (name:sourceId:line:column) string for quick comparisons. (WebInspector.ScopeChainNode.prototype.makeLocalScope): Make this an action you take on a scope, to avoid having to do it at construction time, or making it a generic setting. * UserInterface/Views/ScopeChainDetailsSidebarPanel.js: (WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateCallFramesSection): This was wrong before. Move the work to CallFrame and change it to be correct. * UserInterface/CallFrame.js: (WebInspector.CallFrame.prototype.mergedScopeChain): This transforms the scope chain for a call frame from: scope1 scope2 scope3 scope4 scope5 scope6 scope7 foo foo foo bar bar - - Block Closure Closure Closure Closure GLE GBL To: scope1 scope2&3 scope4&5 scope6 scope7 foo foo* bar* - - Block Local Closure GLE GBL Doing a few things: - Merge the first two Closure scopes sharing a location. These are the "var" and "let" Closure scopes in a function, and it is better to present these together in the UI. - Mark the first Closure scope within a function (*). When this is displayed in the UI, we can provide the name of the function: "Closure Scope (name)", and we even have location information that we can use to display a goto arrow if needed. - Make the first Closure scope the Local scope if it matches the Call Frame's function name. This lets us display the section as "Local Variables". LayoutTests: * inspector/debugger/paused-scopes-expected.txt: Added. * inspector/debugger/paused-scopes.html: Added. * inspector/debugger/resources/paused-scopes.js: Added. Test dumps the call frames and scope chains for each call frame when pausing at different locations in a program. Outputting the hashes we can see even identically named functions have different hashes because their location is different. * inspector/model/scope-chain-node.html: Make the test more stable on debug builds which run slower. Canonical link: https://commits.webkit.org/177450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202717 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-06-30 23:24:58 +00:00
Check scope chains for different call frames at different pauses.
== Running test suite: PausedCallFrameScope
-- Running test case: PausedCallFrameScope.TriggerFirstPause
Web Inspector: Wrong function name next to scope https://bugs.webkit.org/show_bug.cgi?id=158210 <rdar://problem/26543093> Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-06-30 Reviewed by Timothy Hatcher. Source/JavaScriptCore: * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: Add DebuggerLocation. A helper for describing a unique location. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::setConstantRegisters): When compiled with debug info, add a SymbolTable rare data pointer back to the CodeBlock. This will be used later to get JSScope debug info if Web Inspector pauses. * runtime/SymbolTable.h: * runtime/SymbolTable.cpp: (JSC::SymbolTable::cloneScopePart): (JSC::SymbolTable::prepareForTypeProfiling): (JSC::SymbolTable::uniqueIDForVariable): (JSC::SymbolTable::uniqueIDForOffset): (JSC::SymbolTable::globalTypeSetForOffset): (JSC::SymbolTable::globalTypeSetForVariable): Rename rareData and include a CodeBlock pointer. (JSC::SymbolTable::rareDataCodeBlock): (JSC::SymbolTable::setRareDataCodeBlock): Setter and getter for the rare data. It should only be set once. (JSC::SymbolTable::visitChildren): Visit the rare data code block if we have one. * runtime/JSSymbolTableObject.h: * runtime/JSSymbolTableObject.cpp: (JSC::JSSymbolTableObject::deleteProperty): (JSC::JSSymbolTableObject::getOwnNonIndexPropertyNames): Give JSSymbolTable its own class info. JSWithScope was unexpectedly inheriting from JSSymbolTable since it did not have its own and was using JSScope's class info. Also do a bit of cleanup. * debugger/DebuggerLocation.cpp: Added. (JSC::DebuggerLocation::DebuggerLocation): * debugger/DebuggerLocation.h: Added. (JSC::DebuggerLocation::DebuggerLocation): Construction from a ScriptExecutable. * runtime/JSScope.cpp: (JSC::JSScope::symbolTable): * runtime/JSScope.h: * debugger/DebuggerScope.h: * debugger/DebuggerScope.cpp: (JSC::DebuggerScope::name): (JSC::DebuggerScope::location): Name and location for a scope. This uses: JSScope -> SymbolTable -> CodeBlock -> Executable * inspector/protocol/Debugger.json: * inspector/InjectedScriptSource.js: (InjectedScript.CallFrameProxy.prototype._wrapScopeChain): (InjectedScript.CallFrameProxy._createScopeJson): * inspector/JSJavaScriptCallFrame.cpp: (Inspector::valueForScopeType): (Inspector::valueForScopeLocation): (Inspector::JSJavaScriptCallFrame::scopeDescriptions): (Inspector::JSJavaScriptCallFrame::scopeType): Deleted. * inspector/JSJavaScriptCallFrame.h: * inspector/JSJavaScriptCallFramePrototype.cpp: (Inspector::JSJavaScriptCallFramePrototype::finishCreation): (Inspector::jsJavaScriptCallFramePrototypeFunctionScopeDescriptions): (Inspector::jsJavaScriptCallFramePrototypeFunctionScopeType): Deleted. Simplify this code to build the objects we will send across the protocol to descript a Scope. Source/WebInspectorUI: * UserInterface/Controllers/DebuggerManager.js: (WebInspector.DebuggerManager.prototype._scopeChainNodeFromPayload): Include new payload data in the construction call. All the new data is optional, so we gracefully handle legacy backends. * UserInterface/Models/ScopeChainNode.js: (WebInspector.ScopeChainNode): (WebInspector.ScopeChainNode.prototype.get type): (WebInspector.ScopeChainNode.prototype.get objects): (WebInspector.ScopeChainNode.prototype.get name): (WebInspector.ScopeChainNode.prototype.get location): (WebInspector.ScopeChainNode.prototype.get hash): Hash is a rough (name:sourceId:line:column) string for quick comparisons. (WebInspector.ScopeChainNode.prototype.makeLocalScope): Make this an action you take on a scope, to avoid having to do it at construction time, or making it a generic setting. * UserInterface/Views/ScopeChainDetailsSidebarPanel.js: (WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateCallFramesSection): This was wrong before. Move the work to CallFrame and change it to be correct. * UserInterface/CallFrame.js: (WebInspector.CallFrame.prototype.mergedScopeChain): This transforms the scope chain for a call frame from: scope1 scope2 scope3 scope4 scope5 scope6 scope7 foo foo foo bar bar - - Block Closure Closure Closure Closure GLE GBL To: scope1 scope2&3 scope4&5 scope6 scope7 foo foo* bar* - - Block Local Closure GLE GBL Doing a few things: - Merge the first two Closure scopes sharing a location. These are the "var" and "let" Closure scopes in a function, and it is better to present these together in the UI. - Mark the first Closure scope within a function (*). When this is displayed in the UI, we can provide the name of the function: "Closure Scope (name)", and we even have location information that we can use to display a goto arrow if needed. - Make the first Closure scope the Local scope if it matches the Call Frame's function name. This lets us display the section as "Local Variables". LayoutTests: * inspector/debugger/paused-scopes-expected.txt: Added. * inspector/debugger/paused-scopes.html: Added. * inspector/debugger/resources/paused-scopes.js: Added. Test dumps the call frames and scope chains for each call frame when pausing at different locations in a program. Outputting the hashes we can see even identically named functions have different hashes because their location is different. * inspector/model/scope-chain-node.html: Make the test more stable on debug builds which run slower. Canonical link: https://commits.webkit.org/177450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202717 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-06-30 23:24:58 +00:00
CALLFRAME: firstPause
---- Scope Chain ----
SCOPE: Name (firstPause) - Type (Block) - Hash (firstPause:<sourceID>:21:29)
- barLexicalVariable2
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:21:29)
- barLexicalVariable2
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:21:29)
- barVarVariable1
SCOPE: Name (firstPause) - Type (FunctionName) - Hash (firstPause:<sourceID>:21:29)
- firstPause
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
- fakeFirstPauseLexicalVariable
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
- fooLexicalVariable2
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
- firstPause
- fooVarVariable1
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
- globalLet2
SCOPE: Name () - Type (Global) - Hash ()
---- Merged Scope Chain ----
SCOPE: Name (firstPause) - Type (Block) - Hash (firstPause:<sourceID>:21:29)
- barLexicalVariable2
SCOPE: Name (firstPause) - Type (Local) - Hash (firstPause:<sourceID>:21:29)
- barVarVariable1
- barLexicalVariable2
SCOPE: Name (firstPause) - Type (FunctionName) - Hash (firstPause:<sourceID>:21:29)
- firstPause
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
- fakeFirstPauseLexicalVariable
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
- firstPause
- fooVarVariable1
- fooLexicalVariable2
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
- globalLet2
SCOPE: Name () - Type (Global) - Hash ()
CALLFRAME: firstPause
---- Scope Chain ----
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
- fakeFirstPauseLexicalVariable
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
- fooLexicalVariable2
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
- firstPause
- fooVarVariable1
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
- globalLet2
SCOPE: Name () - Type (Global) - Hash ()
---- Merged Scope Chain ----
SCOPE: Name (firstPause) - Type (Local) - Hash (firstPause:<sourceID>:19:24)
- fakeFirstPauseLexicalVariable
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
- firstPause
- fooVarVariable1
- fooLexicalVariable2
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
- globalLet2
SCOPE: Name () - Type (Global) - Hash ()
CALLFRAME: entry
---- Scope Chain ----
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
- fooLexicalVariable2
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
- firstPause
- fooVarVariable1
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
- globalLet2
SCOPE: Name () - Type (Global) - Hash ()
---- Merged Scope Chain ----
SCOPE: Name (entry) - Type (Local) - Hash (entry:<sourceID>:14:15)
- firstPause
- fooVarVariable1
- fooLexicalVariable2
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
- globalLet2
SCOPE: Name () - Type (Global) - Hash ()
-- Running test case: PausedCallFrameScope.TriggerSecondPause
Web Inspector: Wrong function name next to scope https://bugs.webkit.org/show_bug.cgi?id=158210 <rdar://problem/26543093> Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-06-30 Reviewed by Timothy Hatcher. Source/JavaScriptCore: * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: Add DebuggerLocation. A helper for describing a unique location. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::setConstantRegisters): When compiled with debug info, add a SymbolTable rare data pointer back to the CodeBlock. This will be used later to get JSScope debug info if Web Inspector pauses. * runtime/SymbolTable.h: * runtime/SymbolTable.cpp: (JSC::SymbolTable::cloneScopePart): (JSC::SymbolTable::prepareForTypeProfiling): (JSC::SymbolTable::uniqueIDForVariable): (JSC::SymbolTable::uniqueIDForOffset): (JSC::SymbolTable::globalTypeSetForOffset): (JSC::SymbolTable::globalTypeSetForVariable): Rename rareData and include a CodeBlock pointer. (JSC::SymbolTable::rareDataCodeBlock): (JSC::SymbolTable::setRareDataCodeBlock): Setter and getter for the rare data. It should only be set once. (JSC::SymbolTable::visitChildren): Visit the rare data code block if we have one. * runtime/JSSymbolTableObject.h: * runtime/JSSymbolTableObject.cpp: (JSC::JSSymbolTableObject::deleteProperty): (JSC::JSSymbolTableObject::getOwnNonIndexPropertyNames): Give JSSymbolTable its own class info. JSWithScope was unexpectedly inheriting from JSSymbolTable since it did not have its own and was using JSScope's class info. Also do a bit of cleanup. * debugger/DebuggerLocation.cpp: Added. (JSC::DebuggerLocation::DebuggerLocation): * debugger/DebuggerLocation.h: Added. (JSC::DebuggerLocation::DebuggerLocation): Construction from a ScriptExecutable. * runtime/JSScope.cpp: (JSC::JSScope::symbolTable): * runtime/JSScope.h: * debugger/DebuggerScope.h: * debugger/DebuggerScope.cpp: (JSC::DebuggerScope::name): (JSC::DebuggerScope::location): Name and location for a scope. This uses: JSScope -> SymbolTable -> CodeBlock -> Executable * inspector/protocol/Debugger.json: * inspector/InjectedScriptSource.js: (InjectedScript.CallFrameProxy.prototype._wrapScopeChain): (InjectedScript.CallFrameProxy._createScopeJson): * inspector/JSJavaScriptCallFrame.cpp: (Inspector::valueForScopeType): (Inspector::valueForScopeLocation): (Inspector::JSJavaScriptCallFrame::scopeDescriptions): (Inspector::JSJavaScriptCallFrame::scopeType): Deleted. * inspector/JSJavaScriptCallFrame.h: * inspector/JSJavaScriptCallFramePrototype.cpp: (Inspector::JSJavaScriptCallFramePrototype::finishCreation): (Inspector::jsJavaScriptCallFramePrototypeFunctionScopeDescriptions): (Inspector::jsJavaScriptCallFramePrototypeFunctionScopeType): Deleted. Simplify this code to build the objects we will send across the protocol to descript a Scope. Source/WebInspectorUI: * UserInterface/Controllers/DebuggerManager.js: (WebInspector.DebuggerManager.prototype._scopeChainNodeFromPayload): Include new payload data in the construction call. All the new data is optional, so we gracefully handle legacy backends. * UserInterface/Models/ScopeChainNode.js: (WebInspector.ScopeChainNode): (WebInspector.ScopeChainNode.prototype.get type): (WebInspector.ScopeChainNode.prototype.get objects): (WebInspector.ScopeChainNode.prototype.get name): (WebInspector.ScopeChainNode.prototype.get location): (WebInspector.ScopeChainNode.prototype.get hash): Hash is a rough (name:sourceId:line:column) string for quick comparisons. (WebInspector.ScopeChainNode.prototype.makeLocalScope): Make this an action you take on a scope, to avoid having to do it at construction time, or making it a generic setting. * UserInterface/Views/ScopeChainDetailsSidebarPanel.js: (WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateCallFramesSection): This was wrong before. Move the work to CallFrame and change it to be correct. * UserInterface/CallFrame.js: (WebInspector.CallFrame.prototype.mergedScopeChain): This transforms the scope chain for a call frame from: scope1 scope2 scope3 scope4 scope5 scope6 scope7 foo foo foo bar bar - - Block Closure Closure Closure Closure GLE GBL To: scope1 scope2&3 scope4&5 scope6 scope7 foo foo* bar* - - Block Local Closure GLE GBL Doing a few things: - Merge the first two Closure scopes sharing a location. These are the "var" and "let" Closure scopes in a function, and it is better to present these together in the UI. - Mark the first Closure scope within a function (*). When this is displayed in the UI, we can provide the name of the function: "Closure Scope (name)", and we even have location information that we can use to display a goto arrow if needed. - Make the first Closure scope the Local scope if it matches the Call Frame's function name. This lets us display the section as "Local Variables". LayoutTests: * inspector/debugger/paused-scopes-expected.txt: Added. * inspector/debugger/paused-scopes.html: Added. * inspector/debugger/resources/paused-scopes.js: Added. Test dumps the call frames and scope chains for each call frame when pausing at different locations in a program. Outputting the hashes we can see even identically named functions have different hashes because their location is different. * inspector/model/scope-chain-node.html: Make the test more stable on debug builds which run slower. Canonical link: https://commits.webkit.org/177450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202717 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-06-30 23:24:58 +00:00
CALLFRAME: secondPause
---- Scope Chain ----
SCOPE: Name (secondPause) - Type (Block) - Hash (secondPause:<sourceID>:6:21)
- blockLexicalVariable
SCOPE: Name (secondPause) - Type (Closure) - Hash (secondPause:<sourceID>:6:21)
- shoeLexicalVariable1
SCOPE: Name (secondPause) - Type (Closure) - Hash (secondPause:<sourceID>:6:21)
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
- globalLet2
SCOPE: Name () - Type (Global) - Hash ()
---- Merged Scope Chain ----
SCOPE: Name (secondPause) - Type (Block) - Hash (secondPause:<sourceID>:6:21)
- blockLexicalVariable
SCOPE: Name (secondPause) - Type (Local) - Hash (secondPause:<sourceID>:6:21)
- shoeLexicalVariable1
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
- globalLet2
SCOPE: Name () - Type (Global) - Hash ()
CALLFRAME: firstPause
---- Scope Chain ----
SCOPE: Name (firstPause) - Type (Block) - Hash (firstPause:<sourceID>:21:29)
- barLexicalVariable2
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:21:29)
- barLexicalVariable2
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:21:29)
- barVarVariable1
SCOPE: Name (firstPause) - Type (FunctionName) - Hash (firstPause:<sourceID>:21:29)
- firstPause
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
- fakeFirstPauseLexicalVariable
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
- fooLexicalVariable2
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
- firstPause
- fooVarVariable1
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
- globalLet2
SCOPE: Name () - Type (Global) - Hash ()
---- Merged Scope Chain ----
SCOPE: Name (firstPause) - Type (Block) - Hash (firstPause:<sourceID>:21:29)
- barLexicalVariable2
SCOPE: Name (firstPause) - Type (Local) - Hash (firstPause:<sourceID>:21:29)
- barVarVariable1
- barLexicalVariable2
SCOPE: Name (firstPause) - Type (FunctionName) - Hash (firstPause:<sourceID>:21:29)
- firstPause
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
- fakeFirstPauseLexicalVariable
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
- firstPause
- fooVarVariable1
- fooLexicalVariable2
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
- globalLet2
SCOPE: Name () - Type (Global) - Hash ()
CALLFRAME: firstPause
---- Scope Chain ----
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
- fakeFirstPauseLexicalVariable
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
- fooLexicalVariable2
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
- firstPause
- fooVarVariable1
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
- globalLet2
SCOPE: Name () - Type (Global) - Hash ()
---- Merged Scope Chain ----
SCOPE: Name (firstPause) - Type (Local) - Hash (firstPause:<sourceID>:19:24)
- fakeFirstPauseLexicalVariable
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
- firstPause
- fooVarVariable1
- fooLexicalVariable2
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
- globalLet2
SCOPE: Name () - Type (Global) - Hash ()
CALLFRAME: entry
---- Scope Chain ----
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
- fooLexicalVariable2
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
- firstPause
- fooVarVariable1
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
- globalLet2
SCOPE: Name () - Type (Global) - Hash ()
---- Merged Scope Chain ----
SCOPE: Name (entry) - Type (Local) - Hash (entry:<sourceID>:14:15)
- firstPause
- fooVarVariable1
- fooLexicalVariable2
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
- globalLet2
SCOPE: Name () - Type (Global) - Hash ()
-- Running test case: PausedCallFrameScope.TriggerThirdPause
CALLFRAME:
---- Scope Chain ----
SCOPE: Name () - Type (Closure) - Hash (:<sourceID>:36:14)
- localVariableInsideAnonymousFunction
SCOPE: Name () - Type (Closure) - Hash (:<sourceID>:36:14)
SCOPE: Name (thirdPause) - Type (Closure) - Hash (thirdPause:<sourceID>:34:20)
- closureVariableInsideThirdPause
SCOPE: Name (thirdPause) - Type (Closure) - Hash (thirdPause:<sourceID>:34:20)
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
- globalLet2
SCOPE: Name () - Type (Global) - Hash ()
---- Merged Scope Chain ----
SCOPE: Name () - Type (Local) - Hash (:<sourceID>:36:14)
- localVariableInsideAnonymousFunction
SCOPE: Name (thirdPause) - Type (Closure) - Hash (thirdPause:<sourceID>:34:20)
- closureVariableInsideThirdPause
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
- globalLet2
SCOPE: Name () - Type (Global) - Hash ()
CALLFRAME: thirdPause
---- Scope Chain ----
SCOPE: Name (thirdPause) - Type (Closure) - Hash (thirdPause:<sourceID>:34:20)
- closureVariableInsideThirdPause
SCOPE: Name (thirdPause) - Type (Closure) - Hash (thirdPause:<sourceID>:34:20)
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
- globalLet2
SCOPE: Name () - Type (Global) - Hash ()
---- Merged Scope Chain ----
SCOPE: Name (thirdPause) - Type (Local) - Hash (thirdPause:<sourceID>:34:20)
- closureVariableInsideThirdPause
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
- globalLet2
SCOPE: Name () - Type (Global) - Hash ()
CALLFRAME: firstPause
Web Inspector: Wrong function name next to scope https://bugs.webkit.org/show_bug.cgi?id=158210 <rdar://problem/26543093> Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-06-30 Reviewed by Timothy Hatcher. Source/JavaScriptCore: * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: Add DebuggerLocation. A helper for describing a unique location. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::setConstantRegisters): When compiled with debug info, add a SymbolTable rare data pointer back to the CodeBlock. This will be used later to get JSScope debug info if Web Inspector pauses. * runtime/SymbolTable.h: * runtime/SymbolTable.cpp: (JSC::SymbolTable::cloneScopePart): (JSC::SymbolTable::prepareForTypeProfiling): (JSC::SymbolTable::uniqueIDForVariable): (JSC::SymbolTable::uniqueIDForOffset): (JSC::SymbolTable::globalTypeSetForOffset): (JSC::SymbolTable::globalTypeSetForVariable): Rename rareData and include a CodeBlock pointer. (JSC::SymbolTable::rareDataCodeBlock): (JSC::SymbolTable::setRareDataCodeBlock): Setter and getter for the rare data. It should only be set once. (JSC::SymbolTable::visitChildren): Visit the rare data code block if we have one. * runtime/JSSymbolTableObject.h: * runtime/JSSymbolTableObject.cpp: (JSC::JSSymbolTableObject::deleteProperty): (JSC::JSSymbolTableObject::getOwnNonIndexPropertyNames): Give JSSymbolTable its own class info. JSWithScope was unexpectedly inheriting from JSSymbolTable since it did not have its own and was using JSScope's class info. Also do a bit of cleanup. * debugger/DebuggerLocation.cpp: Added. (JSC::DebuggerLocation::DebuggerLocation): * debugger/DebuggerLocation.h: Added. (JSC::DebuggerLocation::DebuggerLocation): Construction from a ScriptExecutable. * runtime/JSScope.cpp: (JSC::JSScope::symbolTable): * runtime/JSScope.h: * debugger/DebuggerScope.h: * debugger/DebuggerScope.cpp: (JSC::DebuggerScope::name): (JSC::DebuggerScope::location): Name and location for a scope. This uses: JSScope -> SymbolTable -> CodeBlock -> Executable * inspector/protocol/Debugger.json: * inspector/InjectedScriptSource.js: (InjectedScript.CallFrameProxy.prototype._wrapScopeChain): (InjectedScript.CallFrameProxy._createScopeJson): * inspector/JSJavaScriptCallFrame.cpp: (Inspector::valueForScopeType): (Inspector::valueForScopeLocation): (Inspector::JSJavaScriptCallFrame::scopeDescriptions): (Inspector::JSJavaScriptCallFrame::scopeType): Deleted. * inspector/JSJavaScriptCallFrame.h: * inspector/JSJavaScriptCallFramePrototype.cpp: (Inspector::JSJavaScriptCallFramePrototype::finishCreation): (Inspector::jsJavaScriptCallFramePrototypeFunctionScopeDescriptions): (Inspector::jsJavaScriptCallFramePrototypeFunctionScopeType): Deleted. Simplify this code to build the objects we will send across the protocol to descript a Scope. Source/WebInspectorUI: * UserInterface/Controllers/DebuggerManager.js: (WebInspector.DebuggerManager.prototype._scopeChainNodeFromPayload): Include new payload data in the construction call. All the new data is optional, so we gracefully handle legacy backends. * UserInterface/Models/ScopeChainNode.js: (WebInspector.ScopeChainNode): (WebInspector.ScopeChainNode.prototype.get type): (WebInspector.ScopeChainNode.prototype.get objects): (WebInspector.ScopeChainNode.prototype.get name): (WebInspector.ScopeChainNode.prototype.get location): (WebInspector.ScopeChainNode.prototype.get hash): Hash is a rough (name:sourceId:line:column) string for quick comparisons. (WebInspector.ScopeChainNode.prototype.makeLocalScope): Make this an action you take on a scope, to avoid having to do it at construction time, or making it a generic setting. * UserInterface/Views/ScopeChainDetailsSidebarPanel.js: (WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateCallFramesSection): This was wrong before. Move the work to CallFrame and change it to be correct. * UserInterface/CallFrame.js: (WebInspector.CallFrame.prototype.mergedScopeChain): This transforms the scope chain for a call frame from: scope1 scope2 scope3 scope4 scope5 scope6 scope7 foo foo foo bar bar - - Block Closure Closure Closure Closure GLE GBL To: scope1 scope2&3 scope4&5 scope6 scope7 foo foo* bar* - - Block Local Closure GLE GBL Doing a few things: - Merge the first two Closure scopes sharing a location. These are the "var" and "let" Closure scopes in a function, and it is better to present these together in the UI. - Mark the first Closure scope within a function (*). When this is displayed in the UI, we can provide the name of the function: "Closure Scope (name)", and we even have location information that we can use to display a goto arrow if needed. - Make the first Closure scope the Local scope if it matches the Call Frame's function name. This lets us display the section as "Local Variables". LayoutTests: * inspector/debugger/paused-scopes-expected.txt: Added. * inspector/debugger/paused-scopes.html: Added. * inspector/debugger/resources/paused-scopes.js: Added. Test dumps the call frames and scope chains for each call frame when pausing at different locations in a program. Outputting the hashes we can see even identically named functions have different hashes because their location is different. * inspector/model/scope-chain-node.html: Make the test more stable on debug builds which run slower. Canonical link: https://commits.webkit.org/177450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202717 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-06-30 23:24:58 +00:00
---- Scope Chain ----
SCOPE: Name (firstPause) - Type (Block) - Hash (firstPause:<sourceID>:21:29)
- barLexicalVariable2
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:21:29)
- barLexicalVariable2
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:21:29)
- barVarVariable1
SCOPE: Name (firstPause) - Type (FunctionName) - Hash (firstPause:<sourceID>:21:29)
- firstPause
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
- fakeFirstPauseLexicalVariable
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
- fooLexicalVariable2
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
- firstPause
- fooVarVariable1
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
- globalLet2
SCOPE: Name () - Type (Global) - Hash ()
---- Merged Scope Chain ----
SCOPE: Name (firstPause) - Type (Block) - Hash (firstPause:<sourceID>:21:29)
- barLexicalVariable2
SCOPE: Name (firstPause) - Type (Local) - Hash (firstPause:<sourceID>:21:29)
- barVarVariable1
- barLexicalVariable2
SCOPE: Name (firstPause) - Type (FunctionName) - Hash (firstPause:<sourceID>:21:29)
- firstPause
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
- fakeFirstPauseLexicalVariable
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
- firstPause
- fooVarVariable1
- fooLexicalVariable2
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
- globalLet2
SCOPE: Name () - Type (Global) - Hash ()
CALLFRAME: firstPause
---- Scope Chain ----
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
- fakeFirstPauseLexicalVariable
SCOPE: Name (firstPause) - Type (Closure) - Hash (firstPause:<sourceID>:19:24)
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
- fooLexicalVariable2
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
- firstPause
- fooVarVariable1
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
- globalLet2
SCOPE: Name () - Type (Global) - Hash ()
---- Merged Scope Chain ----
SCOPE: Name (firstPause) - Type (Local) - Hash (firstPause:<sourceID>:19:24)
- fakeFirstPauseLexicalVariable
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
- firstPause
- fooVarVariable1
- fooLexicalVariable2
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
- globalLet2
SCOPE: Name () - Type (Global) - Hash ()
CALLFRAME: entry
---- Scope Chain ----
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
- fooLexicalVariable2
SCOPE: Name (entry) - Type (Closure) - Hash (entry:<sourceID>:14:15)
- firstPause
- fooVarVariable1
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
- globalLet2
SCOPE: Name () - Type (Global) - Hash ()
---- Merged Scope Chain ----
SCOPE: Name (entry) - Type (Local) - Hash (entry:<sourceID>:14:15)
- firstPause
- fooVarVariable1
- fooLexicalVariable2
SCOPE: Name () - Type (GlobalLexicalEnvironment) - Hash ()
- globalLet2
SCOPE: Name () - Type (Global) - Hash ()
Web Inspector: DebuggerManager.Event.Resumed introduces test flakiness https://bugs.webkit.org/show_bug.cgi?id=161951 <rdar://problem/28295767> Reviewed by Brian Burg. Source/JavaScriptCore: This removes an ambiguity in the protocol when stepping through JavaScript. Previously, when paused and issuing a Debugger.step* command the frontend would always receive a Debugger.resumed event and then, maybe, a Debugger.paused event indicating we paused again (after stepping). However, this ambiguity means that the frontend needs to wait for a short period of time to determine if we really resumed or not. And even still that decision may be incorrect if the step takes a sufficiently long period of time. The new approach removes this ambiguity. Now, in response to a Debugger.step* command the backend MUST send a single Debugger.paused event or Debugger.resumed event. Now the frontend knows that the next Debugger event it receives after issuing the step command is the result (stepped and paused, or stepped and resumed). To make resuming consistent in all cases, a Debugger.resume command will always respond with a Debugger.resumed event. Finally, Debugger.continueToLocation is treated like a "big step" in cases where we can resolve the location. If we can't resolve the location it is treated as a resume, maintaining the old behavior. * inspector/agents/InspectorDebuggerAgent.h: * inspector/agents/InspectorDebuggerAgent.cpp: (Inspector::InspectorDebuggerAgent::stepOver): (Inspector::InspectorDebuggerAgent::stepInto): (Inspector::InspectorDebuggerAgent::stepOut): (Inspector::InspectorDebuggerAgent::willStepAndMayBecomeIdle): (Inspector::InspectorDebuggerAgent::didBecomeIdleAfterStepping): When stepping register a VM exit observer so that we can issue a Debugger.resumed event if the step caused us to exit the VM. (Inspector::InspectorDebuggerAgent::resume): Set a flag to issue a Debugger.resumed event once we break out of the nested run loop. (Inspector::InspectorDebuggerAgent::didPause): We are issuing Debugger.paused so clear the state to indicate that we no longer need to issue Debugger.resumed event, we have paused. (Inspector::InspectorDebuggerAgent::didContinue): Only issue the Debugger.resumed event if needed (explicitly asked to resume). (Inspector::InspectorDebuggerAgent::continueToLocation): (Inspector::InspectorDebuggerAgent::clearDebuggerBreakpointState): All places that do continueProgram should be audited. In error cases, if we are paused and continue we should remember to send Debugger.resumed. * inspector/protocol/Debugger.json: Clarify in the protocol description the contract of these methods. Source/WebCore: Covered by existing tests that would ASSERT otherwise. * inspector/InspectorClient.cpp: (WebCore::InspectorClient::doDispatchMessageOnFrontendPage): When paused on an exception in the inspected page and evaluating commands in the inspector frontend page (which evaluates JavaScript) we ASSERT when entering the Global DOM VM with an existing exception. This makes it so when we evaluate JavaScript in the frontend we suspend / ignore the state of the VM for the inspected page, and restore it when we return from the inspector. Source/WebInspectorUI: * UserInterface/Controllers/DebuggerManager.js: (WebInspector.DebuggerManager.prototype.debuggerDidResume): Now, Debugger.resumed events really mean the debugger resumed, so act immediately instead of guessing. We must still guess in legacy backends. * UserInterface/Test/Test.js: When the inspector frontend encounters an issue, log it. * UserInterface/Views/DebuggerSidebarPanel.js: (WebInspector.DebuggerSidebarPanel.prototype._debuggerDidPause): (WebInspector.DebuggerSidebarPanel.prototype._debuggerActiveCallFrameDidChange): Always enable the step out button. I don't think it makes sense to disable it sometimes, and if there are issues with this we should solve the issues instead of hiding them. LayoutTests: Rewrite tests to be more deterministic. For tests that relied on a Resumed event to happen after a short amount of time, instead have the test dispatch an event when it is appropriate to continue. Take this opportunity to rewrite some tests using new style and best practices. * inspector/debugger/break-in-constructor-before-super.html: * inspector/debugger/break-on-exception-throw-in-promise.html: * inspector/debugger/break-on-exception.html: * inspector/debugger/break-on-uncaught-exception-throw-in-promise.html: * inspector/debugger/break-on-uncaught-exception.html: * inspector/debugger/breakpoint-syntax-error-top-level.html: * inspector/debugger/command-line-api-exception-expected.txt: * inspector/debugger/command-line-api-exception-nested-catch.html: * inspector/debugger/command-line-api-exception.html: * inspector/debugger/csp-exceptions.html: * inspector/debugger/didSampleProbe-multiple-probes.html: * inspector/debugger/evaluateOnCallFrame-CommandLineAPI.html: * inspector/debugger/evaluateOnCallFrame-errors.html: * inspector/debugger/pause-reason-expected.txt: * inspector/debugger/pause-reason.html: * inspector/debugger/paused-scopes-expected.txt: * inspector/debugger/paused-scopes.html: * inspector/debugger/resources/exceptions.js: * inspector/debugger/scriptParsed.html: * inspector/debugger/sourceURL-repeated-identical-executions.html: * inspector/debugger/sourceURLs.html: * inspector/debugger/stepping/stepping-pause-in-inner-step-to-parent.html: Canonical link: https://commits.webkit.org/182248@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208523 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-11-10 06:07:07 +00:00
-- Running test case: PausedCallFrameScope.Complete