diff options
author | hjk <hjk@theqtcompany.com> | 2015-04-01 10:32:28 +0200 |
---|---|---|
committer | hjk <hjk@theqtcompany.com> | 2015-04-01 09:30:56 +0000 |
commit | c12593efc44b5e98a1c7d6c2561f4b67bdbf383f (patch) | |
tree | 2dd8e31c047a4b85605609e7735a91502430ee6b | |
parent | d4abde4cba3484a4e2fc50ab022d0f159d29d30a (diff) | |
download | qt-creator-c12593efc44b5e98a1c7d6c2561f4b67bdbf383f.tar.gz |
Debugger: Show unsigned chars as unsigned values
Task-number: QTCREATORBUG-13809
Change-Id: I5dbb85c44cdc801edee1f33bc0c0cf47ec9916a3
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
-rw-r--r-- | src/plugins/debugger/watchhandler.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 4ac3f32082..9ac7dbbeda 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -400,9 +400,9 @@ static QString reformatInteger(quint64 value, int format, int size, bool isSigne } // Format printable (char-type) characters -static QString reformatCharacter(int code, int format) +static QString reformatCharacter(int code, int format, bool isSigned) { - const QString codeS = reformatInteger(code, format, 1, true); + const QString codeS = reformatInteger(code, format, 1, isSigned); if (code < 0) // Append unsigned value. return codeS + QLatin1String(" / ") + reformatInteger(256 + code, format, 1, false); const QChar c = QChar(uint(code)); @@ -500,10 +500,12 @@ QString WatchItem::formattedValue() const const int format = itemFormat(); // Append quoted, printable character also for decimal. + // FIXME: This is unreliable. if (type.endsWith("char") || type.endsWith("QChar")) { bool ok; const int code = value.toInt(&ok); - return ok ? reformatCharacter(code, format) : value; + bool isUnsigned = type == "unsigned char" || type == "uchar"; + return ok ? reformatCharacter(code, format, !isUnsigned) : value; } if (format == HexadecimalIntegerFormat |