summaryrefslogtreecommitdiff
path: root/src/lib/eo
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-06-22 12:06:31 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-06-22 13:19:23 +0900
commit5a98f78ce8c350b470dfd72ceac70392c68414b4 (patch)
tree6092d52a76993c214df17267952046fe74052ac3 /src/lib/eo
parenteaf21eee14c8de172dc5010fe68b529f5827ac65 (diff)
eo: Improve invalid EO ID error message
This focus on the domain and ID bits is very confusing. Let's keep it at the end of the message, and also try to guess whether the object may have been deleted or simply doesn't belong to the current thread.
Diffstat (limited to 'src/lib/eo')
-rw-r--r--src/lib/eo/eo_ptr_indirection.c52
1 files changed, 30 insertions, 22 deletions
diff --git a/src/lib/eo/eo_ptr_indirection.c b/src/lib/eo/eo_ptr_indirection.c
index 0dcb0b942f..01db8a289a 100644
--- a/src/lib/eo/eo_ptr_indirection.c
+++ b/src/lib/eo/eo_ptr_indirection.c
@@ -36,35 +36,43 @@ _eo_obj_pointer_invalid(const Eo_Id obj_id,
36 Eina_Thread thread = eina_thread_self(); 36 Eina_Thread thread = eina_thread_self();
37 const char *tself = "main"; 37 const char *tself = "main";
38 const char *type = "object"; 38 const char *type = "object";
39 const char *reason = "This ID has probably been deleted";
39 char tbuf[128]; 40 char tbuf[128];
40 if (obj_id & ((Eo_Id)1 << (REF_TAG_SHIFT - 1))) type = "class"; 41 if (obj_id & MASK_CLASS_TAG) type = "class";
41 if (thread != _efl_object_main_thread) 42 if (thread != _efl_object_main_thread)
42 { 43 {
43 snprintf(tbuf, sizeof(tbuf), "%p", (void *)thread); 44 snprintf(tbuf, sizeof(tbuf), "%p", (void *)thread);
44 tself = tbuf; 45 tself = tbuf;
45 } 46 }
47
48 if (!data->tables[(int)data->local_domain])
49 reason = "This ID does not seem to belong to this thread";
50 else if ((Efl_Id_Domain)domain == EFL_ID_DOMAIN_SHARED)
51 reason = "This shared ID has probably been deleted";
52
46 eina_log_print(_eo_log_dom, EINA_LOG_LEVEL_ERR, 53 eina_log_print(_eo_log_dom, EINA_LOG_LEVEL_ERR,
47 file, func_name, line, 54 file, func_name, line,
48 "EOID %p is not a valid %s. " 55 "Eo ID %p is not a valid %s. "
49 "EOID domain=%i, current_domain=%i, local_domain=%i. " 56 "Current thread: %s. "
50 "EOID generation=%lx, id=%lx, ref=%i. " 57 "%s or this was never a valid %s ID. "
51 "Thread self=%s. " 58 "(domain=%i, current_domain=%i, local_domain=%i, "
52 "Available domains [%s %s %s %s]. " 59 "available_domains=[%s %s %s %s], "
53 "Maybe it has been deleted or does not belong to your thread?", 60 "generation=%lx, id=%lx, ref=%i)",
54 (void *)obj_id, 61 (void *)obj_id,
55 type, 62 type,
56 (int)domain, 63 tself,
57 (int)data->domain_stack[data->stack_top], 64 reason,
58 (int)data->local_domain, 65 type,
59 (unsigned long)(obj_id & MASK_GENERATIONS), 66 (int)domain,
60 (unsigned long)(obj_id >> SHIFT_ENTRY_ID) & (MAX_ENTRY_ID | MAX_TABLE_ID | MAX_MID_TABLE_ID), 67 (int)data->domain_stack[data->stack_top],
61 (int)(obj_id >> REF_TAG_SHIFT) & 0x1, 68 (int)data->local_domain,
62 tself, 69 (data->tables[0]) ? "0" : " ",
63 (data->tables[0]) ? "0" : " ", 70 (data->tables[1]) ? "1" : " ",
64 (data->tables[1]) ? "1" : " ", 71 (data->tables[2]) ? "2" : " ",
65 (data->tables[2]) ? "2" : " ", 72 (data->tables[3]) ? "3" : " ",
66 (data->tables[3]) ? "3" : " " 73 (unsigned long)(obj_id & MASK_GENERATIONS),
67 ); 74 (unsigned long)(obj_id >> SHIFT_ENTRY_ID) & (MAX_ENTRY_ID | MAX_TABLE_ID | MAX_MID_TABLE_ID),
75 (int)(obj_id >> REF_TAG_SHIFT) & 0x1);
68 _eo_log_obj_report(obj_id, EINA_LOG_LEVEL_ERR, func_name, file, line); 76 _eo_log_obj_report(obj_id, EINA_LOG_LEVEL_ERR, func_name, file, line);
69} 77}
70 78