summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorhjk <hjk121@nokiamail.com>2013-10-24 12:16:26 +0200
committerhjk <hjk121@nokiamail.com>2013-10-24 12:26:17 +0200
commitfc4a953bb50c1e80c0bd9ef4f0c20c7ae929c4b5 (patch)
tree24505115f134187a8ab28a828c704325ceb58c95 /src/plugins
parent46c1769e24d5cad7de89f62ec57244d4d5f2fe66 (diff)
downloadqt-creator-fc4a953bb50c1e80c0bd9ef4f0c20c7ae929c4b5.tar.gz
Debugger: Simplify LLDB communication protocol
Produce proper JSON directly. Change-Id: I61aaba021fd4893fb521251c9b4b9572c2beef44 Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/debugger/lldb/lldbengine.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp
index f631663123..551d660a53 100644
--- a/src/plugins/debugger/lldb/lldbengine.cpp
+++ b/src/plugins/debugger/lldb/lldbengine.cpp
@@ -110,8 +110,8 @@ void LldbEngine::runCommand(const Command &command)
QTC_ASSERT(m_lldbProc.state() == QProcess::Running, notifyEngineIll());
++m_lastToken;
QByteArray token = QByteArray::number(m_lastToken);
- QByteArray cmd = "db {'cmd':'" + command.function + "',"
- + command.args + "'token':" + token + "}\n";
+ QByteArray cmd = "{\"cmd\":\"" + command.function + "\","
+ + command.args + "\"token\":" + token + "}\n";
showMessage(_(token + cmd), LogInput);
m_lldbProc.write(cmd);
}
@@ -156,7 +156,7 @@ void LldbEngine::setupEngine()
m_lldbProc.start(_("python"), args);
if (!m_lldbProc.waitForStarted()) {
- const QString msg = tr("Unable to start LLDB '%1': %2")
+ const QString msg = tr("Unable to start LLDB \"%1\": %2")
.arg(m_lldbCmd, m_lldbProc.errorString());
notifyEngineSetupFailed();
showMessage(_("ADAPTER START FAILED"));
@@ -645,7 +645,7 @@ bool LldbEngine::setToolTipExpression(const QPoint &mousePos,
}
if (!hasLetterOrNumber(exp)) {
- QToolTip::showText(m_toolTipPos, tr("'%1' contains no identifier.").arg(exp));
+ QToolTip::showText(m_toolTipPos, tr("\"%1\" contains no identifier.").arg(exp));
return true;
}
@@ -665,7 +665,7 @@ bool LldbEngine::setToolTipExpression(const QPoint &mousePos,
if (hasSideEffects(exp)) {
QToolTip::showText(m_toolTipPos,
- tr("Cowardly refusing to evaluate expression '%1' "
+ tr("Cowardly refusing to evaluate expression \"%1\" "
"with potential side effects.").arg(exp));
return true;
}
@@ -794,7 +794,7 @@ QString LldbEngine::errorMessage(QProcess::ProcessError error) const
switch (error) {
case QProcess::FailedToStart:
return tr("The LLDB process failed to start. Either the "
- "invoked program '%1' is missing, or you may have insufficient "
+ "invoked program \"%1\" is missing, or you may have insufficient "
"permissions to invoke the program.")
.arg(m_lldbCmd);
case QProcess::Crashed:
@@ -856,12 +856,12 @@ void LldbEngine::requestUpdateWatchers()
while (it.hasNext()) {
it.next();
QHash<QByteArray, QByteArray> hash;
- hash["iname"] = "'watch." + QByteArray::number(it.value()) + '\'';
- hash["exp"] = '\'' + it.key().toHex() + '\'';
+ hash["iname"] = "\"watch." + QByteArray::number(it.value()) + '"';
+ hash["exp"] = '"' + it.key().toHex() + '"';
watcherData.append(Command::toData(hash));
}
Command cmd("setWatchers");
- cmd.args.append("'watchers':" + Command::toData(watcherData) + ',');
+ cmd.args.append("\"watchers\":" + Command::toData(watcherData) + ',');
runCommand(cmd);
}
@@ -1117,9 +1117,9 @@ DebuggerEngine *createLldbEngine(const DebuggerStartParameters &startParameters)
const LldbEngine::Command &LldbEngine::Command::argHelper(const char *name, const QByteArray &data) const
{
- args.append('\'');
+ args.append('"');
args.append(name);
- args.append("':");
+ args.append("\":");
args.append(data);
args.append(",");
return *this;
@@ -1144,7 +1144,7 @@ QByteArray LldbEngine::Command::toData(const QHash<QByteArray, QByteArray> &valu
it.next();
if (!res.isEmpty())
res.append(',');
- res += '\'' + it.key() + "':" + it.value();
+ res += '"' + it.key() + "\":" + it.value();
}
return '{' + res + '}';
}
@@ -1176,20 +1176,20 @@ const LldbEngine::Command &LldbEngine::Command::arg(const char *name, const QByt
const LldbEngine::Command &LldbEngine::Command::arg(const char *name, const char *value) const
{
- args.append('\'');
+ args.append('"');
args.append(name);
- args.append("':'");
+ args.append("\":\"");
args.append(value);
- args.append("',");
+ args.append("\",");
return *this;
}
const LldbEngine::Command &LldbEngine::Command::beginList(const char *name) const
{
if (name) {
- args += '\'';
+ args += '"';
args += name;
- args += "':";
+ args += "\":";
}
args += '[';
return *this;
@@ -1205,9 +1205,9 @@ void LldbEngine::Command::endList() const
const LldbEngine::Command &LldbEngine::Command::beginGroup(const char *name) const
{
if (name) {
- args += '\'';
+ args += '"';
args += name;
- args += "':";
+ args += "\":";
}
args += '{';
return *this;