diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 02c1152e0d030b6632d70ad19a59a44d34f468e8..f48953178904ffb1ff23e8823dda96229cbf0c50 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -452,9 +452,17 @@ static inline QVariant editValue(const WatchData &d) default: break; } - // Replace newlines, which will cause line edit troubles. + // Some string value: '0x434 "Hallo"': + // Remove quotes and replace newlines, which will cause line edit troubles. QString stringValue = d.value; - stringValue.replace(QLatin1String("\n"), QLatin1String("\\n")); + if (stringValue.endsWith(QLatin1Char('"'))) { + const int leadingDoubleQuote = stringValue.indexOf(QLatin1Char('"')); + if (leadingDoubleQuote != stringValue.size() - 1) { + stringValue.truncate(stringValue.size() - 1); + stringValue.remove(0, leadingDoubleQuote + 1); + stringValue.replace(QLatin1String("\n"), QLatin1String("\\n")); + } + } return QVariant(stringValue); }