<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>164848</bug_id>
          
          <creation_ts>2016-11-16 17:49:35 -0800</creation_ts>
          <short_desc>Web Inspector: console messages should include async stack trace if available</short_desc>
          <delta_ts>2019-02-14 14:52:13 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>163230</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Matt Baker">mattbaker</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>hi</cc>
    
    <cc>inspector-bugzilla-changes</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1252146</commentid>
    <comment_count>0</comment_count>
    <who name="Matt Baker">mattbaker</who>
    <bug_when>2016-11-16 17:49:35 -0800</bug_when>
    <thetext>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});
    ...
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1252149</commentid>
    <comment_count>1</comment_count>
    <who name="Matt Baker">mattbaker</who>
    <bug_when>2016-11-16 17:50:40 -0800</bug_when>
    <thetext>or rather:

let stackTracePayload = stackTrace.callFrames ? stackTrace : {callFrames: stackTrace};
WebInspector.StackTrace.fromPayload(target, stackTracePayload);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1252150</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2016-11-16 17:54:31 -0800</bug_when>
    <thetext>&lt;rdar://problem/29301189&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1506388</commentid>
    <comment_count>3</comment_count>
    <who name="Devin Rousso">hi</who>
    <bug_when>2019-02-14 14:52:13 -0800</bug_when>
    <thetext>The frontend part sounds &quot;easy&quot;, but how about the backend part?  I think this would be SUPER awesome 😁, especially for protocol tracing.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>