Changeset 43774 in webkit


Ignore:
Timestamp:
May 15, 2009 11:13:28 AM (15 years ago)
Author:
Adam Roben
Message:

2009-05-15 Francisco Tolmasky <francisco@280north.com>

BUG 25467: JavaScript debugger should use function.displayName as the function's name in the call stack
<https://bugs.webkit.org/show_bug.cgi?id=25467>

Reviewed by Adam Roben.

JavaScriptCore:

  • JavaScriptCore.exp: Added calculatedFunctionName
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Added calculatedFunctionName
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Added calculatedFunctionName
  • debugger/DebuggerCallFrame.cpp: Added calculatedFunctionName to match existing one in ProfileNode. (JSC::DebuggerCallFrame::calculatedFunctionName):
  • debugger/DebuggerCallFrame.h: Added calculatedFunctionName to match existing one in ProfileNode.

WebCore:

  • inspector/JavaScriptCallFrame.cpp: (WebCore::JavaScriptCallFrame::functionName): Use calculatedFunctionName which takes into account displayName
inspector/front-end/CallStackSidebarPane.js: Remove "
anonymous function" since it is handled internally just like in profiles

(WebInspector.CallStackSidebarPane.prototype.update):

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r43751 r43774  
     12009-05-15  Francisco Tolmasky  <francisco@280north.com>
     2
     3        BUG 25467: JavaScript debugger should use function.displayName as the function's name in the call stack
     4        <https://bugs.webkit.org/show_bug.cgi?id=25467>
     5       
     6        Reviewed by Adam Roben.
     7
     8        * JavaScriptCore.exp: Added calculatedFunctionName
     9        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Added calculatedFunctionName
     10        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Added calculatedFunctionName
     11        * debugger/DebuggerCallFrame.cpp: Added calculatedFunctionName to match existing one in ProfileNode.
     12        (JSC::DebuggerCallFrame::calculatedFunctionName):
     13        * debugger/DebuggerCallFrame.h: Added calculatedFunctionName to match existing one in ProfileNode.
     14
    1152009-05-14  Gavin Barraclough  <barraclough@apple.com>
    216
  • trunk/JavaScriptCore/JavaScriptCore.exp

    r43663 r43774  
    330330__ZNK3JSC17DebuggerCallFrame10thisObjectEv
    331331__ZNK3JSC17DebuggerCallFrame12functionNameEv
     332__ZNK3JSC17DebuggerCallFrame22calculatedFunctionNameEv
    332333__ZNK3JSC17DebuggerCallFrame4typeEv
    333334__ZNK3JSC17DebuggerCallFrame8evaluateERKNS_7UStringERNS_7JSValueE
  • trunk/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def

    r43663 r43774  
    4848    ?attach@Debugger@JSC@@QAEXPAVJSGlobalObject@2@@Z
    4949    ?broadcast@ThreadCondition@WTF@@QAEXXZ
     50    ?calculatedFunctionName@DebuggerCallFrame@JSC@@QBE?AVUString@2@XZ
    5051    ?call@JSC@@YA?AVJSValue@1@PAVExecState@1@V21@W4CallType@1@ABTCallData@1@1ABVArgList@1@@Z
    5152    ?callOnMainThread@WTF@@YAXP6AXPAX@Z0@Z
  • trunk/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def

    r43663 r43774  
    4848    ?attach@Debugger@JSC@@QAEXPAVJSGlobalObject@2@@Z
    4949    ?broadcast@ThreadCondition@WTF@@QAEXXZ
     50    ?calculatedFunctionName@DebuggerCallFrame@JSC@@QBE?AVUString@2@XZ
    5051    ?call@JSC@@YA?AVJSValue@1@PAVExecState@1@V21@W4CallType@1@ABTCallData@1@1ABVArgList@1@@Z
    5152    ?callOnMainThread@WTF@@YAXP6AXPAX@Z0@Z
  • trunk/JavaScriptCore/debugger/DebuggerCallFrame.cpp

    r43153 r43774  
    4747    return &function->name(&m_callFrame->globalData());
    4848}
     49   
     50UString DebuggerCallFrame::calculatedFunctionName() const
     51{
     52    if (!m_callFrame->codeBlock())
     53        return 0;
     54   
     55    JSFunction* function = static_cast<JSFunction*>(m_callFrame->callee());
     56    if (!function)
     57        return 0;
     58    return function->calculatedDisplayName(&m_callFrame->globalData());
     59}
    4960
    5061DebuggerCallFrame::Type DebuggerCallFrame::type() const
  • trunk/JavaScriptCore/debugger/DebuggerCallFrame.h

    r43153 r43774  
    5252        const ScopeChainNode* scopeChain() const { return m_callFrame->scopeChain(); }
    5353        const UString* functionName() const;
     54        UString calculatedFunctionName() const;
    5455        Type type() const;
    5556        JSObject* thisObject() const;
  • trunk/WebCore/ChangeLog

    r43770 r43774  
     12009-05-15  Francisco Tolmasky  <francisco@280north.com>
     2
     3        BUG 25467: JavaScript debugger should use function.displayName as the function's name in the call stack
     4        <https://bugs.webkit.org/show_bug.cgi?id=25467>
     5       
     6        Reviewed by Adam Roben.
     7
     8        * inspector/JavaScriptCallFrame.cpp:
     9        (WebCore::JavaScriptCallFrame::functionName): Use calculatedFunctionName which takes into account displayName
     10        * inspector/front-end/CallStackSidebarPane.js: Remove "|| anonymous function" since it is handled internally just like in profiles
     11        (WebInspector.CallStackSidebarPane.prototype.update):
     12
    1132009-05-15  Alexey Proskuryakov  <ap@webkit.org>
    214
  • trunk/WebCore/inspector/JavaScriptCallFrame.cpp

    r43761 r43774  
    4040
    4141namespace WebCore {
    42 
     42   
    4343JavaScriptCallFrame::JavaScriptCallFrame(const DebuggerCallFrame& debuggerCallFrame, PassRefPtr<JavaScriptCallFrame> caller, intptr_t sourceID, int line)
    4444    : m_debuggerCallFrame(debuggerCallFrame)
     
    6868    if (!m_isValid)
    6969        return String();
    70     const UString* functionName = m_debuggerCallFrame.functionName();
    71     if (!functionName)
     70    UString functionName = m_debuggerCallFrame.calculatedFunctionName();
     71    if (functionName.isEmpty())
    7272        return String();
    73     return *functionName;
     73    return functionName;
    7474}
    7575
Note: See TracChangeset for help on using the changeset viewer.