diff options
author | Greg Clayton <gclayton@apple.com> | 2014-05-02 00:45:31 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2014-05-02 00:45:31 +0000 |
commit | f0066ad07fadc7c1386c65572e6d988dfd26610d (patch) | |
tree | bb4ae7aeedcca4c081697032a493465a2d21d42a | |
parent | 34a38d8efbde085814bbbb5d1d7c7fcb15897e42 (diff) | |
download | bcm5719-llvm-f0066ad07fadc7c1386c65572e6d988dfd26610d.tar.gz bcm5719-llvm-f0066ad07fadc7c1386c65572e6d988dfd26610d.zip |
Fixed CTRL+C related issues:
- CTRL+C wasn't clearing the command in lldb
- CTRL+C doesn't work in python macros in lldb
- Ctrl+C no longer interrupts the running process that you attach to
<rdar://problem/15949205>
<rdar://problem/16778652>
<rdar://problem/16774411>
llvm-svn: 207816
-rw-r--r-- | lldb/include/lldb/Core/ConnectionFileDescriptor.h | 9 | ||||
-rw-r--r-- | lldb/include/lldb/Core/IOHandler.h | 31 | ||||
-rw-r--r-- | lldb/include/lldb/Host/Editline.h | 11 | ||||
-rw-r--r-- | lldb/include/lldb/Interpreter/CommandInterpreter.h | 5 | ||||
-rw-r--r-- | lldb/include/lldb/Interpreter/ScriptInterpreterPython.h | 17 | ||||
-rw-r--r-- | lldb/include/lldb/lldb-enumerations.h | 3 | ||||
-rw-r--r-- | lldb/source/Core/Communication.cpp | 3 | ||||
-rw-r--r-- | lldb/source/Core/ConnectionFileDescriptor.cpp | 31 | ||||
-rw-r--r-- | lldb/source/Core/IOHandler.cpp | 55 | ||||
-rw-r--r-- | lldb/source/Host/common/Editline.cpp | 92 | ||||
-rw-r--r-- | lldb/source/Interpreter/CommandInterpreter.cpp | 19 | ||||
-rw-r--r-- | lldb/source/Interpreter/ScriptInterpreterPython.cpp | 37 | ||||
-rw-r--r-- | lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp | 1 | ||||
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | 1 | ||||
-rw-r--r-- | lldb/source/Target/Process.cpp | 3 |
15 files changed, 235 insertions, 83 deletions
diff --git a/lldb/include/lldb/Core/ConnectionFileDescriptor.h b/lldb/include/lldb/Core/ConnectionFileDescriptor.h index 15598c9b133..1546a16275e 100644 --- a/lldb/include/lldb/Core/ConnectionFileDescriptor.h +++ b/lldb/include/lldb/Core/ConnectionFileDescriptor.h @@ -77,6 +77,12 @@ public: uint16_t GetBoundPort (uint32_t timeout_sec); + lldb::ConnectionStatus + BytesAvailable (uint32_t timeout_usec, Error *error_ptr); + + bool + InterruptRead (); + protected: typedef enum @@ -91,9 +97,6 @@ protected: void CloseCommandPipe (); - - lldb::ConnectionStatus - BytesAvailable (uint32_t timeout_usec, Error *error_ptr); lldb::ConnectionStatus SocketListen (const char *host_and_port, Error *error_ptr); diff --git a/lldb/include/lldb/Core/IOHandler.h b/lldb/include/lldb/Core/IOHandler.h index ae5a9b45e2c..3b2580b8356 100644 --- a/lldb/include/lldb/Core/IOHandler.h +++ b/lldb/include/lldb/Core/IOHandler.h @@ -73,7 +73,7 @@ namespace lldb_private { // Called when CTRL+C is pressed which usually causes // Debugger::DispatchInputInterrupt to be called. - virtual void + virtual bool Interrupt () = 0; virtual void @@ -304,11 +304,22 @@ namespace lldb_private { virtual ConstString - GetControlSequence (char ch) + IOHandlerGetControlSequence (char ch) { return ConstString(); } + //------------------------------------------------------------------ + // Intercept the IOHandler::Interrupt() calls and do something. + // + // Return true if the interrupt was handled, false if the IOHandler + // should continue to try handle the interrupt itself. + //------------------------------------------------------------------ + virtual bool + IOHandlerInterrupt (IOHandler &io_handler) + { + return false; + } protected: Completion m_completion; // Support for common builtin completions bool m_io_handler_done; @@ -338,7 +349,7 @@ namespace lldb_private { } virtual ConstString - GetControlSequence (char ch) + IOHandlerGetControlSequence (char ch) { if (ch == 'd') return ConstString (m_end_line + "\n"); @@ -409,7 +420,7 @@ namespace lldb_private { virtual void Cancel (); - virtual void + virtual bool Interrupt (); virtual void @@ -425,7 +436,7 @@ namespace lldb_private { virtual ConstString GetControlSequence (char ch) { - return m_delegate.GetControlSequence (ch); + return m_delegate.IOHandlerGetControlSequence (ch); } virtual const char * @@ -435,10 +446,10 @@ namespace lldb_private { SetPrompt (const char *prompt); bool - GetLine (std::string &line); + GetLine (std::string &line, bool &interrupted); bool - GetLines (StringList &lines); + GetLines (StringList &lines, bool &interrupted); void SetBaseLineNumber (uint32_t line); @@ -523,7 +534,7 @@ namespace lldb_private { virtual void Cancel (); - virtual void + virtual bool Interrupt (); virtual void @@ -557,8 +568,8 @@ namespace lldb_private { virtual void Refresh (); - virtual void - Interrupt (); + virtual bool + HandleInterrupt (); virtual void GotEOF(); diff --git a/lldb/include/lldb/Host/Editline.h b/lldb/include/lldb/Host/Editline.h index a2cdb0c8c0a..2f0b18a9799 100644 --- a/lldb/include/lldb/Host/Editline.h +++ b/lldb/include/lldb/Host/Editline.h @@ -23,6 +23,7 @@ #include <string> #include <vector> +#include "lldb/Core/ConnectionFileDescriptor.h" #include "lldb/Host/Condition.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/Mutex.h" @@ -70,10 +71,13 @@ public: ~Editline(); Error - GetLine (std::string &line); + GetLine (std::string &line, + bool &interrupted); Error - GetLines (const std::string &end_line, StringList &lines); + GetLines (const std::string &end_line, + StringList &lines, + bool &interrupted); bool LoadHistory (); @@ -102,7 +106,7 @@ public: void Refresh(); - void + bool Interrupt (); void @@ -203,6 +207,7 @@ private: uint32_t m_line_offset; uint32_t m_lines_curr_line; uint32_t m_lines_max_line; + ConnectionFileDescriptor m_file; bool m_prompt_with_line_numbers; bool m_getting_line; bool m_got_eof; // Set to true when we detect EOF diff --git a/lldb/include/lldb/Interpreter/CommandInterpreter.h b/lldb/include/lldb/Interpreter/CommandInterpreter.h index 125a123b676..3ce8b76a329 100644 --- a/lldb/include/lldb/Interpreter/CommandInterpreter.h +++ b/lldb/include/lldb/Interpreter/CommandInterpreter.h @@ -479,12 +479,15 @@ protected: std::string &line); virtual ConstString - GetControlSequence (char ch) + IOHandlerGetControlSequence (char ch) { if (ch == 'd') return ConstString("quit\n"); return ConstString(); } + + virtual bool + IOHandlerInterrupt (IOHandler &io_handler); size_t GetProcessOutput (); diff --git a/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h b/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h index fb4b404cbfd..3b2758e33c1 100644 --- a/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h +++ b/lldb/include/lldb/Interpreter/ScriptInterpreterPython.h @@ -24,6 +24,8 @@ #include "lldb/Interpreter/PythonDataObjects.h" #include "lldb/Host/Terminal.h" +class IOHandlerPythonInterpreter; + namespace lldb_private { class ScriptInterpreterPython : @@ -282,6 +284,19 @@ public: } + PyThreadState * + GetThreadState() + { + return m_command_thread_state; + } + + void + SetThreadState (PyThreadState *s) + { + if (s) + m_command_thread_state = s; + } + //---------------------------------------------------------------------- // IOHandlerDelegate //---------------------------------------------------------------------- @@ -399,7 +414,7 @@ public: // FILE* m_tmp_fh; PyGILState_STATE m_GILState; }; -private: +protected: enum ActiveIOHandler { eIOHandlerNone, diff --git a/lldb/include/lldb/lldb-enumerations.h b/lldb/include/lldb/lldb-enumerations.h index ecee7c67a99..54421ca726a 100644 --- a/lldb/include/lldb/lldb-enumerations.h +++ b/lldb/include/lldb/lldb-enumerations.h @@ -209,7 +209,8 @@ namespace lldb { eConnectionStatusError, // Check GetError() for details eConnectionStatusTimedOut, // Request timed out eConnectionStatusNoConnection, // No connection - eConnectionStatusLostConnection // Lost connection while connected to a valid connection + eConnectionStatusLostConnection, // Lost connection while connected to a valid connection + eConnectionStatusInterrupted // Interrupted read } ConnectionStatus; typedef enum ErrorType diff --git a/lldb/source/Core/Communication.cpp b/lldb/source/Core/Communication.cpp index f05ce320b5b..20231c4506b 100644 --- a/lldb/source/Core/Communication.cpp +++ b/lldb/source/Core/Communication.cpp @@ -382,6 +382,8 @@ Communication::ReadThread (lldb::thread_arg_t p) break; case eConnectionStatusNoConnection: // No connection case eConnectionStatusLostConnection: // Lost connection while connected to a valid connection + case eConnectionStatusInterrupted: // Interrupted + done = true; // Fall through... case eConnectionStatusError: // Check GetError() for details @@ -433,6 +435,7 @@ Communication::ConnectionStatusAsCString (lldb::ConnectionStatus status) case eConnectionStatusNoConnection: return "no connection"; case eConnectionStatusLostConnection: return "lost connection"; case eConnectionStatusEndOfFile: return "end of file"; + case eConnectionStatusInterrupted: return "interrupted"; } static char unknown_state_string[64]; diff --git a/lldb/source/Core/ConnectionFileDescriptor.cpp b/lldb/source/Core/ConnectionFileDescriptor.cpp index fc1e9f2b535..31761d8864a 100644 --- a/lldb/source/Core/ConnectionFileDescriptor.cpp +++ b/lldb/source/Core/ConnectionFileDescriptor.cpp @@ -361,6 +361,14 @@ ConnectionFileDescriptor::Connect (const char *s, Error *error_ptr) return eConnectionStatusError; } +bool +ConnectionFileDescriptor::InterruptRead() +{ + if (m_pipe_write != -1 ) + return write (m_pipe_write, "i", 1) == 1; + return false; +} + ConnectionStatus ConnectionFileDescriptor::Disconnect (Error *error_ptr) { @@ -390,7 +398,7 @@ ConnectionFileDescriptor::Disconnect (Error *error_ptr) m_shutting_down = true; Mutex::Locker locker; - bool got_lock= locker.TryLock (m_mutex); + bool got_lock = locker.TryLock (m_mutex); if (!got_lock) { @@ -839,14 +847,19 @@ ConnectionFileDescriptor::BytesAvailable (uint32_t timeout_usec, Error *error_pt { bytes_read = ::read (pipe_fd, buffer, sizeof(buffer)); } while (bytes_read < 0 && errno == EINTR); - assert (bytes_read == 1 && buffer[0] == 'q'); - - if (log) - log->Printf("%p ConnectionFileDescriptor::BytesAvailable() got data: %*s from the command channel.", - static_cast<void*>(this), - static_cast<int>(bytes_read), buffer); - - return eConnectionStatusEndOfFile; + + switch (buffer[0]) + { + case 'q': + if (log) + log->Printf("%p ConnectionFileDescriptor::BytesAvailable() got data: %*s from the command channel.", + static_cast<void*>(this), + static_cast<int>(bytes_read), buffer); + return eConnectionStatusEndOfFile; + case 'i': + // Interrupt the current read + return eConnectionStatusInterrupted; + } } } } diff --git a/lldb/source/Core/IOHandler.cpp b/lldb/source/Core/IOHandler.cpp index 274363789a6..88c96fbb53f 100644 --- a/lldb/source/Core/IOHandler.cpp +++ b/lldb/source/Core/IOHandler.cpp @@ -378,11 +378,11 @@ IOHandlerEditline::~IOHandlerEditline () bool -IOHandlerEditline::GetLine (std::string &line) +IOHandlerEditline::GetLine (std::string &line, bool &interrupted) { if (m_editline_ap) { - return m_editline_ap->GetLine(line).Success(); + return m_editline_ap->GetLine(line, interrupted).Success(); } else { @@ -518,13 +518,13 @@ IOHandlerEditline::SetBaseLineNumber (uint32_t line) } bool -IOHandlerEditline::GetLines (StringList &lines) +IOHandlerEditline::GetLines (StringList &lines, bool &interrupted) { bool success = false; if (m_editline_ap) { std::string end_token; - success = m_editline_ap->GetLines(end_token, lines).Success(); + success = m_editline_ap->GetLines(end_token, lines, interrupted).Success(); } else { @@ -541,11 +541,19 @@ IOHandlerEditline::GetLines (StringList &lines) ::fprintf(out, "%u", m_base_line_number + (uint32_t)lines.GetSize()); } - if (GetLine(line)) + bool interrupted = false; + if (GetLine(line, interrupted)) { - lines.AppendString(line); - Error error; - lines_status = m_delegate.IOHandlerLinesUpdated(*this, lines, lines.GetSize() - 1, error); + if (interrupted) + { + lines_status = LineStatus::Done; + } + else + { + lines.AppendString(line); + Error error; + lines_status = m_delegate.IOHandlerLinesUpdated(*this, lines, lines.GetSize() - 1, error); + } } else { @@ -566,13 +574,21 @@ IOHandlerEditline::Run () std::string line; while (IsActive()) { + bool interrupted = false; if (m_multi_line) { StringList lines; - if (GetLines (lines)) + if (GetLines (lines, interrupted)) { - line = lines.CopyList(); - m_delegate.IOHandlerInputComplete(*this, line); + if (interrupted) + { + m_done = true; + } + else + { + line = lines.CopyList(); + m_delegate.IOHandlerInputComplete(*this, line); + } } else { @@ -581,9 +597,10 @@ IOHandlerEditline::Run () } else { - if (GetLine(line)) + if (GetLine(line, interrupted)) { - m_delegate.IOHandlerInputComplete(*this, line); + if (!interrupted) + m_delegate.IOHandlerInputComplete(*this, line); } else { @@ -628,11 +645,16 @@ IOHandlerEditline::Cancel () m_editline_ap->Interrupt (); } -void +bool IOHandlerEditline::Interrupt () { + // Let the delgate handle it first + if (m_delegate.IOHandlerInterrupt(*this)) + return true; + if (m_editline_ap) - m_editline_ap->Interrupt(); + return m_editline_ap->Interrupt(); + return false; } void @@ -5454,9 +5476,10 @@ IOHandlerCursesGUI::Cancel () { } -void +bool IOHandlerCursesGUI::Interrupt () { + return false; } diff --git a/lldb/source/Host/common/Editline.cpp b/lldb/source/Host/common/Editline.cpp index 293cedc8785..8374d7721ca 100644 --- a/lldb/source/Host/common/Editline.cpp +++ b/lldb/source/Host/common/Editline.cpp @@ -174,6 +174,7 @@ Editline::Editline (const char *prog, // prog can't be NULL m_line_offset (0), m_lines_curr_line (0), m_lines_max_line (0), + m_file (fileno(fin), false), m_prompt_with_line_numbers (false), m_getting_line (false), m_got_eof (false), @@ -190,6 +191,7 @@ Editline::Editline (const char *prog, // prog can't be NULL { m_editline = ::el_init("lldb-tmp", fin, fout, ferr); } + if (prompt && prompt[0]) SetPrompt (prompt); @@ -324,7 +326,7 @@ Editline::PrivateGetLine(std::string &line) llvm::StringRef line_ref (line_cstr); line_ref = line_ref.rtrim("\n\r"); - if (!line_ref.empty()) + if (!line_ref.empty() && !m_interrupted) { // We didn't strip the newlines, we just adjusted the length, and // we want to add the history item with the newlines @@ -345,9 +347,10 @@ Editline::PrivateGetLine(std::string &line) Error -Editline::GetLine(std::string &line) +Editline::GetLine(std::string &line, bool &interrupted) { Error error; + interrupted = false; line.clear(); // Set arrow key bindings for up and down arrows for single line @@ -371,6 +374,8 @@ Editline::GetLine(std::string &line) m_getting_line = false; } + interrupted = m_interrupted; + if (m_got_eof && line.empty()) { // Only set the error if we didn't get an error back from PrivateGetLine() @@ -397,9 +402,10 @@ Editline::Push (const char *bytes, size_t len) Error -Editline::GetLines(const std::string &end_line, StringList &lines) +Editline::GetLines(const std::string &end_line, StringList &lines, bool &interrupted) { Error error; + interrupted = false; if (m_getting_line) { error.SetErrorString("already getting a line"); @@ -436,6 +442,11 @@ Editline::GetLines(const std::string &end_line, StringList &lines) { line_status = LineStatus::Error; } + else if (m_interrupted) + { + interrupted = true; + line_status = LineStatus::Done; + } else { switch (m_lines_command) @@ -500,7 +511,7 @@ Editline::GetLines(const std::string &end_line, StringList &lines) // If we have a callback, call it one more time to let the // user know the lines are complete - if (m_line_complete_callback) + if (m_line_complete_callback && !interrupted) m_line_complete_callback (this, lines, UINT32_MAX, @@ -755,39 +766,65 @@ Editline::GetCharFromInputFileCallback (EditLine *e, char *c) Editline *editline = GetClientData (e); if (editline && editline->m_got_eof == false) { + FILE *f = editline->GetInputFile(); + if (f == NULL) + { + editline->m_got_eof = true; + return 0; + } + + while (1) { - errno = 0; - char ch = ::fgetc(editline->GetInputFile()); - if (ch == '\x04') + lldb::ConnectionStatus status = eConnectionStatusSuccess; + char ch = 0; + if (editline->m_file.Read(&ch, 1, UINT32_MAX, status, NULL)) { - // Only turn a CTRL+D into a EOF if we receive the - // CTRL+D an empty line, otherwise it will forward - // delete the character at the cursor - const LineInfo *line_info = ::el_line(e); - if (line_info != NULL && - line_info->buffer == line_info->cursor && - line_info->cursor == line_info->lastchar) + if (ch == '\x04') { - ch = EOF; - errno = 0; + // Only turn a CTRL+D into a EOF if we receive the + // CTRL+D an empty line, otherwise it will forward + // delete the character at the cursor + const LineInfo *line_info = ::el_line(e); + if (line_info != NULL && + line_info->buffer == line_info->cursor && + line_info->cursor == line_info->lastchar) + { + ch = EOF; + } } - } - - if (ch == EOF) - { - if (errno == EINTR) - continue; - else + + if (ch == EOF) { editline->m_got_eof = true; break; } + else + { + *c = ch; + return 1; + } } else { - *c = ch; - return 1; + switch (status) + { + case eConnectionStatusInterrupted: + editline->m_interrupted = true; + *c = '\n'; + return 1; + + case eConnectionStatusSuccess: // Success + break; + + case eConnectionStatusError: // Check GetError() for details + case eConnectionStatusTimedOut: // Request timed out + case eConnectionStatusEndOfFile: // End-of-file encountered + case eConnectionStatusNoConnection: // No connection + case eConnectionStatusLostConnection: // Lost connection while connected to a valid connection + editline->m_got_eof = true; + break; + } } } } @@ -813,10 +850,11 @@ Editline::Refresh() ::el_set (m_editline, EL_REFRESH); } -void +bool Editline::Interrupt () { m_interrupted = true; if (m_getting_line || m_lines_curr_line > 0) - el_insertstr(m_editline, "\n"); // True to force the line to complete itself so we get exit from el_gets() + return m_file.InterruptRead(); + return false; // Interrupt not handled as we weren't getting a line or lines } diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index aa400aa7ce7..929fbfb29c4 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -44,6 +44,7 @@ #include "lldb/Core/Debugger.h" #include "lldb/Core/Log.h" +#include "lldb/Core/State.h" #include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" #include "lldb/Core/Timer.h" @@ -3051,6 +3052,24 @@ CommandInterpreter::IOHandlerInputComplete (IOHandler &io_handler, std::string & } } +bool +CommandInterpreter::IOHandlerInterrupt (IOHandler &io_handler) +{ + ExecutionContext exe_ctx (GetExecutionContext()); + Process *process = exe_ctx.GetProcessPtr(); + + if (process) + { + StateType state = process->GetState(); + if (StateIsRunningState(state)) + { + process->Halt(); + return true; // Don't do any updating when we are running + } + } + return false; +} + void CommandInterpreter::GetLLDBCommandsFromIOHandler (const char *prompt, IOHandlerDelegate &delegate, diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index eb2e33b9f45..da84353fed4 100644 --- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp +++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp @@ -93,6 +93,13 @@ ScriptInterpreterPython::Locker::DoAcquireLock() m_GILState = PyGILState_Ensure(); if (log) log->Printf("Ensured PyGILState. Previous state = %slocked\n", m_GILState == PyGILState_UNLOCKED ? "un" : ""); + + // we need to save the thread state when we first start the command + // because we might decide to interrupt it while some action is taking + // place outside of Python (e.g. printing to screen, waiting for the network, ...) + // in that case, _PyThreadState_Current will be NULL - and we would be unable + // to set the asynchronous exception - not a desirable situation + m_python_interpreter->SetThreadState (_PyThreadState_Current); return true; } @@ -781,10 +788,27 @@ public: } - virtual void + virtual bool Interrupt () { - + Log *log (lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_SCRIPT)); + + PyThreadState* state = _PyThreadState_Current; + if (!state) + state = m_python->GetThreadState(); + if (state) + { + long tid = state->thread_id; + _PyThreadState_Current = state; + int num_threads = PyThreadState_SetAsyncExc(tid, PyExc_KeyboardInterrupt); + if (log) + log->Printf("ScriptInterpreterPython::NonInteractiveInputReaderCallback, eInputReaderInterrupt, tid = %ld, num_threads = %d, state = %p", + tid,num_threads,state); + } + else if (log) + log->Printf("ScriptInterpreterPython::NonInteractiveInputReaderCallback, eInputReaderInterrupt, state = NULL"); + + return false; } virtual void @@ -2433,15 +2457,6 @@ ScriptInterpreterPython::RunScriptBasedCommand(const char* impl_function, SynchronicityHandler synch_handler(debugger_sp, synchronicity); - // we need to save the thread state when we first start the command - // because we might decide to interrupt it while some action is taking - // place outside of Python (e.g. printing to screen, waiting for the network, ...) - // in that case, _PyThreadState_Current will be NULL - and we would be unable - // to set the asynchronous exception - not a desirable situation - m_command_thread_state = _PyThreadState_Current; - - //PythonInputReaderManager py_input(this); - ret_val = g_swig_call_command (impl_function, m_dictionary_name.c_str(), debugger_sp, diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp index 2e7aeb24f34..5c1c3284a35 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp @@ -259,6 +259,7 @@ CommunicationKDP::WaitForPacketWithTimeoutMicroSecondsNoLock (DataExtractor &pac { switch (status) { + case eConnectionStatusInterrupted: case eConnectionStatusTimedOut: timed_out = true; break; diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index ffc948da9e9..9630b06e233 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -321,6 +321,7 @@ GDBRemoteCommunication::WaitForPacketWithTimeoutMicroSecondsNoLock (StringExtrac switch (status) { case eConnectionStatusTimedOut: + case eConnectionStatusInterrupted: timed_out = true; break; case eConnectionStatusSuccess: diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 5ea6e966635..88ab4df5912 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -4935,7 +4935,7 @@ public: m_pipe_write.Write (&ch, n); } - virtual void + virtual bool Interrupt () { #ifdef _MSC_VER @@ -4953,6 +4953,7 @@ public: char ch = 'i'; // Send 'i' for interrupt m_pipe_write.Write (&ch, n); #endif + return true; } virtual void |