A new python scripted javascript backtrace command and supporting C++ code now 
exists starting with change set r170432.  This is only for lldb and may be 
replaced in the future when a JIT interface is made available for lldb.  The 
new command is btjs and it can take an optional frame count, just like the bt 
command.  To use the new JavaScript enabled backtrace, import 
Tools/lldb/lldb_webkit.py with the command:
(lldb) command script import ../OpenSource/Tools/lldb/lldb_webkit.py
You can make bt an alias to btjs with the lldb command:
(lldb) command alias bt btjs
These commands can be added to your ~/.lldbinit file so they are available for 
every lldb session.

Here is a comparison of the builtin “bt” with the scripted “btjs”:

(lldb) bt
* thread #1: tid = 0x18b67e, 0x00000001004df3b4 
JavaScriptCore`JSC::genericUnwind(vm=0x0000000102800000, 
callFrame=0x00007fff5fbfdf00, exceptionValue=JSValue at 0x00007fff5fbfde68) + 
20 at JITExceptions.cpp:45, queue = 'com.apple.main-thread, stop reason = 
breakpoint 1.1
    frame #0: 0x00000001004df3b4 
JavaScriptCore`JSC::genericUnwind(vm=0x0000000102800000, 
callFrame=0x00007fff5fbfdf00, exceptionValue=JSValue at 0x00007fff5fbfde68) + 
20 at JITExceptions.cpp:45
    frame #1: 0x000000010063c35a 
JavaScriptCore`llint_slow_path_handle_exception(exec=0x00007fff5fbfdf00, 
pc=0x0000000101e00100) + 170 at LLIntSlowPaths.cpp:1390
    frame #2: 0x0000000100645d77 JavaScriptCore`llint_entry + 18661
    frame #3: 0x00002cbc7c804595
    frame #4: 0x0000000100647a4f JavaScriptCore`llint_entry + 26045
    frame #5: 0x000000010064122a JavaScriptCore`callToJavaScript + 346

(lldb) btjs
* thread #1: tid = 0x18b67e, 0x00000001004df3b4, queue = 
'com.apple.main-thread, stop reason = breakpoint 1.1
    frame #0: 0x00000001004df3b4 
JavaScriptCore`JSC::genericUnwind(vm=0x0000000102800000, 
callFrame=0x00007fff5fbfdf00, exceptionValue=JSValue at 0x00007fff5fbfde68) + 
20 at JITExceptions.cpp:45
    frame #1: 0x000000010063c35a 
JavaScriptCore`llint_slow_path_handle_exception(exec=0x00007fff5fbfdf00, 
pc=0x0000000101e00100) + 170 at LLIntSlowPaths.cpp:1390
    frame #2: 0x0000000100645d77 #BXj6qv [LLInt](Undefined)
    frame #3: 0x00002cbc7c804595 bar#DHjEHv [DFG](Cell[global ID: 359]: 
0x1030df970, Cell[Function ID: 36]: 0x1033b94b0)
    frame #4: 0x0000000100647a4f <global>#BMvYzp [LLInt](Cell[JSProxy ID: 322]: 
0x1030ffb90)
    frame #5: 0x000000010064122a JavaScriptCore`callToJavaScript + 346

- Michael
_______________________________________________
webkit-dev mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-dev

Reply via email to