本文整理汇总了C++中StringExtractorGDBRemote::GetServerPacketType方法的典型用法代码示例。如果您正苦于以下问题:C++ StringExtractorGDBRemote::GetServerPacketType方法的具体用法?C++ StringExtractorGDBRemote::GetServerPacketType怎么用?C++ StringExtractorGDBRemote::GetServerPacketType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringExtractorGDBRemote
的用法示例。
在下文中一共展示了StringExtractorGDBRemote::GetServerPacketType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
GDBRemoteCommunication::PacketResult
GDBRemoteCommunicationServer::GetPacketAndSendResponse (uint32_t timeout_usec,
Error &error,
bool &interrupt,
bool &quit)
{
StringExtractorGDBRemote packet;
PacketResult packet_result = WaitForPacketWithTimeoutMicroSecondsNoLock (packet, timeout_usec, false);
if (packet_result == PacketResult::Success)
{
const StringExtractorGDBRemote::ServerPacketType packet_type = packet.GetServerPacketType ();
switch (packet_type)
{
case StringExtractorGDBRemote::eServerPacketType_nack:
case StringExtractorGDBRemote::eServerPacketType_ack:
break;
case StringExtractorGDBRemote::eServerPacketType_invalid:
error.SetErrorString("invalid packet");
quit = true;
break;
case StringExtractorGDBRemote::eServerPacketType_unimplemented:
packet_result = SendUnimplementedResponse (packet.GetStringRef().c_str());
break;
default:
auto handler_it = m_packet_handlers.find(packet_type);
if (handler_it == m_packet_handlers.end())
packet_result = SendUnimplementedResponse (packet.GetStringRef().c_str());
else
packet_result = handler_it->second (packet, error, interrupt, quit);
break;
}
}
else
{
if (!IsConnected())
{
error.SetErrorString("lost connection");
quit = true;
}
else
{
error.SetErrorString("timeout");
}
}
// Check if anything occurred that would force us to want to exit.
if (m_exit_now)
quit = true;
return packet_result;
}
示例2: switch
//void *
//GDBRemoteCommunicationServer::AsyncThread (void *arg)
//{
// GDBRemoteCommunicationServer *server = (GDBRemoteCommunicationServer*) arg;
//
// Log *log;// (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PROCESS));
// if (log)
// log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %i) thread starting...", __FUNCTION__, arg, process->GetID());
//
// StringExtractorGDBRemote packet;
//
// while ()
// {
// if (packet.
// }
//
// if (log)
// log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %i) thread exiting...", __FUNCTION__, arg, process->GetID());
//
// process->m_async_thread = LLDB_INVALID_HOST_THREAD;
// return NULL;
//}
//
bool
GDBRemoteCommunicationServer::GetPacketAndSendResponse (uint32_t timeout_usec,
Error &error,
bool &interrupt,
bool &quit)
{
StringExtractorGDBRemote packet;
PacketResult packet_result = WaitForPacketWithTimeoutMicroSecondsNoLock (packet, timeout_usec);
if (packet_result == PacketResult::Success)
{
const StringExtractorGDBRemote::ServerPacketType packet_type = packet.GetServerPacketType ();
switch (packet_type)
{
case StringExtractorGDBRemote::eServerPacketType_nack:
case StringExtractorGDBRemote::eServerPacketType_ack:
break;
case StringExtractorGDBRemote::eServerPacketType_invalid:
error.SetErrorString("invalid packet");
quit = true;
break;
case StringExtractorGDBRemote::eServerPacketType_interrupt:
error.SetErrorString("interrupt received");
interrupt = true;
break;
default:
case StringExtractorGDBRemote::eServerPacketType_unimplemented:
packet_result = SendUnimplementedResponse (packet.GetStringRef().c_str());
break;
case StringExtractorGDBRemote::eServerPacketType_A:
packet_result = Handle_A (packet);
break;
case StringExtractorGDBRemote::eServerPacketType_qfProcessInfo:
packet_result = Handle_qfProcessInfo (packet);
break;
case StringExtractorGDBRemote::eServerPacketType_qsProcessInfo:
packet_result = Handle_qsProcessInfo (packet);
break;
case StringExtractorGDBRemote::eServerPacketType_qC:
packet_result = Handle_qC (packet);
break;
case StringExtractorGDBRemote::eServerPacketType_qHostInfo:
packet_result = Handle_qHostInfo (packet);
break;
case StringExtractorGDBRemote::eServerPacketType_qLaunchGDBServer:
packet_result = Handle_qLaunchGDBServer (packet);
break;
case StringExtractorGDBRemote::eServerPacketType_qKillSpawnedProcess:
packet_result = Handle_qKillSpawnedProcess (packet);
break;
case StringExtractorGDBRemote::eServerPacketType_qLaunchSuccess:
packet_result = Handle_qLaunchSuccess (packet);
break;
case StringExtractorGDBRemote::eServerPacketType_qGroupName:
packet_result = Handle_qGroupName (packet);
break;
case StringExtractorGDBRemote::eServerPacketType_qProcessInfoPID:
packet_result = Handle_qProcessInfoPID (packet);
break;
case StringExtractorGDBRemote::eServerPacketType_qSpeedTest:
packet_result = Handle_qSpeedTest (packet);
break;
case StringExtractorGDBRemote::eServerPacketType_qUserName:
//.........这里部分代码省略.........
示例3: SendUnimplementedResponse
//void *
//GDBRemoteCommunicationServer::AsyncThread (void *arg)
//{
// GDBRemoteCommunicationServer *server = (GDBRemoteCommunicationServer*) arg;
//
// LogSP log;// (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PROCESS));
// if (log)
// log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %i) thread starting...", __FUNCTION__, arg, process->GetID());
//
// StringExtractorGDBRemote packet;
//
// while ()
// {
// if (packet.
// }
//
// if (log)
// log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %i) thread exiting...", __FUNCTION__, arg, process->GetID());
//
// process->m_async_thread = LLDB_INVALID_HOST_THREAD;
// return NULL;
//}
//
bool
GDBRemoteCommunicationServer::GetPacketAndSendResponse (uint32_t timeout_usec,
Error &error,
bool &interrupt,
bool &quit)
{
StringExtractorGDBRemote packet;
if (WaitForPacketWithTimeoutMicroSeconds(packet, timeout_usec))
{
const StringExtractorGDBRemote::ServerPacketType packet_type = packet.GetServerPacketType ();
switch (packet_type)
{
case StringExtractorGDBRemote::eServerPacketType_nack:
case StringExtractorGDBRemote::eServerPacketType_ack:
break;
case StringExtractorGDBRemote::eServerPacketType_invalid:
error.SetErrorString("invalid packet");
quit = true;
break;
case StringExtractorGDBRemote::eServerPacketType_interrupt:
error.SetErrorString("interrupt received");
interrupt = true;
break;
case StringExtractorGDBRemote::eServerPacketType_unimplemented:
return SendUnimplementedResponse (packet.GetStringRef().c_str()) > 0;
case StringExtractorGDBRemote::eServerPacketType_A:
return Handle_A (packet);
case StringExtractorGDBRemote::eServerPacketType_qfProcessInfo:
return Handle_qfProcessInfo (packet);
case StringExtractorGDBRemote::eServerPacketType_qsProcessInfo:
return Handle_qsProcessInfo (packet);
case StringExtractorGDBRemote::eServerPacketType_qC:
return Handle_qC (packet);
case StringExtractorGDBRemote::eServerPacketType_qHostInfo:
return Handle_qHostInfo (packet);
case StringExtractorGDBRemote::eServerPacketType_qLaunchGDBServer:
return Handle_qLaunchGDBServer (packet);
case StringExtractorGDBRemote::eServerPacketType_qLaunchSuccess:
return Handle_qLaunchSuccess (packet);
case StringExtractorGDBRemote::eServerPacketType_qGroupName:
return Handle_qGroupName (packet);
case StringExtractorGDBRemote::eServerPacketType_qProcessInfoPID:
return Handle_qProcessInfoPID (packet);
case StringExtractorGDBRemote::eServerPacketType_qSpeedTest:
return Handle_qSpeedTest (packet);
case StringExtractorGDBRemote::eServerPacketType_qUserName:
return Handle_qUserName (packet);
case StringExtractorGDBRemote::eServerPacketType_QEnvironment:
return Handle_QEnvironment (packet);
case StringExtractorGDBRemote::eServerPacketType_QSetDisableASLR:
return Handle_QSetDisableASLR (packet);
case StringExtractorGDBRemote::eServerPacketType_QSetSTDIN:
return Handle_QSetSTDIN (packet);
case StringExtractorGDBRemote::eServerPacketType_QSetSTDOUT:
return Handle_QSetSTDOUT (packet);
case StringExtractorGDBRemote::eServerPacketType_QSetSTDERR:
return Handle_QSetSTDERR (packet);
//.........这里部分代码省略.........