Ignore:
Timestamp:
May 13, 2017, 1:32:59 PM (8 years ago)
Author:
[email protected]
Message:

Unreviewed, rolling out r216808.
https://bugs.webkit.org/show_bug.cgi?id=172075

caused lldb to hang when debugging (Requested by smfr on
#webkit).

Reverted changeset:

"Use Mach exceptions instead of signals where possible"
https://bugs.webkit.org/show_bug.cgi?id=171865
http://trac.webkit.org/changeset/216808

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/VMTraps.cpp

    r216808 r216827  
    5454
    5555struct SignalContext {
    56     SignalContext(PlatformRegisters& registers)
    57         : registers(registers)
    58         , trapPC(MachineContext::instructionPointer(registers))
    59         , stackPointer(MachineContext::stackPointer(registers))
    60         , framePointer(MachineContext::framePointer(registers))
     56    SignalContext(mcontext_t& mcontext)
     57        : mcontext(mcontext)
     58        , trapPC(MachineContext::instructionPointer(mcontext))
     59        , stackPointer(MachineContext::stackPointer(mcontext))
     60        , framePointer(MachineContext::framePointer(mcontext))
    6161    {
    6262#if CPU(X86_64) || CPU(X86)
     
    6969    {
    7070#if CPU(X86_64) || CPU(X86)
    71         MachineContext::instructionPointer(registers) = trapPC;
    72 #endif
    73     }
    74 
    75     PlatformRegisters& registers;
     71        MachineContext::instructionPointer(mcontext) = trapPC;
     72#endif
     73    }
     74
     75    mcontext_t& mcontext;
    7676    void* trapPC;
    7777    void* stackPointer;
     
    131131static void installSignalHandler()
    132132{
    133     installSignalHandler(Signal::Trap, [] (Signal, SigInfo&, PlatformRegisters& registers) -> SignalAction {
    134         SignalContext context(registers);
     133    installSignalHandler(Signal::Trap, [] (int, siginfo_t*, void* uap) -> SignalAction {
     134        SignalContext context(static_cast<ucontext_t*>(uap)->uc_mcontext);
    135135
    136136        if (!isJITPC(context.trapPC))
     
    405405            auto optionalOwnerThread = vm.ownerThread();
    406406            if (optionalOwnerThread) {
    407                 sendMessage(*optionalOwnerThread.value().get(), [] (PlatformRegisters& registers) -> void {
    408                     SignalContext context(registers);
     407                sendMessage(*optionalOwnerThread.value().get(), [] (siginfo_t*, ucontext_t* ucontext) -> void {
     408                    SignalContext context(ucontext->uc_mcontext);
    409409                    auto activeVMAndStackBounds = findActiveVMAndStackBounds(context);
    410410                    if (activeVMAndStackBounds) {
Note: See TracChangeset for help on using the changeset viewer.