Skip to content
Snippets Groups Projects
Commit ad8eec7e authored by hjk's avatar hjk
Browse files

debugger: escape '"' in GdbMi::toString()

Fixes an autotest failure.
parent c1124a4f
No related branches found
No related tags found
No related merge requests found
...@@ -211,6 +211,12 @@ void GdbMi::dumpChildren(QByteArray * str, bool multiline, int indent) const ...@@ -211,6 +211,12 @@ void GdbMi::dumpChildren(QByteArray * str, bool multiline, int indent) const
} }
} }
static QByteArray escaped(QByteArray ba)
{
ba.replace("\"", "\\\"");
return ba;
}
QByteArray GdbMi::toString(bool multiline, int indent) const QByteArray GdbMi::toString(bool multiline, int indent) const
{ {
QByteArray result; QByteArray result;
...@@ -221,13 +227,10 @@ QByteArray GdbMi::toString(bool multiline, int indent) const ...@@ -221,13 +227,10 @@ QByteArray GdbMi::toString(bool multiline, int indent) const
else else
result += "Invalid"; result += "Invalid";
break; break;
case Const: case Const:
if (!m_name.isEmpty()) if (!m_name.isEmpty())
result += m_name + "="; result += m_name + "=";
if (multiline) result += "\"" + escaped(m_data) + "\"";
result += "\"" + m_data + "\"";
else
result += "\"" + m_data + "\"";
break; break;
case Tuple: case Tuple:
if (!m_name.isEmpty()) if (!m_name.isEmpty())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment