Beispiel #1
0
void CmdEval::sendImpl(DebuggerThriftBuffer &thrift) {
  DebuggerCommand::sendImpl(thrift);
  thrift.write(m_output);
  thrift.write(m_frame);
  thrift.write(m_bypassAccessCheck);
  if (this->m_version == 2) thrift.write(m_failed);
}
Beispiel #2
0
void CmdMachine::recvImpl(DebuggerThriftBuffer &thrift) {
  DebuggerCommand::recvImpl(thrift);
  thrift.read(m_sandboxes);
  thrift.read(m_rpcConfig);
  thrift.read(m_force);
  thrift.read(m_succeed);
}
void DebuggerCommand::sendImpl(DebuggerThriftBuffer &thrift) {
  TRACE(2, "DebuggerCommand::sendImpl\n");
  thrift.write((int32_t)m_type);
  thrift.write(m_class);
  thrift.write(m_body);
  thrift.write(m_version);
}
Beispiel #4
0
void CmdInstrument::sendImpl(DebuggerThriftBuffer &thrift) {
  DebuggerCommand::sendImpl(thrift);
  thrift.write(m_type);
  thrift.write(m_enabled);
  ASSERT(m_instPoints);
  InstPointInfo::SendImpl(*m_instPoints, thrift);
}
Beispiel #5
0
// Always called from recv and implements specific
// logic for deserializing a list command received via Thrift.
void CmdList::recvImpl(DebuggerThriftBuffer &thrift) {
  DebuggerCommand::recvImpl(thrift);
  thrift.read(m_file);
  thrift.read(m_line1);
  thrift.read(m_line2);
  thrift.read(m_code);
}
Beispiel #6
0
// Always called from send and implements specific
// logic for serializing a list command to send via Thrift.
void CmdList::sendImpl(DebuggerThriftBuffer &thrift) {
  DebuggerCommand::sendImpl(thrift);
  thrift.write(m_file);
  thrift.write(m_line1);
  thrift.write(m_line2);
  thrift.write(m_code);
}
Beispiel #7
0
void CmdMachine::sendImpl(DebuggerThriftBuffer &thrift) {
  DebuggerCommand::sendImpl(thrift);
  thrift.write(m_sandboxes);
  thrift.write(m_rpcConfig);
  thrift.write(m_force);
  thrift.write(m_succeed);
}
Beispiel #8
0
void CmdPrint::recvImpl(DebuggerThriftBuffer &thrift) {
  DebuggerCommand::recvImpl(thrift);
  thrift.read(m_ret);
  thrift.read(m_output);
  thrift.read(m_frame);
  thrift.read(m_bypassAccessCheck);
  thrift.read(m_printLevel);
}
void CmdInternalTesting::sendImpl(DebuggerThriftBuffer &thrift) {
  DebuggerCommand::sendImpl(thrift);
  thrift.write(m_arg);
  // Write less data on purpose, to get the server to choke on deserialization
  if ((m_arg != "shortcmd")) {
    thrift.write(m_unused);
  }
}
Beispiel #10
0
void CmdWhere::sendImpl(DebuggerThriftBuffer &thrift) {
  DebuggerCommand::sendImpl(thrift);
  {
    String sdata;
    DebuggerWireHelpers::WireSerialize(m_stacktrace, sdata);
    thrift.write(sdata);
  }
  thrift.write(m_stackArgs);
}
Beispiel #11
0
void InstPointInfo::recvImpl(DebuggerThriftBuffer &thrift) {
  TRACE(2, "InstPointInfo::recvImpl\n");
  thrift.read(m_locType);
  thrift.read(m_valid);
  thrift.read(m_file);
  thrift.read(m_line);
  thrift.read(m_func);
  thrift.read(m_desc);
  thrift.read(m_code);
}
Beispiel #12
0
void CmdVariable::sendImpl(DebuggerThriftBuffer &thrift) {
  DebuggerCommand::sendImpl(thrift);
  thrift.write(m_frame);
  {
    String sdata;
    DebuggerWireHelpers::WireSerialize(m_variables, sdata);
    thrift.write(sdata);
  }
  thrift.write(m_global);
}
Beispiel #13
0
// Resets the buffer, serializes this command into the buffer and then
// flushes the buffer.
// Returns false if an exception occurs during these steps.
bool DebuggerCommand::send(DebuggerThriftBuffer &thrift) {
  TRACE(5, "DebuggerCommand::send cmd of type %d\n", m_type);
  try {
    thrift.reset(false);
    sendImpl(thrift);
    thrift.flush();
  } catch (...) {
    Logger::Error("DebuggerCommand::send(): a socket error has happened");
    return false;
  }
  return true;
}
Beispiel #14
0
bool DebuggerCommand::send(DebuggerThriftBuffer &thrift) {
  try {
    thrift.reset(false);
    sendImpl(thrift);
    thrift.flush();
  } catch (...) {
    Logger::Verbose("DebuggerCommand::send(): a socket error has happened");
    thrift.close();
    return false;
  }
  return true;
}
Beispiel #15
0
void CmdWhere::recvImpl(DebuggerThriftBuffer &thrift) {
  DebuggerCommand::recvImpl(thrift);
  {
    String sdata;
    thrift.read(sdata);
    if (DebuggerWireHelpers::WireUnserialize(sdata, m_stacktrace) !=
        DebuggerWireHelpers::NoError) {
      m_stacktrace = null_array;
      m_wireError = sdata;
    }
  }
  thrift.read(m_stackArgs);
}
Beispiel #16
0
void CmdVariable::recvImpl(DebuggerThriftBuffer &thrift) {
  DebuggerCommand::recvImpl(thrift);
  thrift.read(m_frame);
  {
    String sdata;
    thrift.read(sdata);
    if (DebuggerWireHelpers::WireUnserialize(sdata, m_variables) !=
        DebuggerWireHelpers::NoError) {
      m_variables = null_array;
      m_wireError = sdata;
    }
  }
  thrift.read(m_global);
}
Beispiel #17
0
void CmdPrint::sendImpl(DebuggerThriftBuffer &thrift) {
  DebuggerCommand::sendImpl(thrift);
  if (m_printLevel > 0) {
    g_context->setDebuggerPrintLevel(m_printLevel);
  }
  thrift.write(m_ret);
  if (m_printLevel > 0) {
    g_context->setDebuggerPrintLevel(-1);
  }
  thrift.write(m_output);
  thrift.write(m_frame);
  thrift.write(m_bypassAccessCheck);
  thrift.write(m_printLevel);
}
Beispiel #18
0
void CmdEval::recvImpl(DebuggerThriftBuffer &thrift) {
  DebuggerCommand::recvImpl(thrift);
  thrift.read(m_output);
  thrift.read(m_frame);
  thrift.read(m_bypassAccessCheck);
  if (this->m_version == 2) thrift.read(m_failed);
  // Old senders will set version to 0. A new sender sets it to 1
  // and then expects an answer using version 2.
  // Note that version 1 is the same format as version 0, so old
  // receivers will not break when receiving a version 1 message.
  // This code ensures that version 2 messages are received only
  // by receivers that previously sent a version 1 message (thus
  // indicating their ability to deal with version 2 messages).
  if (this->m_version == 1) this->m_version = 2;
}
Beispiel #19
0
void InstPointInfo::SendImpl(const InstPointInfoPtrVec& ips,
                             DebuggerThriftBuffer &thrift) {
  TRACE(2, "InstPointInfo::SendImpl\n");
  int16_t size = ips.size();
  thrift.write(size);
  for (int i = 0; i < size; i++) {
    ips[i]->sendImpl(thrift);
  }
}
Beispiel #20
0
bool DebuggerCommand::recv(DebuggerThriftBuffer &thrift) {
  try {
    recvImpl(thrift);
  } catch (...) {
    Logger::Verbose("DebuggerCommand::recv(): a socket error has happened");
    thrift.close();
    return false;
  }
  return true;
}
void CmdVariable::recvImpl(DebuggerThriftBuffer &thrift) {
  DebuggerCommand::recvImpl(thrift);
  thrift.read(m_frame);
  {
    String sdata;
    thrift.read(sdata);
    auto error = DebuggerWireHelpers::WireUnserialize(sdata, m_variables);
    if (error != DebuggerWireHelpers::NoError) {
      m_variables = null_array;
      if (error != DebuggerWireHelpers::HitLimit || m_version == 0) {
        // Unexpected error. Log it.
        m_wireError = sdata;
      }
    }
  }
  thrift.read(m_global);
  if (m_version == 2) {
    thrift.read(m_varName);
    thrift.read(m_filter);
  }
}
Beispiel #22
0
void InstPointInfo::RecvImpl(InstPointInfoPtrVec& ips,
                             DebuggerThriftBuffer &thrift) {
  TRACE(2, "InstPointInfo::RecvImpl\n");
  int16_t size;
  thrift.read(size);
  ips.resize(size);
  for (int i = 0; i < size; i++) {
    InstPointInfoPtr ipi(new InstPointInfo());
    ipi->recvImpl(thrift);
    ips[i] = ipi;
  }
}
Beispiel #23
0
void CmdVariable::sendImpl(DebuggerThriftBuffer &thrift) {
  DebuggerCommand::sendImpl(thrift);
  thrift.write(m_frame);
  {
    String sdata;
    DebuggerWireHelpers::WireSerialize(m_variables, sdata);
    thrift.write(sdata);
  }
  thrift.write(m_global);
  if (m_version == 2) {
    thrift.write(m_formatMaxLen);
    thrift.write(m_varName);
    thrift.write(m_filter);
  }
}
Beispiel #24
0
void CmdPrint::sendImpl(DebuggerThriftBuffer &thrift) {
  DebuggerCommand::sendImpl(thrift);
  if (m_printLevel > 0) {
    g_context->setDebuggerPrintLevel(m_printLevel);
  }
  {
    String sdata;
    DebuggerWireHelpers::WireSerialize(m_ret, sdata);
    thrift.write(sdata);
  }
  if (m_printLevel > 0) {
    g_context->setDebuggerPrintLevel(-1);
  }
  thrift.write(m_output);
  thrift.write(m_frame);
  thrift.write(m_bypassAccessCheck);
  thrift.write(m_printLevel);
  thrift.write(m_noBreak);
}
Beispiel #25
0
void CmdPrint::recvImpl(DebuggerThriftBuffer &thrift) {
  DebuggerCommand::recvImpl(thrift);
  {
    String sdata;
    thrift.read(sdata);
    int error = DebuggerWireHelpers::WireUnserialize(sdata, m_ret);
    if (error) {
      m_ret = null;
    }
    if (error == DebuggerWireHelpers::HitLimit) {
      m_wireError = "Hit unserialization limit. "
                    "Try with smaller print level";
    }
  }
  thrift.read(m_output);
  thrift.read(m_frame);
  thrift.read(m_bypassAccessCheck);
  thrift.read(m_printLevel);
  thrift.read(m_noBreak);
}
void CmdHeaptrace::recvImpl(DebuggerThriftBuffer &thrift) {
  DebuggerCommand::recvImpl(thrift);
  thrift.read(m_accum.typesMap);
  thrift.read(m_accum.sizeMap);
  thrift.read(m_accum.adjacencyList);
}
void CmdHeaptrace::sendImpl(DebuggerThriftBuffer &thrift) {
  DebuggerCommand::sendImpl(thrift);
  thrift.write(m_accum.typesMap);
  thrift.write(m_accum.sizeMap);
  thrift.write(m_accum.adjacencyList);
}
Beispiel #28
0
void CmdShell::recvImpl(DebuggerThriftBuffer &thrift) {
  DebuggerCommand::recvImpl(thrift);
  thrift.read(m_args);
  thrift.read(m_out);
}
Beispiel #29
0
void CmdUser::sendImpl(DebuggerThriftBuffer &thrift) {
  DebuggerCommand::sendImpl(thrift);
  thrift.write(m_cmd);
}
Beispiel #30
0
void CmdUser::recvImpl(DebuggerThriftBuffer &thrift) {
  DebuggerCommand::recvImpl(thrift);
  thrift.read(m_cmd);
}