summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-09-16 18:51:22 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-09-16 18:51:22 +0900
commit60f84b733abd1f77d0f8c89f8b3af0ec72dd0720 (patch)
tree06d1b576cf60705849bf92994684b2b2dfb555e5
parent802b14603802273d77e04a0b6b7017b49b314266 (diff)
downloadefl-60f84b733abd1f77d0f8c89f8b3af0ec72dd0720.tar.gz
eo - id lookup failure expansive error print for ebbter debug
whenan eoid lookup fails, now print a lot of information on the issue like the actual id, generation of the id, if its a class or object (the class bit), if its ref or super bit is set, the actual id (which includes the table heirachy), which thread id it is, what domain the object id is and the current and local domains as well as what domains are mapped in.
-rw-r--r--src/lib/eo/eo_ptr_indirection.c36
1 files changed, 34 insertions, 2 deletions
diff --git a/src/lib/eo/eo_ptr_indirection.c b/src/lib/eo/eo_ptr_indirection.c
index 96ee0de3c0..d9a927dded 100644
--- a/src/lib/eo/eo_ptr_indirection.c
+++ b/src/lib/eo/eo_ptr_indirection.c
@@ -17,6 +17,39 @@ _eo_pointer_error(const char *msg)
ERR("%s", msg);
}
+#ifdef HAVE_EO_ID
+static void
+_eo_obj_pointer_invalid(const Eo_Id obj_id,
+ Eo_Id_Data *data,
+ unsigned char domain)
+{
+ const char *type = "object";
+ if (obj_id & ((Eo_Id)1 << (REF_TAG_SHIFT - 1))) type = "class";
+ ERR("EOID %p is not a valid %s. "
+ "EOID domain=%i, current_domain=%i, local_domain=%i. "
+ "EOID generation=%lx, id=%lx, ref=%i, super=%i. "
+ "Thread self=%lu. "
+ "Available domains [%s %s %s %s]. "
+ "Maybe it has been deleted or does not belong to your thread?",
+
+ (void *)obj_id,
+ type,
+ (int)domain,
+ (int)data->domain_stack[data->stack_top],
+ (int)data->local_domain,
+ (unsigned long)(obj_id & MASK_GENERATIONS),
+ (unsigned long)(obj_id >> SHIFT_ENTRY_ID) & (MAX_ENTRY_ID | MAX_TABLE_ID | MAX_MID_TABLE_ID),
+ (int)(obj_id >> REF_TAG_SHIFT) & 0x1,
+ (int)(obj_id >> SUPER_TAG_SHIFT) & 0x1,
+ (unsigned long)eina_thread_self(),
+ (data->tables[0]) ? "0" : " ",
+ (data->tables[1]) ? "1" : " ",
+ (data->tables[2]) ? "2" : " ",
+ (data->tables[3]) ? "3" : " "
+ );
+}
+#endif
+
_Eo_Object *
_eo_obj_pointer_get(const Eo_Id obj_id)
{
@@ -119,8 +152,7 @@ err_null:
return NULL;
err_invalid:
err:
- ERR("obj_id %p is not a valid object. Maybe it has been freed or does not belong to your thread?",
- (void *)obj_id);
+ _eo_obj_pointer_invalid(obj_id, data, domain);
return NULL;
#else
return (_Eo_Object *) obj_id;