From 726b907cc356995b7a9c28ee8dc8b2f2314e9103 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 7 Jun 2016 17:04:53 +0200 Subject: 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 --- src/plugins/debugger/watchutils.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/plugins/debugger/watchutils.cpp') 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; -- cgit v1.2.1