Bug 80384 - Web Inspector: show corresponding call stack at function/timer creation
Summary: Web Inspector: show corresponding call stack at function/timer creation
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2012-03-05 23:21 PST by Yehuda Katz
Modified: 2014-01-26 16:27 PST (History)
17 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yehuda Katz 2012-03-05 23:21:15 PST
In browser code, it's common to create a function that will be invoked asynchronously later. Two common cases are the function passed to setTimeout and Ajax callbacks.

In these cases, it can often be convenient to be able to see the original stack trace from when the function was originally created, in addition to when it was invoked.

I would like to propose that it be possible to attach "the current call stack" to a function before it is invoked, and that when debugging code downstream from the function's invocation, that the original stack be available (probably with some kind of divider between the current stack and original stack).

I would ideally like to be able to jump back to the original stack and observe the state at that time (i.e. normal stack debugging), but if that was impossible or too difficult, just showing me the code context would be extremely helpful.

Straw man proposal:

    fn = function() { debugger; }
    fn.debugCurrentCallsite();
    setTimeout(fn, 1000);
Comment 1 Rafael Weinstein 2012-05-17 15:51:03 PDT
Any feelings about this feature request?

Yehuda represents a large portion of developer mind share. We really want this kind of feedback. I think it'd go a long way, even just to entertain the idea and communicate something about likely implementation complexity and relative priority given other work, as a first step.
Comment 2 Rafael Weinstein 2012-05-17 15:51:20 PDT
Any feelings about this feature request?

Yehuda represents a large portion of developer mind share. We really want this kind of feedback. I think it'd go a long way, even just to entertain the idea and communicate something about likely implementation complexity and relative priority given other work, as a first step.
Comment 3 Radar WebKit Bug Importer 2014-01-26 10:32:05 PST
<rdar://problem/15911060>
Comment 4 Timothy Hatcher 2014-01-26 16:27:05 PST
We do this in TOT and Safari 7 / 6.1.