diff options
author | hjk <qtc-committer@nokia.com> | 2009-08-26 16:49:05 +0200 |
---|---|---|
committer | con <qtc-committer@nokia.com> | 2009-08-26 17:33:03 +0200 |
commit | 91c9e66731578e7c84a39c4c050feccd24d47db1 (patch) | |
tree | 2d9de9cf5cc066b40369651ed6bbea232365cc01 | |
parent | fde1783b4780a29343196eff0a08ebe3f8be08ba (diff) |
debugger: fix dumpers for QSharedPointer and QWeakPointer for the isNull() case
(cherry picked from commit e195159f167e2058412f320108652a62c5301bd8)
-rw-r--r-- | share/qtcreator/gdbmacros/gdbmacros.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/share/qtcreator/gdbmacros/gdbmacros.cpp b/share/qtcreator/gdbmacros/gdbmacros.cpp index 5d2bc781ea..087e4c7e86 100644 --- a/share/qtcreator/gdbmacros/gdbmacros.cpp +++ b/share/qtcreator/gdbmacros/gdbmacros.cpp @@ -2612,6 +2612,14 @@ static void qDumpQSharedPointer(QDumper &d) const QSharedPointer<int> &ptr = *reinterpret_cast<const QSharedPointer<int> *>(d.data); + if (ptr.isNull()) { + d.putItem("value", "<null>"); + d.putItem("valuedisabled", "true"); + d.putItem("numchild", 0); + d.disarm(); + return; + } + if (isSimpleType(d.innertype)) qDumpInnerValueHelper(d, d.innertype, ptr.data()); else @@ -2768,6 +2776,15 @@ static void qDumpQWeakPointer(QDumper &d) { const int v = sizeof(void *); const void *value = deref(addOffset(d.data, v)); + const void *data = deref(d.data); + + if (value == 0 || data == 0) { + d.putItem("value", "<null>"); + d.putItem("valuedisabled", "true"); + d.putItem("numchild", 0); + d.disarm(); + return; + } if (isSimpleType(d.innertype)) qDumpInnerValueHelper(d, d.innertype, value); |