Debugger: Hex-encode LLDB disassembler source lines for transport

Unescaped quotes break the protocol.

Task-number: QTCREATORBUG-18721
Change-Id: I235c4dc33e599769bc854423ef4a7dc6f46bf58e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
hjk
2017-08-11 18:02:49 +02:00
parent 885f8b5385
commit 90de4bae40
2 changed files with 2 additions and 1 deletions

View File

@@ -1649,7 +1649,7 @@ class Dumper(DumperBase):
result += '{line="%s"' % lineNumber
result += ',file="%s"' % fileName
if 0 < lineNumber and lineNumber <= len(source):
result += ',data="%s"' % source[lineNumber - 1]
result += ',hexdata="%s"' % self.hexencode(source[lineNumber - 1])
result += ',hunk="%s"}' % hunk
result += '{address="%s"' % loadAddr
result += ',data="%s %s"' % (insn.GetMnemonic(self.target),

View File

@@ -1019,6 +1019,7 @@ void LldbEngine::fetchDisassembler(DisassemblerAgent *agent)
dl.data = line["rawdata"].data();
if (!dl.data.isEmpty())
dl.data += QString(30 - dl.data.size(), QLatin1Char(' '));
dl.data += fromHex(line["hexdata"].data());
dl.data += line["data"].data();
dl.offset = line["offset"].toInt();
dl.lineNumber = line["line"].toInt();