aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/debugger/lldb/lldbengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/debugger/lldb/lldbengine.cpp')
-rw-r--r--src/plugins/debugger/lldb/lldbengine.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp
index 03c6bdf7fa4..f7026b2815f 100644
--- a/src/plugins/debugger/lldb/lldbengine.cpp
+++ b/src/plugins/debugger/lldb/lldbengine.cpp
@@ -151,7 +151,7 @@ void LldbEngine::runCommand(const DebuggerCommand &command)
}
showMessage(msg, LogInput);
m_commandForToken[currentToken()] = cmd;
- m_lldbProc.write("script theDumper." + function.toUtf8() + "\n");
+ executeCommand("script theDumper." + function.toUtf8());
}
void LldbEngine::debugLastCommand()
@@ -168,6 +168,13 @@ void LldbEngine::handleAttachedToCore()
updateLocals();
}
+void LldbEngine::executeCommand(const QByteArray &command)
+{
+ // For some reason, sometimes LLDB misses the first character of the next command on Windows
+ // if passing only 1 LF.
+ m_lldbProc.write(command + "\n\n");
+}
+
void LldbEngine::shutdownInferior()
{
QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << state());
@@ -228,13 +235,13 @@ void LldbEngine::setupEngine()
const QByteArray dumperSourcePath =
ICore::resourcePath().toLocal8Bit() + "/debugger/";
- m_lldbProc.write("script sys.path.insert(1, '" + dumperSourcePath + "')\n");
+ executeCommand("script sys.path.insert(1, '" + dumperSourcePath + "')");
// This triggers reportState("enginesetupok") or "enginesetupfailed":
- m_lldbProc.write("script from lldbbridge import *\n");
+ executeCommand("script from lldbbridge import *");
QString commands = nativeStartupCommands();
if (!commands.isEmpty())
- m_lldbProc.write(commands.toLocal8Bit() + '\n');
+ executeCommand(commands.toLocal8Bit());
const QString path = stringSetting(ExtraDumperFile);