forked from qt-creator/qt-creator
Debugger: Fix display of wchar_t[]
Task-number: QTCREATORBUG-12492 Change-Id: I5668c0727a36a1529d28b36d0361922f7acb3083 Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
@@ -753,13 +753,19 @@ class DumperBase:
|
||||
self.putType(type)
|
||||
self.putNumChild(1)
|
||||
format = self.currentItemFormat()
|
||||
isDefault = format == None and str(innerType.unqualified()) == "char"
|
||||
if isDefault or format == 0 or format == 1 or format == 2:
|
||||
isDefault1 = format == None and str(innerType.unqualified()) == "char"
|
||||
isDefault2 = format == None and str(innerType.unqualified()) == "wchar_t"
|
||||
if isDefault1 or isDefault2 or format == 0 or format == 1 or format == 2:
|
||||
blob = self.readMemory(self.addressOf(value), type.sizeof)
|
||||
|
||||
if isDefault:
|
||||
if isDefault1:
|
||||
# Use Latin1 as default for char [].
|
||||
self.putValue(blob, Hex2EncodedLatin1)
|
||||
elif isDefault2:
|
||||
if type.sizeof == 2:
|
||||
self.putValue(blob, Hex4EncodedLittleEndian)
|
||||
else:
|
||||
self.putValue(blob, Hex8EncodedLittleEndian)
|
||||
elif format == 0:
|
||||
# Explicitly requested Latin1 formatting.
|
||||
self.putValue(blob, Hex2EncodedLatin1)
|
||||
|
||||
@@ -5352,7 +5352,11 @@ namespace basic {
|
||||
// Locals and Expressions view. It is only support on gdb with Python.
|
||||
|
||||
const char *s = "aöa";
|
||||
const char cs[] = "aöa";
|
||||
char cc[] = "aöa";
|
||||
const wchar_t *w = L"aöa";
|
||||
const wchar_t cw[] = L"aöa";
|
||||
wchar_t ww[] = L"aöa";
|
||||
QString u;
|
||||
BREAK_HERE;
|
||||
// Expand s.
|
||||
@@ -5372,7 +5376,7 @@ namespace basic {
|
||||
u = QString::fromUtf16((ushort *)w);
|
||||
|
||||
// Make sure to undo "Change Format".
|
||||
dummyStatement(s, w);
|
||||
dummyStatement(s, w, &ww, &cw, &cc, &cs);
|
||||
}
|
||||
|
||||
typedef void *VoidPtr;
|
||||
|
||||
Reference in New Issue
Block a user