summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/kernel.h
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2015-01-31 14:55:40 -0200
committerGravatar Yuri Kunde Schlesner2015-02-02 15:37:03 -0200
commit869ec46683c508de5692eaace1a66e682f90b4de (patch)
tree23cd3b9b8f85d67cf74b174927e938c9ca53df55 /src/core/hle/kernel/kernel.h
parentKernel: Use separate Handle tables for CoreTiming userdata (diff)
downloadyuzu-869ec46683c508de5692eaace1a66e682f90b4de.tar.gz
yuzu-869ec46683c508de5692eaace1a66e682f90b4de.tar.xz
yuzu-869ec46683c508de5692eaace1a66e682f90b4de.zip
Kernel: Introduce unique Object ids for debugging
Diffstat (limited to 'src/core/hle/kernel/kernel.h')
-rw-r--r--src/core/hle/kernel/kernel.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h
index 9860479ac..5567780fe 100644
--- a/src/core/hle/kernel/kernel.h
+++ b/src/core/hle/kernel/kernel.h
@@ -67,6 +67,9 @@ public:
67 virtual ~Object() {} 67 virtual ~Object() {}
68 Handle GetHandle() const { return handle; } 68 Handle GetHandle() const { return handle; }
69 69
70 /// Returns a unique identifier for the object. For debugging purposes only.
71 unsigned int GetObjectId() const { return object_id; }
72
70 virtual std::string GetTypeName() const { return "[BAD KERNEL OBJECT TYPE]"; } 73 virtual std::string GetTypeName() const { return "[BAD KERNEL OBJECT TYPE]"; }
71 virtual std::string GetName() const { return "[UNKNOWN KERNEL OBJECT]"; } 74 virtual std::string GetName() const { return "[UNKNOWN KERNEL OBJECT]"; }
72 virtual Kernel::HandleType GetHandleType() const = 0; 75 virtual Kernel::HandleType GetHandleType() const = 0;
@@ -101,7 +104,10 @@ private:
101 friend void intrusive_ptr_add_ref(Object*); 104 friend void intrusive_ptr_add_ref(Object*);
102 friend void intrusive_ptr_release(Object*); 105 friend void intrusive_ptr_release(Object*);
103 106
107 static unsigned int next_object_id;
108
104 unsigned int ref_count = 0; 109 unsigned int ref_count = 0;
110 unsigned int object_id = next_object_id++;
105}; 111};
106 112
107// Special functions used by boost::instrusive_ptr to do automatic ref-counting 113// Special functions used by boost::instrusive_ptr to do automatic ref-counting