Commit 1baca8e7 authored by hjk's avatar hjk

Debugger: Add dumper for Qt3's (sic!) QString

Change-Id: I24d266587425a5c50ec3dcb548a29877730cbdff
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent fa8d52cd
......@@ -449,7 +449,7 @@ class DumperBase:
data = data & 0xffffffff
else:
data = data & 0xffffffffffffffff
else:
elif self.qtVersion() >= 0x040000:
# Data:
# - QBasicAtomicInt ref;
# - int alloc, size;
......@@ -458,6 +458,15 @@ class DumperBase:
alloc = self.extractInt(addr + 4)
size = self.extractInt(addr + 8)
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
# addr is the begin of a QByteArrayData structure
......
......@@ -1501,8 +1501,16 @@ class Dumper(DumperBase):
pass
try:
# Seemingly needed with Debian's GDB 7.4.1
# Last fall backs.
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")]
if len(ns):
self.qtNamespaceToReport = ns
......
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