Bug 164848 - Web Inspector: console messages should include async stack trace if available
Summary: Web Inspector: console messages should include async stack trace if available
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on: 163230
Blocks:
  Show dependency treegraph
 
Reported: 2016-11-16 17:49 PST by Matt Baker
Modified: 2019-02-14 14:52 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Baker 2016-11-16 17:49:35 PST
Summary:
Console messages should include async stack trace if available. When console.trace, console.error, etc, are called from an asynchronous callback the call stack shown the console should include async frames in addition to the standard call frames.

Note:
Inspector::Protocol::Console::ConsoleMessage already has a stackTrace property, which is currently an array of Console::CallFrame. This can be replaced with Console::StackTrace, and a simple check added to LogManager in the frontend:

messageWasAdded(target, source, level, text, type, url, line, column, repeatCount, parameters, stackTrace, requestId)
{
    // Called from WebInspector.ConsoleObserver.

    stackTrace = stackTrace.callFrames ? stackTrace : WebInspector.StackTrace.fromPayload(target, {callFrames: stackTrace});
    ...
}
Comment 1 Matt Baker 2016-11-16 17:50:40 PST
or rather:

let stackTracePayload = stackTrace.callFrames ? stackTrace : {callFrames: stackTrace};
WebInspector.StackTrace.fromPayload(target, stackTracePayload);
Comment 2 Radar WebKit Bug Importer 2016-11-16 17:54:31 PST
<rdar://problem/29301189>
Comment 3 Devin Rousso 2019-02-14 14:52:13 PST
The frontend part sounds "easy", but how about the backend part?  I think this would be SUPER awesome 😁, especially for protocol tracing.