aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2020-08-27 23:51:56 +0300
committerOrgad Shaneh <orgads@gmail.com>2020-08-28 09:24:01 +0000
commitb55cc282646427ec7021e7de7972c3f9e41768db (patch)
treeeebf1abdf9db577d828759d4bb214fe8ca76dbf5 /src
parentb41ea232332dd8d95140169e557aa8ad51770245 (diff)
LLDB: Append 2 newlines after commands
For some reason, sometimes LLDB misses the first character of the next command on Windows. Task-number: QTCREATORBUG-14539 Change-Id: Ide78e0a0aa64ea4cbcaf6b55a0acdd548a1fa46c Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/debugger/lldb/lldbengine.cpp15
-rw-r--r--src/plugins/debugger/lldb/lldbengine.h1
2 files changed, 12 insertions, 4 deletions
diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp
index 03c6bdf7fa..f7026b2815 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);
diff --git a/src/plugins/debugger/lldb/lldbengine.h b/src/plugins/debugger/lldb/lldbengine.h
index 6c5b3c2c21..e33db0e963 100644
--- a/src/plugins/debugger/lldb/lldbengine.h
+++ b/src/plugins/debugger/lldb/lldbengine.h
@@ -131,6 +131,7 @@ private:
void runCommand(const DebuggerCommand &cmd) override;
void debugLastCommand() override;
void handleAttachedToCore();
+ void executeCommand(const QByteArray &command);
private:
DebuggerCommand m_lastDebuggableCommand;