forked from qt-creator/qt-creator
Debugger: Add dumper for Qt3's (sic!) QString
Change-Id: I24d266587425a5c50ec3dcb548a29877730cbdff Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
@@ -449,7 +449,7 @@ class DumperBase:
|
|||||||
data = data & 0xffffffff
|
data = data & 0xffffffff
|
||||||
else:
|
else:
|
||||||
data = data & 0xffffffffffffffff
|
data = data & 0xffffffffffffffff
|
||||||
else:
|
elif self.qtVersion() >= 0x040000:
|
||||||
# Data:
|
# Data:
|
||||||
# - QBasicAtomicInt ref;
|
# - QBasicAtomicInt ref;
|
||||||
# - int alloc, size;
|
# - int alloc, size;
|
||||||
@@ -458,6 +458,15 @@ class DumperBase:
|
|||||||
alloc = self.extractInt(addr + 4)
|
alloc = self.extractInt(addr + 4)
|
||||||
size = self.extractInt(addr + 8)
|
size = self.extractInt(addr + 8)
|
||||||
data = self.extractPointer(addr + 8 + self.ptrSize())
|
data = self.extractPointer(addr + 8 + self.ptrSize())
|
||||||
|
else:
|
||||||
|
# Data:
|
||||||
|
# - QShared count;
|
||||||
|
# - QChar *unicode
|
||||||
|
# - char *ascii
|
||||||
|
# - uint len: 30
|
||||||
|
size = self.extractInt(addr + 3 * self.ptrSize()) & 0x3ffffff
|
||||||
|
alloc = size # pretend.
|
||||||
|
data = self.extractPointer(addr + self.ptrSize())
|
||||||
return data, size, alloc
|
return data, size, alloc
|
||||||
|
|
||||||
# addr is the begin of a QByteArrayData structure
|
# addr is the begin of a QByteArrayData structure
|
||||||
|
@@ -1501,8 +1501,16 @@ class Dumper(DumperBase):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Seemingly needed with Debian's GDB 7.4.1
|
# Last fall backs.
|
||||||
s = gdb.execute("ptype QByteArray", to_string=True)
|
s = gdb.execute("ptype QByteArray", to_string=True)
|
||||||
|
if s.find("QMemArray") >= 0:
|
||||||
|
# Qt 3.
|
||||||
|
self.qtNamespaceToReport = ""
|
||||||
|
self.qtNamespace = lambda: ""
|
||||||
|
self.qtVersion = lambda: 0x30308
|
||||||
|
self.fallbackQtVersion = 0x30308
|
||||||
|
return ""
|
||||||
|
# Seemingly needed with Debian's GDB 7.4.1
|
||||||
ns = s[s.find("class")+6:s.find("QByteArray")]
|
ns = s[s.find("class")+6:s.find("QByteArray")]
|
||||||
if len(ns):
|
if len(ns):
|
||||||
self.qtNamespaceToReport = ns
|
self.qtNamespaceToReport = ns
|
||||||
|
Reference in New Issue
Block a user