forked from qt-creator/qt-creator
Debugger: Handle wchar_t* equally special as char*
Task-number: QTCREATORBUG-16034 Change-Id: Ic1aed8cef2d8eea9ceaf4123b0b0b7da08e6c86b Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com> Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -1043,13 +1043,24 @@ class DumperBase:
|
|||||||
|
|
||||||
# This is shared by pointer and array formatting.
|
# This is shared by pointer and array formatting.
|
||||||
def tryPutSimpleFormattedPointer(self, value, typeName, innerTypeName, displayFormat, limit):
|
def tryPutSimpleFormattedPointer(self, value, typeName, innerTypeName, displayFormat, limit):
|
||||||
if displayFormat == AutomaticFormat and innerTypeName == "char":
|
if displayFormat == AutomaticFormat:
|
||||||
|
if innerTypeName == "char":
|
||||||
# Use Latin1 as default for char *.
|
# Use Latin1 as default for char *.
|
||||||
self.putType(typeName)
|
self.putType(typeName)
|
||||||
(elided, data) = self.encodeCArray(value, 1, limit)
|
(elided, data) = self.encodeCArray(value, 1, limit)
|
||||||
self.putValue(data, "latin1", elided=elided)
|
self.putValue(data, "latin1", elided=elided)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
if innerTypeName == "wchar_t":
|
||||||
|
self.putType(typeName)
|
||||||
|
charSize = self.lookupType('wchar_t').sizeof
|
||||||
|
(elided, data) = self.encodeCArray(value, charSize, limit)
|
||||||
|
if charSize == 2:
|
||||||
|
self.putValue(data, "utf16", elided=elided)
|
||||||
|
else:
|
||||||
|
self.putValue(data, "ucs4", elided=elided)
|
||||||
|
return True
|
||||||
|
|
||||||
if displayFormat == Latin1StringFormat:
|
if displayFormat == Latin1StringFormat:
|
||||||
self.putType(typeName)
|
self.putType(typeName)
|
||||||
(elided, data) = self.encodeCArray(value, 1, limit)
|
(elided, data) = self.encodeCArray(value, 1, limit)
|
||||||
|
Reference in New Issue
Block a user