⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 173550 in webkit


Ignore:
Timestamp:
Sep 11, 2014, 6:04:05 PM (12 years ago)
Author:
msaboff@apple.com
Message:

lldb_webkit.py:btjs doesn't work with release builds
​https://bugs.webkit.org/show_bug.cgi?id=136760

Reviewed by Jer Noble.

If we can't get a result calling JSC::ExecState::describeFrame(), try calling the
mangled name _ZN3JSC9ExecState13describeFrameEv. Also cleaned up the handling if
we can't get a valid result from trying either call. In that case, we fallback to
just showing the PC. Also added check for both entry points. If neither is found,
we issue a warning and output the stack trace without JavaScript annotations.

  • lldb/lldb_webkit.py:

(btjs):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r173535 r173550  
     12014-09-11  Michael Saboff  <msaboff@apple.com>
     2
     3        lldb_webkit.py:btjs doesn't work with release builds
     4        https://bugs.webkit.org/show_bug.cgi?id=136760
     5
     6        Reviewed by Jer Noble.
     7
     8        If we can't get a result calling JSC::ExecState::describeFrame(), try calling the
     9        mangled name _ZN3JSC9ExecState13describeFrameEv.  Also cleaned up the handling if
     10        we can't get a valid result from trying either call.  In that case, we fallback to
     11        just showing the PC.  Also added check for both entry points.  If neither is found,
     12        we issue a warning and output the stack trace without JavaScript annotations.
     13
     14        * lldb/lldb_webkit.py:
     15        (btjs):
     16
    1172014-09-11  Rebecca Hauck  <rhauck@adobe.com>
    218
  • trunk/Tools/lldb/lldb_webkit.py

    r172012 r173550  
    110110    thread = process.GetSelectedThread()
    111111
     112    if target.FindFunctions("JSC::ExecState::describeFrame").GetSize() or target.FindFunctions("_ZN3JSC9ExecState13describeFrameEv").GetSize():
     113        annotateJSFrames = True
     114    else:
     115        annotateJSFrames = False
     116
     117    if not annotateJSFrames:
     118        print "Warning: Can't find JSC::ExecState::describeFrame() in executable to annotate JavaScript frames"
     119
    112120    backtraceDepth = thread.GetNumFrames()
    113121
    … …  
    129137        function = frame.GetFunction()
    130138
    131         if not frame or not frame.GetSymbol() or frame.GetSymbol().GetName() == "llint_entry":
     139        if annotateJSFrames and not frame or not frame.GetSymbol() or frame.GetSymbol().GetName() == "llint_entry":
    132140            callFrame = frame.GetSP()
    133             JSFrameDescription = frame.EvaluateExpression("((JSC::CallFrame*)0x%x)->describeFrame()" % frame.GetFP()).GetSummary()
    134             JSFrameDescription = string.strip(JSFrameDescription, '"')
    135             frameFormat = '    frame #{num}: {addr:' + addressFormat + '} {desc}'
    136             print frameFormat.format(num=frame.GetFrameID(), addr=frame.GetPC(), desc=JSFrameDescription)
    137         else:
    138             print '    %s' % frame
     141            JSFrameDescription = frame.EvaluateExpression("((JSC::ExecState*)0x%x)->describeFrame()" % frame.GetFP()).GetSummary()
     142            if not JSFrameDescription:
     143                JSFrameDescription = frame.EvaluateExpression("(char*)_ZN3JSC9ExecState13describeFrameEv(0x%x)" % frame.GetFP()).GetSummary()
     144            if JSFrameDescription:
     145                JSFrameDescription = string.strip(JSFrameDescription, '"')
     146                frameFormat = '    frame #{num}: {addr:' + addressFormat + '} {desc}'
     147                print frameFormat.format(num=frame.GetFrameID(), addr=frame.GetPC(), desc=JSFrameDescription)
     148                continue
     149        print '    %s' % frame
    139150
    140151# FIXME: Provide support for the following types:
Note: See TracChangeset for help on using the changeset viewer.