void MemoryTracer::onCustomInstruction(S2EExecutionState* state, uint64_t opcode) { if (!OPCODE_CHECK(opcode, MEMORY_TRACER_OPCODE)) { return; } //XXX: remove this mess. Should have a function for extracting //info from opcodes. opcode >>= 16; uint8_t op = opcode & 0xFF; opcode >>= 8; MemoryTracerOpcodes opc = (MemoryTracerOpcodes)op; switch(opc) { case Enable: enableTracing(); break; case Disable: disableTracing(); break; default: s2e()->getWarningsStream() << "MemoryTracer: unsupported opcode " << hexval(opc) << '\n'; break; } }
XDEBUG_NOTIMPLEMENTED static Variant HHVM_FUNCTION(xdebug_stop_trace) { if (!XDEBUG_GLOBAL(ProfilerAttached)) { return false; } auto profiler = xdebug_profiler(); if (!profiler->isTracing()) { return false; } // End with xdebug_stop_trace() profiler->endFrame(init_null().asTypedValue(), nullptr, false); auto filename = profiler->getTracingFilename(); profiler->disableTracing(); detach_xdebug_profiler_if_needed(); return filename; }
void MemoryTracer::onCustomInstruction(S2EExecutionState* state, uint64_t opcode) { if (!OPCODE_CHECK(opcode, MEMORY_TRACER_OPCODE)) { return; } uint64_t subfunction = OPCODE_GETSUBFUNCTION(opcode); MemoryTracerOpcodes opc = (MemoryTracerOpcodes)subfunction; switch(opc) { case Enable: enableTracing(); break; case Disable: disableTracing(); break; default: s2e()->getWarningsStream() << "MemoryTracer: unsupported opcode " << hexval(opc) << '\n'; break; } }