Debugger: Use Qt's JSON encoder for debugger protocol

The V4 debug service expects correct JSON as input and gdb, lldb, and
pdb expect Python object literals. There is a subset of JSON that is
also valid as Python object literals and we use that for the protocol
spoken with gdb, lldb, and pdb. The strings passed to CDB are tunneled
through JSON strings and converted to byte arrays before sending them.

Change-Id: I87319b5450e5c3c3b29c565b75cddaa612767611
Task-number: QTCREATORBUG-14931
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2015-09-14 13:40:35 +02:00
parent 7d3bb6fdee
commit d5707e0e32
8 changed files with 99 additions and 119 deletions

View File

@@ -84,6 +84,7 @@
#include <QProcess>
#include <QPushButton>
#include <QTemporaryFile>
#include <QJsonArray>
using namespace Core;
using namespace ProjectExplorer;
@@ -874,7 +875,7 @@ void GdbEngine::maybeHandleInferiorPidChanged(const QString &pid0)
void GdbEngine::runCommand(const DebuggerCommand &command)
{
QByteArray cmd = command.function + "({" + command.args + "})";
QByteArray cmd = command.function + "(" + command.argsToPython() + ")";
postCommand("python theDumper." + cmd, command.flags, command.callback);
}