RefPtr<Inspector::Protocol::Debugger::Location> InspectorDebuggerAgent::resolveBreakpoint(const String& breakpointIdentifier, JSC::SourceID sourceID, const ScriptBreakpoint& breakpoint) { ScriptsMap::iterator scriptIterator = m_scripts.find(sourceID); if (scriptIterator == m_scripts.end()) return nullptr; Script& script = scriptIterator->value; if (breakpoint.lineNumber < script.startLine || script.endLine < breakpoint.lineNumber) return nullptr; unsigned actualLineNumber; unsigned actualColumnNumber; JSC::BreakpointID debugServerBreakpointID = scriptDebugServer().setBreakpoint(sourceID, breakpoint, &actualLineNumber, &actualColumnNumber); if (debugServerBreakpointID == JSC::noBreakpointID) return nullptr; BreakpointIdentifierToDebugServerBreakpointIDsMap::iterator debugServerBreakpointIDsIterator = m_breakpointIdentifierToDebugServerBreakpointIDs.find(breakpointIdentifier); if (debugServerBreakpointIDsIterator == m_breakpointIdentifierToDebugServerBreakpointIDs.end()) debugServerBreakpointIDsIterator = m_breakpointIdentifierToDebugServerBreakpointIDs.set(breakpointIdentifier, Vector<JSC::BreakpointID>()).iterator; debugServerBreakpointIDsIterator->value.append(debugServerBreakpointID); m_debuggerBreakpointIdentifierToInspectorBreakpointIdentifier.set(debugServerBreakpointID, breakpointIdentifier); auto location = Inspector::Protocol::Debugger::Location::create() .setScriptId(String::number(sourceID)) .setLineNumber(actualLineNumber) .release(); location->setColumnNumber(actualColumnNumber); return WTF::move(location); }
static Ref<Protocol::Timeline::CPUProfileNode> buildInspectorObject(const JSC::ProfileNode* node) { auto result = Protocol::Timeline::CPUProfileNode::create() .setId(node->id()) .setCallInfo(buildAggregateCallInfoInspectorObject(node)) .release(); if (!node->functionName().isEmpty()) result->setFunctionName(node->functionName()); if (!node->url().isEmpty()) { result->setUrl(node->url()); result->setLineNumber(node->lineNumber()); result->setColumnNumber(node->columnNumber()); } if (!node->children().isEmpty()) { auto children = Protocol::Array<Protocol::Timeline::CPUProfileNode>::create(); for (RefPtr<JSC::ProfileNode> profileNode : node->children()) children->addItem(buildInspectorObject(profileNode.get())); result->setChildren(WTFMove(children)); } return result; }
/*** Constructor ***/ Node::Node(unsigned int pLineNum, unsigned int pColNum) { setLineNumber(pLineNum); setColumnNumber(pColNum); }
/*** Constructor ***/ Node::Node() { setLineNumber(0); setColumnNumber(0); }