Bug 19157 - Inspector should support console.trace
Summary: Inspector should support console.trace
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Enhancement
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 14354
  Show dependency treegraph
 
Reported: 2008-05-20 16:16 PDT by Adam Roben (:aroben)
Modified: 2008-09-27 15:18 PDT (History)
1 user (show)

See Also:


Attachments
Screenshot (124.10 KB, image/png)
2008-09-25 23:46 PDT, Keishi Hattori
no flags Details
patch (8.58 KB, patch)
2008-09-26 00:02 PDT, Keishi Hattori
no flags Details | Formatted Diff | Diff
patch (8.59 KB, patch)
2008-09-26 02:19 PDT, Keishi Hattori
kmccullough: review-
Details | Formatted Diff | Diff
fixed patch (8.54 KB, patch)
2008-09-26 17:07 PDT, Keishi Hattori
timothy: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Roben (:aroben) 2008-05-20 16:16:08 PDT
The Inspector should support console.trace for Firebug parity.
Comment 1 Mark Rowe (bdash) 2008-05-20 16:23:07 PDT
<rdar://problem/5950861>
Comment 2 Keishi Hattori 2008-08-15 01:04:37 PDT
I read CallStackSidebarPane.js but it looks like you can't get the CallFrame unless the debugger is enabled and paused.
>JavaScriptCallFrame* JavaScriptDebugServer::currentCallFrame()
>{
>    if (!m_paused)
>        return 0;
>    return m_currentCallFrame.get();
>}

My initial thought was I could do it using arguments.callee.caller but I think ArgList doesn't have the callee info.
Comment 3 Keishi Hattori 2008-09-25 23:46:40 PDT
Created attachment 23840 [details]
Screenshot
Comment 4 Keishi Hattori 2008-09-26 00:02:38 PDT
Created attachment 23841 [details]
patch

I'm not sure if it's ok but I called Machine::retrieveCaller recursively to get a stack trace. Seems to be working.
Comment 5 Eric Seidel (no email) 2008-09-26 01:37:55 PDT
Comment on attachment 23841 [details]
patch

Why does trace() need to be custom?  [Custom] void trace();  because it passes along the exec state?
Comment 6 Keishi Hattori 2008-09-26 02:19:50 PDT
Created attachment 23843 [details]
patch

Just replaced a tab.
Comment 7 Keishi Hattori 2008-09-26 02:21:47 PDT
That was my thinking when I did that. It doesn't compile when I don't do that.

(In reply to comment #5)
> (From update of attachment 23841 [details] [edit])
> Why does trace() need to be custom?  [Custom] void trace();  because it passes
> along the exec state?
> 

Comment 8 Kevin McCullough 2008-09-26 14:36:35 PDT
Comment on attachment 23843 [details]
patch

JSConsole::trace doesn't use the "arguments" argument.  Either remove the name or the argument altogether.

In Console::trace use this->page() instead of checking the m_frame, we made a helper to do this easier.

Also please file a bug that says we should include and name (program) and (eval) nodes.

Also please edit 19229 to also give better names than (anonymous function) when possible.
Comment 9 Keishi Hattori 2008-09-26 17:07:55 PDT
Created attachment 23862 [details]
fixed patch

I couldn't remove the argument so I just removed the name.
Comment 10 Keishi Hattori 2008-09-26 17:11:45 PDT
I file a bug https://bugs.webkit.org/show_bug.cgi?id=21157

(In reply to comment #8)
> Also please file a bug that says we should include and name (program) and
> (eval) nodes.
Comment 11 Timothy Hatcher 2008-09-27 15:18:58 PDT
Landed in r37012.