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>
This commit is contained in:
hjk
2016-06-07 17:04:53 +02:00
parent 3333352e3b
commit 726b907cc3
67 changed files with 1993 additions and 2168 deletions

View File

@@ -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;