Changeset 161686 in webkit for trunk/Source/JavaScriptCore


Ignore:
Timestamp:
Jan 10, 2014, 3:47:12 PM (11 years ago)
Author:
[email protected]
Message:

REGRESSION(C stack work): stack traces no longer work in CrashTracer, lldb, and other tools
https://bugs.webkit.org/show_bug.cgi?id=126764

Reviewed by Geoffrey Garen.

Updated callToJavaScript and cllToNativeFunction to properly replicate the caller's
return PC and frame pointer in the sentinel frame. For X86-64, added .cfi_
directives to create eh_frame info for all LLInt symbols so that the various
unwinding code understands that we are using a separate JS stack referenced
by BP and at what offsets in that frame the prior PC (register 16) and prior
BP (register 6) can be found. These two changes are sufficient for stack tracing
to work for Mac OSX.

  • llint/LowLevelInterpreter.cpp:
  • llint/LowLevelInterpreter64.asm:
Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r161672 r161686  
     12014-01-10  Michael Saboff  <[email protected]>
     2
     3        REGRESSION(C stack work): stack traces no longer work in CrashTracer, lldb, and other tools
     4        https://bugs.webkit.org/show_bug.cgi?id=126764
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Updated callToJavaScript and cllToNativeFunction to properly replicate the caller's
     9        return PC and frame pointer in the sentinel frame.  For X86-64, added .cfi_
     10        directives to create eh_frame info for all LLInt symbols so that the various
     11        unwinding code understands that we are using a separate JS stack referenced
     12        by BP and at what offsets in that frame the prior PC (register 16) and prior
     13        BP (register 6) can be found.  These two changes are sufficient for stack tracing
     14        to work for Mac OSX.
     15
     16        * llint/LowLevelInterpreter.cpp:
     17        * llint/LowLevelInterpreter64.asm:
     18
    1192014-01-10  Tamas Gergely  <[email protected]>
    220
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp

    r160186 r161686  
    523523
    524524// These are for building an interpreter from generated assembly code:
     525#if CPU(X86_64)
     526#define OFFLINE_ASM_BEGIN   asm ( \
     527    ".cfi_startproc\n"
     528
     529#define OFFLINE_ASM_END     \
     530    ".cfi_endproc\n" \
     531);
     532#else
    525533#define OFFLINE_ASM_BEGIN   asm (
    526534#define OFFLINE_ASM_END     );
     535#endif
    527536
    528537#define OFFLINE_ASM_OPCODE_LABEL(__opcode) OFFLINE_ASM_GLOBAL_LABEL(llint_##__opcode)
     
    537546    ".thumb_func " THUMB_FUNC_PARAM(label) "\n"  \
    538547    SYMBOL_STRING(label) ":\n"
     548#elif CPU(X86_64)
     549#define OFFLINE_ASM_GLOBAL_LABEL(label)         \
     550    ".text\n"                                   \
     551    ".globl " SYMBOL_STRING(label) "\n"         \
     552    HIDE_SYMBOL(label) "\n"                     \
     553    SYMBOL_STRING(label) ":\n"                  \
     554    ".cfi_def_cfa rbp, 0\n"                     \
     555    ".cfi_offset 16, 8\n"                       \
     556    ".cfi_offset 6, 0\n"
    539557#else
    540558#define OFFLINE_ASM_GLOBAL_LABEL(label)         \
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm

    r161450 r161686  
    141141    end
    142142
    143     if X86_64
    144         loadp [sp], previousPC
    145     end
    146     move cfr, previousCFR
    147143    functionPrologue(extraStackSpace)
    148144
     
    154150    storep temp1, ScopeChain[cfr]
    155151    storep 1, CodeBlock[cfr]
     152    if X86_64
     153        loadp 7*8[sp], previousPC
     154        loadp 6*8[sp], previousCFR
     155    end
    156156    storep previousPC, ReturnPC[cfr]
    157157    storep previousCFR, CallerFrame[cfr]
Note: See TracChangeset for help on using the changeset viewer.