14 #ifndef BERRYDEBUGUTIL_H_
15 #define BERRYDEBUGUTIL_H_
28 class DebugBreakpointManager;
29 struct IDebugObjectListener;
30 template <
class T>
class SmartPointer;
39 static void TraceObject(
const Object*);
40 static void TraceObject(
unsigned int traceId);
41 static void TraceClass(
const QString& className);
43 static void StopTracing(
unsigned int traceId);
44 static void StopTracing(
const Object* obj);
45 static void StopTracing(
const QString& className);
47 static bool IsTraced(
const Object*
object);
48 static bool IsTraced(
unsigned int traceId);
49 static bool IsTraced(
const QString& className);
51 static QSet<unsigned int> GetTracedObjects();
53 static const Object* GetObject(
unsigned int traceId);
55 static QList<unsigned int> GetSmartPointerIDs(
const Object* objectPointer,
const QList<unsigned int>& excludeList = QList<unsigned int>());
56 static QList<const Object*> GetRegisteredObjects();
58 static void PrintSmartPointerIDs(
const Object* objectPointer,
const QList<unsigned int>& excludeList = QList<unsigned int>());
60 static void ResetObjectSummary();
61 static bool PrintObjectSummary(
bool details =
false);
62 static bool PrintObjectSummary(
const QString& className,
bool details =
false);
67 static void SaveState(
const QDir& path);
68 static void RestoreState(
const QDir& path);
71 static unsigned int& GetSmartPointerCounter();
72 static void RegisterSmartPointer(
unsigned int smartPointerId,
const Object* objectPointer,
bool recordStack =
false);
73 static void UnregisterSmartPointer(
unsigned int smartPointerId,
const Object* objectPointer);
74 static void RegisterObject(
const Object* objectPointer);
75 static void UnregisterObject(
const Object* objectPointer);
80 static const QString DEBUG_UTIL_XML;
82 static const QString DEBUGUTIL_TAG;
83 static const QString TRACEOBJECT_TAG;
84 static const QString TRACECLASS_TAG;
86 static const QString ID_ATTR;
87 static const QString NAME_ATTR;
89 static bool GetPersistencePath(QDir& path);
91 static QHash<quint32, QList<unsigned int> > m_TraceIdToSmartPointerMap;
92 typedef QHash<quint32, const Object* > TraceIdToObjectType;
93 static TraceIdToObjectType m_TraceIdToObjectMap;
94 static QSet<unsigned int> m_TracedObjects;
95 static QSet<QString> m_TracedClasses;