[Webkit-unassigned] [Bug 37502] Web Inspector: Removes public callLocation API from ScriptCallStack and replaces with ability to get top 10 stack frames

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 13 22:41:44 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=37502





--- Comment #3 from Ilya Tikhonovsky <loislo at chromium.org>  2010-04-13 22:41:44 PST ---
> Index: WebCore/ChangeLog
> +
> +String* InspectorTimelineAgent::getCurrentStackTrace()
> +{
> +    if (m_currentStackTrace.isEmpty()) {       
> +        m_hasStackTrace = ScriptCallStack::stackTrace(&m_currentStackTrace);
> +        // So that we don't attempt to regrab a strack trace when there is none to grab.
> +        if (!m_hasStackTrace)
> +            m_currentStackTrace = "NotEmpty";
> +    }
> +    if (m_hasStackTrace)
> +        return &m_currentStackTrace;
> +    else
> +        return 0;
> +}
> +
> +void InspectorTimelineAgent::invalidateStackTrace() {
> +    m_currentStackTrace = "";
> +    m_hasStackTrace = false;
> +}

We can have a bit complex situation as example with two listeners (an event
with two nested callFunction events will be generated).
If the first one generate an install timer event then for the second
willCallFunction event we assign the call stack of install timer event.

I think it might be interesting to cache call stack in the parent event record
but I'm not sure that we will have no problem.


> @@ -811,8 +812,11 @@ WebInspector.TimelinePanel.FormattedReco
>      } else if (record.type === recordTypes.TimerFire) {
>          var timerInstalledRecord = timerRecords[record.data.timerId];
>          if (timerInstalledRecord) {
> -            this.callSiteScriptName = timerInstalledRecord.callerScriptName;
> -            this.callSiteScriptLine = timerInstalledRecord.callerScriptLine;
> +            var stackTrace = timerInstalledRecord.stackTrace;
> +            if (stackTrace && stackTrace[0]) {
> +                this.callSiteScriptName = stackTrace[0].scriptName;
> +                this.callSiteScriptLine = stackTrace[0].scriptLine + 1;                
> +            }


We can't use +1 for scriptLine here because JSC numbers are starting from 1. It
should be done in V8 specific code.



> @@ -918,8 +922,10 @@ WebInspector.TimelinePanel.FormattedReco
>                  recordContentTable.appendChild(this._createRow(WebInspector.UIString("Details"), this.details));
>          }
>  
> -        if (this.type !== recordTypes.GCEvent && this.callerScriptName) {
> -            var link = WebInspector.linkifyResourceAsNode(this.callerScriptName, "scripts", this.callerScriptLine);
> +        if (this.type !== recordTypes.GCEvent && this.stackTrace) {
> +            var callerScriptName = this.stackTrace[0] ? this.stackTrace[0].scriptName : "";
> +            var callerScriptLine = this.stackTrace[0] ? this.stackTrace[0].scriptLine + 1 : 0;


Ditto.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list