aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/qtcreatorcdbext
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2021-01-06 11:15:05 +0100
committerDavid Schulz <david.schulz@qt.io>2021-01-06 11:52:00 +0000
commitbb892e64277da252d06d7e0a15bd983ea4970551 (patch)
treec060b880debfce71188f177921e22f5088fd4e13 /src/libs/qtcreatorcdbext
parent03cc67abd197dd250e412107836799777d79c764 (diff)
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 <christian.stenger@qt.io>
Diffstat (limited to 'src/libs/qtcreatorcdbext')
-rw-r--r--src/libs/qtcreatorcdbext/pycdbextmodule.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/libs/qtcreatorcdbext/pycdbextmodule.cpp b/src/libs/qtcreatorcdbext/pycdbextmodule.cpp
index 49eed21616..6207667d4a 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();