Changeset 12673


Ignore:
Timestamp:
Aug 25, 2009, 7:53:10 AM (10 years ago)
Author:
gb
Message:

Finally (knock wood) get the DWARF exception info right for
PPC64 Darwin. A large part of what's been wrong is that
Frame Description Entries (FDEs) need to be a multiple of
8 bytes long, and the label defining the end of the first
FDE (the one that describes _SPffall) preceded rather than
followed a ".align 3" directive.) I suspect that the first
FDE was incidentally a multiple of 8 bytes in size, but any
changes to the Call Frame Info (CFI) entries in that FDE
caused the size to be incorrect (and caused the second FDE
to not be found.)

Changed the CFI entries in the FDEs (which had been cut-and-pasted
from the x86-64 version) to be a little more plausible for ppc64
(the old entries caused crashes in _Unwind_Backtrace(), which
is called at runtime by something called objc_addExceptionHandler().
(Some people have found that objc_addExceptionHandler() accounts
for a high percentage of their program's execution time.) I don't
think that the "plausible" CFI entries will crash, but I don't
know how to describe the size of the stack frame of something
like _SPffcall (it depends on the number of outgoing args), and
I doubt if it'd possible for the C++-style exception code to
ever unwind past something like _SPffcall (and it wouldn't
be meaningful, since there's lisp code on the other side ...)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/ppc-spentry.s

    r12658 r12673  
    16341634
    16351635                .section __DATA,__gcc_except_tab
    1636 GCC_except_table0:
    16371636          .align 3
    16381637LLSDA1:
     
    18581857LocalLabelPrefix[]ffcall_return_registers_end:
    18591858          .section __DATA,__gcc_except_tab
    1860 GCC_except_table1:
    18611859          .align 3
    18621860LLSDA2:
     
    69746972        __(b _SPbind_interrupt_level)
    69756973
    6976        
     6974        .if 1
    69776975        __ifdef([DARWIN])
    69786976         __ifdef([PPC64])
     
    70177015        .byte 8 /* uleb128 0x8; Augmentation size */
    70187016        .quad LLSDA1-.           /* Language Specific Data Area */
    7019         .byte   0x4     /* DW_CFA_advance_loc4 */
     7017        .byte DW_CFA_def_cfa_offset
     7018        .byte 0xc0,0x1 /* uleb128 0xc0.  A lie:  the frame is variable-length */
     7019        .byte DW_CFA_offset_extended_sf
     7020        .byte   0x41   
     7021        .byte   0x7e    /* sleb128 -2 */
     7022        .byte DW_CFA_advance_loc4
    70207023        .long Lffcall_setup-Lffcall
    7021         .byte   0xe     /* DW_CFA_def_cfa_offset */
    7022         .byte   0x10    /* uleb128 0x10 */
    7023         .byte   0x86    /* DW_CFA_offset, column 0x6 */
    7024         .byte   0x2     /* uleb128 0x2 */
    7025         .byte   0x4     /* DW_CFA_advance_loc4 */
     7024        .byte DW_CFA_advance_loc4
    70267025        .long Lffcall_setup_end-Lffcall_setup
    7027         .byte   0xd     /* DW_CFA_def_cfa_register */
    7028         .byte   0x6     /* uleb128 0x6 */
    7029         .byte   0x4     /* DW_CFA_advance_loc4 */
     7026        .byte DW_CFA_advance_loc4
    70307027        .long Lffcall_call_end-Lffcall_call
    7031         .byte   0x83    /* DW_CFA_offset, column 0x3 */
    7032         .byte   0x3     /* uleb128 0x3 */
     7028        .align 3
    70337029LEFDEffcall:
    7034         .align 3
     7030       
    70357031        .globl _SPffcall_return_registers.eh
    70367032_SPffcall_return_registers.eh:
     
    70437039        .byte 8 /* uleb128 0x8; Augmentation size */
    70447040        .quad LLSDA2-.           /* Language Specific Data Area */
    7045         .byte   0x4     /* DW_CFA_advance_loc4 */
     7041        .byte DW_CFA_def_cfa_offset
     7042        .byte 0xc0,0x1 /* uleb128 0xc0.  A lie:  the frame is variable-length */
     7043        .byte DW_CFA_offset_extended_sf
     7044        .byte 0x41     
     7045        .byte 0x7e      /* sleb128 -2 */
     7046        .byte DW_CFA_advance_loc4
    70467047        .long Lffcall_return_registers_setup-Lffcall_return_registers
    7047         .byte   0xe     /* DW_CFA_def_cfa_offset */
    7048         .byte   0x10    /* uleb128 0x10 */
    7049         .byte   0x86    /* DW_CFA_offset, column 0x6 */
    7050         .byte   0x2     /* uleb128 0x2 */
    7051         .byte   0x4     /* DW_CFA_advance_loc4 */
     7048        .byte DW_CFA_advance_loc4
    70527049        .long Lffcall_return_registers_setup_end-Lffcall_return_registers_setup
    7053         .byte   0xd     /* DW_CFA_def_cfa_register */
    7054         .byte   0x6     /* uleb128 0x6 */
    7055         .byte   0x4     /* DW_CFA_advance_loc4 */
     7050        .byte DW_CFA_advance_loc4
    70567051        .long Lffcall_return_registers_call_end-Lffcall_return_registers_call
    7057         .byte   0x83    /* DW_CFA_offset, column 0x3 */
    7058         .byte   0x3     /* uleb128 0x3 */
    70597052        .align 3
    70607053LEFDEffcall_return_registers:
     
    70627055         __endif
    70637056        __endif
    7064 
     7057        .endif
    70657058
    70667059                               
Note: See TracChangeset for help on using the changeset viewer.