btjs should print the bytecode offset in the stack trace for JS frames
authorkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Mar 2018 17:38:32 +0000 (17:38 +0000)
committerkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Mar 2018 17:38:32 +0000 (17:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=183856

Reviewed by Filip Pizlo.

* interpreter/CallFrame.cpp:
(JSC::CallFrame::bytecodeOffset):
(JSC::CallFrame::dump):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229810 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/interpreter/CallFrame.cpp

index f5f5ea1..1a236e3 100644 (file)
@@ -1,3 +1,14 @@
+2018-03-21  Keith Miller  <keith_miller@apple.com>
+
+        btjs should print the bytecode offset in the stack trace for JS frames
+        https://bugs.webkit.org/show_bug.cgi?id=183856
+
+        Reviewed by Filip Pizlo.
+
+        * interpreter/CallFrame.cpp:
+        (JSC::CallFrame::bytecodeOffset):
+        (JSC::CallFrame::dump):
+
 2018-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         Unreviewed. Fix GTK and WPE debug build after r229798.
index b81bd52..873767f 100644 (file)
@@ -148,6 +148,7 @@ unsigned CallFrame::callSiteBitsAsBytecodeOffset() const
     
 unsigned CallFrame::bytecodeOffset()
 {
+    ASSERT(!callee().isWasm());
     if (!codeBlock())
         return 0;
 #if ENABLE(DFG_JIT)
@@ -329,7 +330,7 @@ String CallFrame::friendlyFunctionName()
 void CallFrame::dump(PrintStream& out)
 {
     if (CodeBlock* codeBlock = this->codeBlock()) {
-        out.print(codeBlock->inferredName(), "#", codeBlock->hashAsStringIfPossible(), " [", codeBlock->jitType(), "]");
+        out.print(codeBlock->inferredName(), "#", codeBlock->hashAsStringIfPossible(), " [", codeBlock->jitType(), " bc#", bytecodeOffset(), "]");
 
         out.print("(");
         thisValue().dumpForBacktrace(out);