From bb892e64277da252d06d7e0a15bd983ea4970551 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 6 Jan 2021 11:15:05 +0100 Subject: [PATCH] CdbExt: correctly escape python messages Messages from python that contain a path like deprecation warnings contain backslashes. These unescaped backslashes result in parse errors on the creator side: "MI Parse Error, unrecognized backslash escape" Change-Id: Ic6eb6e1d95b18a653767a5b64030d755f6e8970a Reviewed-by: Christian Stenger --- src/libs/qtcreatorcdbext/pycdbextmodule.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/libs/qtcreatorcdbext/pycdbextmodule.cpp b/src/libs/qtcreatorcdbext/pycdbextmodule.cpp index 49eed21616c..6207667d4aa 100644 --- a/src/libs/qtcreatorcdbext/pycdbextmodule.cpp +++ b/src/libs/qtcreatorcdbext/pycdbextmodule.cpp @@ -446,12 +446,10 @@ std::string collectOutput() // Add a child to messages for every line. while (std::getline(pyStdout, line)) { // there are two kinds of messages we want to handle here: - if (line.find("bridgemessage=") == 0) { // preformatted gdmi bridgemessages from warn() + if (line.find("bridgemessage=") == 0) // preformatted gdmi bridgemessages from warn() ret << line << ','; - } else { // and a line of "normal" python output - replace(line, '"', '$'); // otherwise creators gdbmi parser would fail - ret << "line=\"" << line << "\","; - } + else // and a line of "normal" python output + ret << "line=\"" << gdbmiStringFormat(line) << "\","; } ret << "]," << results << "]"; results.clear();