Debugger: Hex-Encode LLDB disassembler comment fields

They may contain quotes and possibly other data breaking the transport
protocol.

Change-Id: I53795bd1de54385e8d9c50088368fdc768db217b
Task-number: QTCREATORBUG-15635
Reviewed-by: Alexandru Croitor <alexandru.croitor@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
hjk
2016-04-13 19:37:31 +02:00
parent d0a6f70380
commit 9425f28865
2 changed files with 2 additions and 2 deletions

View File

@@ -1732,7 +1732,7 @@ class Dumper(DumperBase):
rawData = insn.GetData(lldb.target).uint8s
result += ',rawdata="%s"' % ' '.join(["%02x" % x for x in rawData])
if comment:
result += ',comment="%s"' % comment
result += ',comment="%s"' % self.hexencode(comment)
result += ',offset="%s"}' % (loadAddr - base)
self.reportResult(result + ']', args)

View File

@@ -1016,7 +1016,7 @@ void LldbEngine::fetchDisassembler(DisassemblerAgent *agent)
dl.fileName = line["file"].toUtf8();
dl.function = line["function"].toUtf8();
dl.hunk = line["hunk"].toInt();
QByteArray comment = line["comment"].data();
QByteArray comment = QByteArray::fromHex(line["comment"].data());
if (!comment.isEmpty())
dl.data += QString::fromUtf8(" # " + comment);
result.appendLine(dl);