Ignore:
Timestamp:
Oct 28, 2015, 10:48:10 AM (10 years ago)
Author:
[email protected]
Message:

Add ability to print the PC register from JIT'ed code.
https://bugs.webkit.org/show_bug.cgi?id=150561

Reviewed by Geoffrey Garen.

  • assembler/MacroAssemblerPrinter.cpp:

(JSC::printPC):
(JSC::MacroAssemblerPrinter::printCallback):

  • assembler/MacroAssemblerPrinter.h:

(JSC::MacroAssemblerPrinter::PrintArg::PrintArg):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/assembler/MacroAssemblerPrinter.cpp

    r191123 r191677  
    9090}
    9191
     92static void printPC(CPUState& cpu)
     93{
     94    union {
     95        void* voidPtr;
     96        intptr_t intptrValue;
     97    } u;
     98#if CPU(X86) || CPU(X86_64)
     99    u.voidPtr = cpu.eip;
     100#elif CPU(ARM_TRADITIONAL) || CPU(ARM_THUMB2) || CPU(ARM64)
     101    u.voidPtr = cpu.pc;
     102#else
     103#error "Unsupported CPU"
     104#endif
     105    dataLogF("pc:<%p %ld>", u.voidPtr, u.intptrValue);
     106}
     107
    92108void printRegister(CPUState& cpu, RegisterID regID)
    93109{
     
    179195            printCPU(context->cpu, 1);
    180196            break;
     197        case Arg::Type::PCRegister:
     198            printPC(context->cpu);
     199            break;
    181200        case Arg::Type::RegisterID:
    182201            printRegister(context->cpu, arg.u.gpRegisterID);
Note: See TracChangeset for help on using the changeset viewer.