diff options
author | hjk <hjk@theqtcompany.com> | 2016-06-07 17:04:53 +0200 |
---|---|---|
committer | hjk <hjk@theqtcompany.com> | 2016-06-09 08:09:46 +0000 |
commit | 726b907cc356995b7a9c28ee8dc8b2f2314e9103 (patch) | |
tree | 3c7b9b8a4d6cdeb7ce8fc27fc9c7a8d711b147e3 /src/plugins/debugger/watchutils.cpp | |
parent | 3333352e3b78df0348502e981def87185f57b222 (diff) | |
download | qt-creator-726b907cc356995b7a9c28ee8dc8b2f2314e9103.tar.gz |
Debugger: Remove debuggerstringutils.h
With QT_RESTRICTED_CAST_FROM_ASCII making GdbMi etc operate on
QString is feasible again. Take this as opportunity to move
debugger encoding handling closer to a 'conversion on input and
output if needed, storage in QString only' scheme.
Change-Id: I2f10c9fa8a6c62c44f4e6682efe3769e9fba30f7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/debugger/watchutils.cpp')
-rw-r--r-- | src/plugins/debugger/watchutils.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/debugger/watchutils.cpp b/src/plugins/debugger/watchutils.cpp index a69f936c71..4dd6d69161 100644 --- a/src/plugins/debugger/watchutils.cpp +++ b/src/plugins/debugger/watchutils.cpp @@ -140,7 +140,7 @@ bool isLeavableFunction(const QString &funcName, const QString &fileName) return false; } -bool isLetterOrNumber(char c) +bool isLetterOrNumber(int c) { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') @@ -225,7 +225,7 @@ bool startsWithDigit(const QString &str) return !str.isEmpty() && str.at(0).isDigit(); } -QByteArray stripPointerType(QByteArray type) +QString stripPointerType(QString type) { if (type.endsWith('*')) type.chop(1); @@ -256,7 +256,7 @@ QString formatToolTipAddress(quint64 a) return "0x" + rc; } -QByteArray gdbQuoteTypes(const QByteArray &type) +QString gdbQuoteTypes(const QString &type) { // gdb does not understand sizeof(Core::IDocument*). // "sizeof('Core::IDocument*')" is also not acceptable, @@ -274,8 +274,8 @@ QByteArray gdbQuoteTypes(const QByteArray &type) if (isPointerType(type)) return gdbQuoteTypes(stripPointerType(type)) + '*'; - QByteArray accu; - QByteArray result; + QString accu; + QString result; int templateLevel = 0; const char colon = ':'; @@ -283,8 +283,8 @@ QByteArray gdbQuoteTypes(const QByteArray &type) const char lessThan = '<'; const char greaterThan = '>'; for (int i = 0; i != type.size(); ++i) { - const char c = type.at(i); - if (isLetterOrNumber(c) || c == '_' || c == colon || c == ' ') { + const QChar c = type.at(i); + if (isLetterOrNumber(c.unicode()) || c == '_' || c == colon || c == ' ') { accu += c; } else if (c == lessThan) { ++templateLevel; |