Commit fb2f3860 authored by ck's avatar ck
Browse files

Debugger: Updated QObjectSlot dumper for Qt 4.6.

The format of QObjectPrivate's senders list changed in version 4.6.
This change is now taken into account by the QObjectSlot and
QObjectSlotList dumpers.

Reviewed-by: hjk
parent eeb737c5
...@@ -203,17 +203,14 @@ const char *stdWideStringTypeUShortC = "std::basic_string<unsigned short,std::ch ...@@ -203,17 +203,14 @@ const char *stdWideStringTypeUShortC = "std::basic_string<unsigned short,std::ch
uint connectionType : 3; // 0 == auto, 1 == direct, 2 == queued, 4 == blocking uint connectionType : 3; // 0 == auto, 1 == direct, 2 == queued, 4 == blocking
QBasicAtomicPointer<int> argumentTypes; QBasicAtomicPointer<int> argumentTypes;
//senders linked list //senders linked list
//Connection *next; Connection *next;
//Connection **prev; Connection **prev;
}; };
typedef QList<Connection *> ConnectionList; typedef QList<Connection *> ConnectionList;
typedef ConnectionList SenderList; typedef Connection *SenderList;
const Connection &connectionAt(const ConnectionList &l, int i) { return *l.at(i); } const Connection &connectionAt(const ConnectionList &l, int i) { return *l.at(i); }
const QObject *senderAt(const SenderList &l, int i) { return l.at(i)->sender; }
// FIXME: 'method' is wrong
int signalAt(const SenderList &l, int i) { return l.at(i)->method; }
#endif #endif
class ObjectPrivate : public QObjectData class ObjectPrivate : public QObjectData
...@@ -2470,9 +2467,17 @@ static void qDumpQObjectSlot(QDumper &d) ...@@ -2470,9 +2467,17 @@ static void qDumpQObjectSlot(QDumper &d)
int numchild = 0; int numchild = 0;
const QObject *ob = reinterpret_cast<const QObject *>(d.data); const QObject *ob = reinterpret_cast<const QObject *>(d.data);
const ObjectPrivate *p = reinterpret_cast<const ObjectPrivate *>(dfunc(ob)); const ObjectPrivate *p = reinterpret_cast<const ObjectPrivate *>(dfunc(ob));
#if QT_VERSION >= 0x040600
int s = 0;
for (SenderList senderList = p->senders; senderList != 0;
senderList = senderList->next, ++s) {
const QObject *sender = senderList->sender;
int signal = senderList->method; // FIXME: 'method' is wrong.
#else
for (int s = 0; s != p->senders.size(); ++s) { for (int s = 0; s != p->senders.size(); ++s) {
const QObject *sender = senderAt(p->senders, s); const QObject *sender = senderAt(p->senders, s);
int signal = signalAt(p->senders, s); int signal = signalAt(p->senders, s);
#endif
const ConnectionList &connList = qConnectionList(sender, signal); const ConnectionList &connList = qConnectionList(sender, signal);
for (int i = 0; i != connList.size(); ++i) { for (int i = 0; i != connList.size(); ++i) {
const Connection &conn = connectionAt(connList, i); const Connection &conn = connectionAt(connList, i);
...@@ -2538,9 +2543,17 @@ static void qDumpQObjectSlotList(QDumper &d) ...@@ -2538,9 +2543,17 @@ static void qDumpQObjectSlotList(QDumper &d)
// count senders. expensive... // count senders. expensive...
int numchild = 0; int numchild = 0;
#if QT_VERSION >= 0x040600
int s = 0;
for (SenderList senderList = p->senders; senderList != 0;
senderList = senderList->next, ++s) {
const QObject *sender = senderList->sender;
int signal = senderList->method; // FIXME: 'method' is wrong.
#else
for (int s = 0; s != p->senders.size(); ++s) { for (int s = 0; s != p->senders.size(); ++s) {
const QObject *sender = senderAt(p->senders, s); const QObject *sender = senderAt(p->senders, s);
int signal = signalAt(p->senders, s); int signal = signalAt(p->senders, s);
#endif
const ConnectionList &connList = qConnectionList(sender, signal); const ConnectionList &connList = qConnectionList(sender, signal);
for (int c = 0; c != connList.size(); ++c) { for (int c = 0; c != connList.size(); ++c) {
const Connection &conn = connectionAt(connList, c); const Connection &conn = connectionAt(connList, c);
......
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