Commit e108d6fe authored by hjk's avatar hjk

Debugger: Fix transport of negative signed chars

Change-Id: I9b25d4b8e4b68d9cef674581d1a42eb75e21ec56
Task-number: QTCREATORBUG-16353
Reviewed-by: default avatarDavid Schulz <david.schulz@theqtcompany.com>
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent 752c2cd6
......@@ -1025,7 +1025,7 @@ class Dumper(DumperBase):
self.putType(typeName)
if typeobj.sizeof == 1:
# Force unadorned value transport for char and Co.
self.putValue(int(value) & 0xff)
self.putValue(int(value))
else:
self.putValue(value)
self.putNumChild(0)
......
......@@ -4758,6 +4758,24 @@ void tst_Dumpers::dumper_data()
+ Check("a.#1.i", "42", "int") % LldbEngine
+ Check("a.#2.f", ff, "float") % LldbEngine;
QTest::newRow("Chars")
<< Data("#include <qglobal.h>\n",
"char c = -12;\n"
"signed char sc = -12;\n"
"unsigned char uc = -12;\n"
"qint8 qs = -12;\n"
"quint8 qu = -12;\n"
"unused(&c, &sc, &uc, &qs, &qu);\n")
+ Check("c", "-12", "char") // on all our platforms char is signed.
+ Check("sc", "-12", "signed char") % NoCdbEngine
+ Check("sc", "-12", "char") % CdbEngine
+ Check("uc", "244", "unsigned char")
+ Check("qs", "-12", "@qint8") % NoCdbEngine
+ Check("qs", "-12", "char") % CdbEngine
+ Check("qu", "244", "@quint8") % NoCdbEngine
+ Check("qu", "244", "unsigned char") % CdbEngine;
QTest::newRow("CharArrays")
<< Data("char s[] = \"aöa\";\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment