Bug 104849 - Web Inspector: Don't throw exceptions when we don't have a callstack
Summary: Web Inspector: Don't throw exceptions when we don't have a callstack
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-12 15:01 PST by johnjbarton
Modified: 2013-01-09 23:07 PST (History)
9 users (show)

See Also:


Attachments
Patch (1.85 KB, patch)
2012-12-12 15:07 PST, johnjbarton
no flags Details | Formatted Diff | Diff
Patch (1.88 KB, patch)
2012-12-17 12:51 PST, johnjbarton
no flags Details | Formatted Diff | Diff
Patch (1.88 KB, patch)
2012-12-20 11:04 PST, johnjbarton
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description johnjbarton 2012-12-12 15:01:28 PST
If WebInspector.debuggerModel.debuggerPausedDetails() gives details.reason === 'other', then we try to execute
  details.callFrames[0].createLiveLocation(didGetUILocation.bind(this));
but if callFrames.length === 0 we fail.

I suspect that the 'other' is related to liveEdit.
Comment 1 johnjbarton 2012-12-12 15:07:21 PST
Created attachment 179132 [details]
Patch
Comment 2 Pavel Feldman 2012-12-14 00:07:10 PST
Comment on attachment 179132 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=179132&action=review

> Source/WebCore/inspector/front-end/ScriptsPanel.js:307
> +            if (details.callFrames.length) 

Out of curiosity: have you seen this happening? We expect at least one call frame at all times. Could be related to live editing?

> Source/WebCore/inspector/front-end/ScriptsPanel.js:310
> +                this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused, reason unknown."));

I don't think we need this line since we will anyways see the problem due to no call frames.
Comment 3 johnjbarton 2012-12-14 08:53:56 PST
(In reply to comment #2)
> (From update of attachment 179132 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=179132&action=review
> 
> > Source/WebCore/inspector/front-end/ScriptsPanel.js:307
> > +            if (details.callFrames.length) 
> 
> Out of curiosity: have you seen this happening? 

Yes, I found this by having break-on-exceptions set on devtools-on-devtools.

> We expect at least one call frame at all times. Could be related to live editing?

I'm pretty sure the case I hit was live edit.


> 
> > Source/WebCore/inspector/front-end/ScriptsPanel.js:310
> > +                this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused, reason unknown."));
> 
> I don't think we need this line since we will anyways see the problem due to no call frames.

But as you say above the no-call-frames case is unexpected. So this message is really intended for us, so we can be alert for the no-call-frame case and learn about it.

However, I cannot find the output from setStatus() in the UI anyway.
Comment 4 johnjbarton 2012-12-17 12:51:24 PST
Created attachment 179784 [details]
Patch
Comment 5 johnjbarton 2012-12-20 11:04:52 PST
Created attachment 180372 [details]
Patch
Comment 6 johnjbarton 2013-01-04 14:00:02 PST
(In reply to comment #2)
> (From update of attachment 179132 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=179132&action=review
> 
> > Source/WebCore/inspector/front-end/ScriptsPanel.js:307
> > +            if (details.callFrames.length) 
> 
> Out of curiosity: have you seen this happening? We expect at least one call frame at all times. Could be related to live editing?

I hit this without doing live editing today.  In this case I had devtools running on devtools so this one may be related to the known incorrect behavior of js debugging in this set up.
Comment 7 johnjbarton 2013-01-09 10:49:14 PST
Can we push this to commit-queue?
Comment 8 WebKit Review Bot 2013-01-09 23:07:03 PST
Comment on attachment 180372 [details]
Patch

Clearing flags on attachment: 180372

Committed r139285: <http://trac.webkit.org/changeset/139285>
Comment 9 WebKit Review Bot 2013-01-09 23:07:08 PST
All reviewed patches have been landed.  Closing bug.