summaryrefslogtreecommitdiffstats
path: root/lldb/tools/driver
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/tools/driver')
-rw-r--r--lldb/tools/driver/Driver.cpp7
-rw-r--r--lldb/tools/driver/IOChannel.cpp10
2 files changed, 13 insertions, 4 deletions
diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp
index ab69b24b947..9926149f3f9 100644
--- a/lldb/tools/driver/Driver.cpp
+++ b/lldb/tools/driver/Driver.cpp
@@ -1080,11 +1080,12 @@ Driver::EditLineInputReaderCallback
case eInputReaderInterrupt:
if (driver->m_io_channel_ap.get() != NULL)
{
- SBProcess process = driver->GetDebugger().GetSelectedTarget().GetProcess();
+ SBProcess process(driver->GetDebugger().GetSelectedTarget().GetProcess());
if (!driver->m_io_channel_ap->EditLineHasCharacters()
- && process.IsValid() && process.GetState() == lldb::eStateRunning)
+ && process.IsValid()
+ && (process.GetState() == lldb::eStateRunning || process.GetState() == lldb::eStateAttaching))
{
- process.Stop();
+ process.SendAsyncInterrupt ();
}
else
{
diff --git a/lldb/tools/driver/IOChannel.cpp b/lldb/tools/driver/IOChannel.cpp
index a553ff67fb6..b6d4224a790 100644
--- a/lldb/tools/driver/IOChannel.cpp
+++ b/lldb/tools/driver/IOChannel.cpp
@@ -55,7 +55,15 @@ IOChannel::EditLineHasCharacters ()
{
const LineInfo *line_info = el_line(m_edit_line);
if (line_info)
- return line_info->cursor != line_info->buffer;
+ {
+ // Sometimes we get called after the user has submitted the line, but before editline has
+ // cleared the buffer. In that case the cursor will be pointing at the newline. That's
+ // equivalent to having no characters on the line, since it has already been submitted.
+ if (*line_info->cursor == '\n')
+ return false;
+ else
+ return line_info->cursor != line_info->buffer;
+ }
else
return false;
}
OpenPOWER on IntegriCloud