forked from qt-creator/qt-creator
debugger: fix display of signed data in arrays
This was a regression introduced with the block dumping for arrays. Change-Id: I9684fafeb27a9268a2558557f76d1092136975a4 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -69,9 +69,13 @@ Hex2EncodedInt1, \
|
||||
Hex2EncodedInt2, \
|
||||
Hex2EncodedInt4, \
|
||||
Hex2EncodedInt8, \
|
||||
Hex2EncodedUInt1, \
|
||||
Hex2EncodedUInt2, \
|
||||
Hex2EncodedUInt4, \
|
||||
Hex2EncodedUInt8, \
|
||||
Hex2EncodedFloat4, \
|
||||
Hex2EncodedFloat8 \
|
||||
= range(23)
|
||||
= range(27)
|
||||
|
||||
# Display modes
|
||||
StopDisplay, \
|
||||
@@ -498,6 +502,16 @@ def simpleEncoding(typeobj):
|
||||
if code == BoolCode or code == CharCode:
|
||||
return Hex2EncodedInt1
|
||||
if code == IntCode:
|
||||
if str(typeobj).find("unsigned") >= 0:
|
||||
if typeobj.sizeof == 1:
|
||||
return Hex2EncodedUInt1
|
||||
if typeobj.sizeof == 2:
|
||||
return Hex2EncodedUInt2
|
||||
if typeobj.sizeof == 4:
|
||||
return Hex2EncodedUInt4
|
||||
if typeobj.sizeof == 8:
|
||||
return Hex2EncodedUInt8
|
||||
else:
|
||||
if typeobj.sizeof == 1:
|
||||
return Hex2EncodedInt1
|
||||
if typeobj.sizeof == 2:
|
||||
|
||||
@@ -725,15 +725,27 @@ void decodeArray(QList<WatchData> *list, const WatchData &tmplate,
|
||||
{
|
||||
switch (encoding) {
|
||||
case Hex2EncodedInt1:
|
||||
decodeArrayHelper<uchar>(list, tmplate, rawData);
|
||||
decodeArrayHelper<signed char>(list, tmplate, rawData);
|
||||
break;
|
||||
case Hex2EncodedInt2:
|
||||
decodeArrayHelper<ushort>(list, tmplate, rawData);
|
||||
decodeArrayHelper<short>(list, tmplate, rawData);
|
||||
break;
|
||||
case Hex2EncodedInt4:
|
||||
decodeArrayHelper<uint>(list, tmplate, rawData);
|
||||
decodeArrayHelper<int>(list, tmplate, rawData);
|
||||
break;
|
||||
case Hex2EncodedInt8:
|
||||
decodeArrayHelper<qint64>(list, tmplate, rawData);
|
||||
break;
|
||||
case Hex2EncodedUInt1:
|
||||
decodeArrayHelper<uchar>(list, tmplate, rawData);
|
||||
break;
|
||||
case Hex2EncodedUInt2:
|
||||
decodeArrayHelper<ushort>(list, tmplate, rawData);
|
||||
break;
|
||||
case Hex2EncodedUInt4:
|
||||
decodeArrayHelper<uint>(list, tmplate, rawData);
|
||||
break;
|
||||
case Hex2EncodedUInt8:
|
||||
decodeArrayHelper<quint64>(list, tmplate, rawData);
|
||||
break;
|
||||
case Hex2EncodedFloat4:
|
||||
|
||||
@@ -75,8 +75,12 @@ enum DebuggerEncoding
|
||||
Hex2EncodedInt2 = 18,
|
||||
Hex2EncodedInt4 = 19,
|
||||
Hex2EncodedInt8 = 20,
|
||||
Hex2EncodedFloat4 = 21,
|
||||
Hex2EncodedFloat8 = 22
|
||||
Hex2EncodedUInt1 = 21,
|
||||
Hex2EncodedUInt2 = 22,
|
||||
Hex2EncodedUInt4 = 23,
|
||||
Hex2EncodedUInt8 = 24,
|
||||
Hex2EncodedFloat4 = 25,
|
||||
Hex2EncodedFloat8 = 26
|
||||
};
|
||||
|
||||
bool isEditorDebuggable(Core::IEditor *editor);
|
||||
|
||||
Reference in New Issue
Block a user