diff options
Diffstat (limited to 'lldb/tools/debugserver/source')
-rw-r--r-- | lldb/tools/debugserver/source/RNBRemote.cpp | 19 | ||||
-rw-r--r-- | lldb/tools/debugserver/source/RNBRemote.h | 2 |
2 files changed, 21 insertions, 0 deletions
diff --git a/lldb/tools/debugserver/source/RNBRemote.cpp b/lldb/tools/debugserver/source/RNBRemote.cpp index e8fb114d2ba..f2b1171acda 100644 --- a/lldb/tools/debugserver/source/RNBRemote.cpp +++ b/lldb/tools/debugserver/source/RNBRemote.cpp @@ -203,6 +203,7 @@ RNBRemote::CreatePacketTable () t.push_back (Packet (set_enable_profiling, &RNBRemote::HandlePacket_SetEnableAsyncProfiling, NULL, "QSetEnableAsyncProfiling", "Enable or disable the profiling of current target.")); t.push_back (Packet (watchpoint_support_info, &RNBRemote::HandlePacket_WatchpointSupportInfo, NULL, "qWatchpointSupportInfo", "Return the number of supported hardware watchpoints")); t.push_back (Packet (set_process_event, &RNBRemote::HandlePacket_QSetProcessEvent, NULL, "QSetProcessEvent:", "Set a process event, to be passed to the process, can be set before the process is started, or after.")); + t.push_back (Packet (set_detach_on_error, &RNBRemote::HandlePacket_QSetDetachOnError, NULL, "QSetDetachOnError:", "Set whether debugserver will detach (1) or kill (0) from the process it is controlling if it loses connection to lldb.")); t.push_back (Packet (speed_test, &RNBRemote::HandlePacket_qSpeedTest, NULL, "qSpeedTest:", "Test the maximum speed at which packet can be sent/received.")); } @@ -2018,6 +2019,24 @@ RNBRemote::HandlePacket_QSyncThreadState (const char *p) } rnb_err_t +RNBRemote::HandlePacket_QSetDetachOnError (const char *p) +{ + p += sizeof ("QSetDetachOnError:") - 1; + bool should_detach = true; + switch (*p) + { + case '0': should_detach = false; break; + case '1': should_detach = true; break; + default: + return HandlePacket_ILLFORMED (__FILE__, __LINE__, p, "Invalid value for QSetDetachOnError - should be 0 or 1"); + break; + } + + m_ctx.SetDetachOnError(should_detach); + return SendPacket ("OK"); +} + +rnb_err_t RNBRemote::HandlePacket_QListThreadsInStopReply (const char *p) { // If this packet is received, it allows us to send an extra key/value diff --git a/lldb/tools/debugserver/source/RNBRemote.h b/lldb/tools/debugserver/source/RNBRemote.h index fb2ec1278c3..1622ba1e592 100644 --- a/lldb/tools/debugserver/source/RNBRemote.h +++ b/lldb/tools/debugserver/source/RNBRemote.h @@ -126,6 +126,7 @@ public: save_register_state, // '_g' restore_register_state, // '_G' speed_test, // 'qSpeedTest:' + set_detach_on_error, // 'QSetDetachOnError:' unknown_type } PacketEnum; @@ -234,6 +235,7 @@ public: rnb_err_t HandlePacket_WatchpointSupportInfo (const char *p); rnb_err_t HandlePacket_qSpeedTest (const char *p); rnb_err_t HandlePacket_stop_process (const char *p); + rnb_err_t HandlePacket_QSetDetachOnError (const char *p); rnb_err_t SendStopReplyPacketForThread (nub_thread_t tid); rnb_err_t SendHexEncodedBytePacket (const char *header, const void *buf, size_t buf_len, const char *footer); |