summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@yahoo.com>2017-03-16 13:12:00 +0200
committerDaniel Zaoui <daniel.zaoui@yahoo.com>2017-03-16 13:12:00 +0200
commit4442d186ab7976d1789c887435ada8ec9d6fdebc (patch)
tree18ae9c4e6ccee1d0b58a03af90d66237850b542e
parent7127027bf012d61e4e693841618bdedfd835a2d3 (diff)
Eo: classes retrieval can be done from the debug thread
-rw-r--r--src/lib/eo_debug.c30
1 files changed, 4 insertions, 26 deletions
diff --git a/src/lib/eo_debug.c b/src/lib/eo_debug.c
index 42edc9c..49cf681 100644
--- a/src/lib/eo_debug.c
+++ b/src/lib/eo_debug.c
@@ -24,14 +24,6 @@
24 _buf += sz; \ 24 _buf += sz; \
25} 25}
26 26
27typedef struct
28{
29 Eina_Debug_Session *session;
30 int srcid;
31 void *buffer;
32 int size;
33} _Main_Loop_Struct;
34
35static int _klids_get_op = EINA_DEBUG_OPCODE_INVALID; 27static int _klids_get_op = EINA_DEBUG_OPCODE_INVALID;
36static int _eoids_get_op = EINA_DEBUG_OPCODE_INVALID; 28static int _eoids_get_op = EINA_DEBUG_OPCODE_INVALID;
37 29
@@ -50,18 +42,16 @@ _klids_walk_cb(void *data, Efl_Class *kl)
50 return EINA_TRUE; 42 return EINA_TRUE;
51} 43}
52 44
53static void 45static Eina_Debug_Error
54_klids_cb(void *data) 46_klids_get(Eina_Debug_Session *session, int srcid, void *buffer EINA_UNUSED, int size EINA_UNUSED)
55{ 47{
56 static Eina_Bool (*foo)(Eo_Debug_Class_Iterator_Cb, void *) = NULL; 48 static Eina_Bool (*foo)(Eo_Debug_Class_Iterator_Cb, void *) = NULL;
57 _Main_Loop_Struct *s = data;
58 char *buf = alloca(10000), *current = buf; 49 char *buf = alloca(10000), *current = buf;
59 50
60 if (!foo) foo = dlsym(RTLD_DEFAULT, "eo_debug_classes_iterate"); 51 if (!foo) foo = dlsym(RTLD_DEFAULT, "eo_debug_classes_iterate");
61 foo(_klids_walk_cb, &current); 52 foo(_klids_walk_cb, &current);
62 eina_debug_session_send(s->session, s->srcid, _klids_get_op, buf, current - buf); 53 eina_debug_session_send(session, srcid, _klids_get_op, buf, current - buf);
63 54 return EINA_DEBUG_OK;
64 free(s);
65} 55}
66 56
67typedef struct 57typedef struct
@@ -122,18 +112,6 @@ _eoids_get(Eina_Debug_Session *session, int srcid, void *buffer, int size)
122 return EINA_DEBUG_OK; 112 return EINA_DEBUG_OK;
123} 113}
124 114
125static Eina_Debug_Error
126_klids_get(Eina_Debug_Session *session, int srcid, void *buffer, int size)
127{
128 _Main_Loop_Struct *s = malloc(sizeof(*s));
129 s->session = session;
130 s->srcid = srcid;
131 s->buffer = buffer;
132 s->size = size;
133 ecore_main_loop_thread_safe_call_async(_klids_cb, s);
134 return EINA_DEBUG_OK;
135}
136
137static const Eina_Debug_Opcode _debug_ops[] = 115static const Eina_Debug_Opcode _debug_ops[] =
138{ 116{
139 {"Eo/objects_ids_get", &_eoids_get_op, &_eoids_get}, 117 {"Eo/objects_ids_get", &_eoids_get_op, &_eoids_get},