summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@yahoo.com>2017-05-07 19:13:25 +0300
committerDaniel Zaoui <daniel.zaoui@yahoo.com>2017-05-07 19:13:25 +0300
commitf08223a99a1da40f21a623d8672b661e9c9e1af4 (patch)
tree3dff72694f28e0b0a197cd4a0ad0fc1df91688be
parent0fe8da41c90d9844ec5a34b57d0a84cdbf7d02ec (diff)
Remove Clouseau module
It has been moved to Clouseau repository
-rw-r--r--src/lib/CMakeLists.txt7
-rw-r--r--src/lib/clouseau_debug.c148
2 files changed, 0 insertions, 155 deletions
diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
index 262bad3..79398e1 100644
--- a/src/lib/CMakeLists.txt
+++ b/src/lib/CMakeLists.txt
@@ -13,7 +13,6 @@ include_directories(
13add_library(eolian_debug SHARED eolian_debug.c) 13add_library(eolian_debug SHARED eolian_debug.c)
14add_library(eo_debug SHARED eo_debug.c) 14add_library(eo_debug SHARED eo_debug.c)
15add_library(evas_debug SHARED evas_debug.c) 15add_library(evas_debug SHARED evas_debug.c)
16add_library(clouseau_debug SHARED clouseau_debug.c)
17 16
18target_link_libraries(eo_debug 17target_link_libraries(eo_debug
19 ${EINA_LIBRARIES} 18 ${EINA_LIBRARIES}
@@ -34,11 +33,6 @@ target_link_libraries(evas_debug
34 ${EVAS_LIBRARIES} 33 ${EVAS_LIBRARIES}
35 ) 34 )
36 35
37target_link_libraries(clouseau_debug
38 ${EINA_LIBRARIES}
39 ${EO_LIBRARIES}
40 )
41
42#INSTALL(FILES Eolian_Debug.h DESTINATION include/edebug) 36#INSTALL(FILES Eolian_Debug.h DESTINATION include/edebug)
43INSTALL(FILES Eo_Debug.h DESTINATION include/edebug) 37INSTALL(FILES Eo_Debug.h DESTINATION include/edebug)
44INSTALL(FILES Evas_Debug.h DESTINATION include/edebug) 38INSTALL(FILES Evas_Debug.h DESTINATION include/edebug)
@@ -46,4 +40,3 @@ INSTALL(FILES Evas_Debug.h DESTINATION include/edebug)
46INSTALL(TARGETS eo_debug LIBRARY DESTINATION lib) 40INSTALL(TARGETS eo_debug LIBRARY DESTINATION lib)
47INSTALL(TARGETS eolian_debug LIBRARY DESTINATION lib) 41INSTALL(TARGETS eolian_debug LIBRARY DESTINATION lib)
48INSTALL(TARGETS evas_debug LIBRARY DESTINATION lib) 42INSTALL(TARGETS evas_debug LIBRARY DESTINATION lib)
49INSTALL(TARGETS clouseau_debug LIBRARY DESTINATION lib)
diff --git a/src/lib/clouseau_debug.c b/src/lib/clouseau_debug.c
deleted file mode 100644
index 0a92b08..0000000
--- a/src/lib/clouseau_debug.c
+++ /dev/null
@@ -1,148 +0,0 @@
1#define _GNU_SOURCE
2#include <dlfcn.h>
3
4#include <Eo.h>
5
6#ifdef EAPI
7# undef EAPI
8#endif
9
10#ifdef _WIN32
11# ifdef DEBUG_BUILD
12# ifdef DLL_EXPORT
13# define EAPI __declspec(dllexport)
14# else
15# define EAPI
16# endif /* ! DLL_EXPORT */
17# else
18# define EAPI __declspec(dllimport)
19# endif /* ! DEBUG_BUILD */
20#else
21# ifdef __GNUC__
22# if __GNUC__ >= 4
23# define EAPI __attribute__ ((visibility("default")))
24# else
25# define EAPI
26# endif
27# else
28# define EAPI
29# endif
30#endif /* ! _WIN32 */
31
32static int _snapshot_do_op = EINA_DEBUG_OPCODE_INVALID;
33static int _snapshot_done_op = EINA_DEBUG_OPCODE_INVALID;
34static int _klids_get_op = EINA_DEBUG_OPCODE_INVALID;
35static int _eoids_get_op = EINA_DEBUG_OPCODE_INVALID;
36static int _obj_info_op = EINA_DEBUG_OPCODE_INVALID;
37static int _snapshot_objs_get_op = EINA_DEBUG_OPCODE_INVALID;
38
39static Eina_Debug_Error
40_snapshot_do_cb(Eina_Debug_Session *session, int srcid, void *buffer, int size)
41{
42 char *buf = alloca(sizeof(Eina_Debug_Packet_Header) + size);
43 Eina_Debug_Packet_Header *hdr = (Eina_Debug_Packet_Header *)buf;
44
45 hdr->size = sizeof(Eina_Debug_Packet_Header);
46 hdr->cid = srcid;
47 hdr->thread_id = 0;
48 hdr->opcode = _klids_get_op;
49 eina_debug_dispatch(session, buf);
50
51 hdr->size = sizeof(Eina_Debug_Packet_Header) + size;
52 if (size) memcpy(buf + sizeof(Eina_Debug_Packet_Header), buffer, size);
53 hdr->thread_id = 0xFFFFFFFF;
54 hdr->opcode = _snapshot_objs_get_op;
55 eina_debug_dispatch(session, buf);
56
57 eina_debug_session_send(session, srcid, _snapshot_done_op, NULL, 0);
58 return EINA_DEBUG_OK;
59}
60
61typedef struct
62{
63 Eina_Debug_Session *session;
64 char *buf;
65 uint64_t *kls;
66 int nb_kls;
67} _EoIds_Walk_Data;
68
69static Eina_Bool
70_eoids_walk_cb(void *_data, Eo *obj)
71{
72 _EoIds_Walk_Data *data = _data;
73 int i;
74 Eina_Bool klass_ok = EINA_FALSE;
75
76 for (i = 0; i < data->nb_kls && !klass_ok; i++)
77 {
78 if (efl_isa(obj, (Efl_Class *)data->kls[i])) klass_ok = EINA_TRUE;
79 }
80 if (!klass_ok && data->nb_kls) return EINA_TRUE;
81
82 uint64_t u64 = (uint64_t)obj;
83 memcpy(data->buf + sizeof(Eina_Debug_Packet_Header), &u64, sizeof(u64));
84 eina_debug_dispatch(data->session, data->buf);
85
86 return EINA_TRUE;
87}
88
89static Eina_Debug_Error
90_snapshot_objs_get_req_cb(Eina_Debug_Session *session, int srcid, void *buffer, int size)
91{
92 static Eina_Bool (*foo)(Eo_Debug_Object_Iterator_Cb, void *) = NULL;
93 _EoIds_Walk_Data data;
94
95 char *buf = alloca(sizeof(Eina_Debug_Packet_Header) + size);
96 Eina_Debug_Packet_Header *hdr = (Eina_Debug_Packet_Header *)buf;
97
98 hdr->size = sizeof(Eina_Debug_Packet_Header) + size;
99 if (size) memcpy(buf + sizeof(Eina_Debug_Packet_Header), buffer, size);
100 hdr->cid = srcid;
101 hdr->thread_id = 0;
102 hdr->opcode = _eoids_get_op;
103 eina_debug_dispatch(session, buf);
104
105 hdr->size = sizeof(Eina_Debug_Packet_Header) + sizeof(uint64_t);
106 hdr->cid = srcid;
107 hdr->thread_id = 0;
108 hdr->opcode = _obj_info_op;
109
110 data.session = session;
111 data.buf = buf;
112 data.kls = buffer;
113 data.nb_kls = size / sizeof(uint64_t);
114 if (!foo) foo = dlsym(RTLD_DEFAULT, "eo_debug_objects_iterate");
115 foo(_eoids_walk_cb, &data);
116
117 return EINA_DEBUG_OK;
118}
119
120static const Eina_Debug_Opcode _debug_ops[] =
121{
122 {"Clouseau/snapshot_do", &_snapshot_do_op, &_snapshot_do_cb},
123 {"Clouseau/snapshot/objs_get", &_snapshot_objs_get_op, &_snapshot_objs_get_req_cb},
124 {"Clouseau/snapshot_done", &_snapshot_done_op, NULL},
125 {"Eo/classes_ids_get", &_klids_get_op, NULL},
126 {"Eo/objects_ids_get", &_eoids_get_op, NULL},
127 {"Eolian/object/info_get", &_obj_info_op, NULL},
128 {NULL, NULL, NULL}
129};
130
131EAPI Eina_Bool
132clouseau_debug_init(void)
133{
134 eina_init();
135
136 eina_debug_opcodes_register(NULL, _debug_ops, NULL);
137
138 printf("%s - In\n", __FUNCTION__);
139 return EINA_TRUE;
140}
141
142EAPI Eina_Bool
143clouseau_debug_shutdown(void)
144{
145 eina_shutdown();
146
147 return EINA_TRUE;
148}