Beispiel #1
0
void Debugger::requestInterrupt(DebuggerProxyPtr proxy) {
  const StringData* sid = StringData::GetStaticString(proxy->getSandboxId());
  FOREACH_SANDBOX_THREAD_BEGIN(sid, ti)
  ti->m_reqInjectionData.debuggerIntr = true;
  FOREACH_SANDBOX_THREAD_END()
  sid = StringData::GetStaticString(proxy->getDummyInfo().id());
  FOREACH_SANDBOX_THREAD_BEGIN(sid, ti)
  ti->m_reqInjectionData.debuggerIntr = true;
  FOREACH_SANDBOX_THREAD_END()
}
Beispiel #2
0
// Ask every thread in this proxy's sandbox and the dummy sandbox to
// "stop".  Gaining control of these threads is the intention... the
// mechanism is to force them all to start interpreting all of their
// code in an effort to gain control in phpDebuggerOpcodeHook(). We
// set the "debugger interrupt" flag to ensure we interpret code
// rather than entering translated code, and we set the "debugger
// signal" surprise flag to pop out of loops in translated code.
void Debugger::requestInterrupt(DebuggerProxyPtr proxy) {
  TRACE(2, "Debugger::requestInterrupt\n");
  const StringData* sid = makeStaticString(proxy->getSandboxId());
  FOREACH_SANDBOX_THREAD_BEGIN(sid, ti)
    ti->m_reqInjectionData.setDebuggerIntr(true);
    ti->m_reqInjectionData.setFlag(DebuggerSignalFlag);
  FOREACH_SANDBOX_THREAD_END()

  sid = makeStaticString(proxy->getDummyInfo().id());
  FOREACH_SANDBOX_THREAD_BEGIN(sid, ti)
    ti->m_reqInjectionData.setDebuggerIntr(true);
    ti->m_reqInjectionData.setFlag(DebuggerSignalFlag);
  FOREACH_SANDBOX_THREAD_END()
}
Beispiel #3
0
void Debugger::removeProxy(DebuggerProxyPtr proxy) {
  if (proxy->getSandbox().valid()) {
    const StringData* sid = StringData::GetStaticString(proxy->getSandboxId());
    setDebuggerFlag(sid, false);
    m_proxyMap.erase(sid);
  }
  const StringData* dummySid =
    StringData::GetStaticString(proxy->getDummyInfo().id());
  m_proxyMap.erase(dummySid);
  // Clear the debugger blacklist PC upon last detach if JIT is used
  if (RuntimeOption::EvalJit && countConnectedProxy() == 0) {
    VM::Transl::Translator::Get()->clearDbgBL();
  }
}
Beispiel #4
0
// NB: when this returns, the Debugger class no longer has any references to the
// given proxy. It will likely be destroyed when the caller's reference goes out
// of scope.
void Debugger::removeProxy(DebuggerProxyPtr proxy) {
  TRACE(2, "Debugger::removeProxy\n");
  if (proxy->getSandbox().valid()) {
    const StringData* sid = makeStaticString(proxy->getSandboxId());
    setDebuggerFlag(sid, false);
    m_proxyMap.erase(sid);
  }
  const StringData* dummySid =
    makeStaticString(proxy->getDummyInfo().id());
  m_proxyMap.erase(dummySid);
  // Clear the debugger blacklist PC upon last detach if JIT is used
  if (RuntimeOption::EvalJit && countConnectedProxy() == 0) {
    jit::mcg->tx().clearDbgBL();
  }
}