summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-03-13 19:18:02 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-03-14 11:04:16 +0900
commit5f3515542b57fcc97d848f4aae7804711e0b485a (patch)
treee1f7f728abfc13681f2abb258bba9393da0d7dcd
parentee866ca59904077d6e69723d4f996e6bf571db7f (diff)
evas: Add more debug info to an ERR message (stack)
Also use eina_safety as those are safety checks. Helps with GDB (single breakpoint in eina_safety).
-rw-r--r--src/lib/evas/canvas/evas_stack.c40
1 files changed, 34 insertions, 6 deletions
diff --git a/src/lib/evas/canvas/evas_stack.c b/src/lib/evas/canvas/evas_stack.c
index 55a46b0be4..7cd8509208 100644
--- a/src/lib/evas/canvas/evas_stack.c
+++ b/src/lib/evas/canvas/evas_stack.c
@@ -142,6 +142,8 @@ evas_object_stack_above(Evas_Object *obj, Evas_Object *above)
142 efl_gfx_stack_above((Evas_Object *)obj, above); 142 efl_gfx_stack_above((Evas_Object *)obj, above);
143} 143}
144 144
145#define SERR(x, ...) EINA_SAFETY_ERROR(eina_slstr_printf(x, __VA_ARGS__))
146
145EOLIAN void 147EOLIAN void
146_efl_canvas_object_efl_gfx_stack_stack_above(Eo *eo_obj, Evas_Object_Protected_Data *obj, Efl_Gfx_Stack *eo_above) 148_efl_canvas_object_efl_gfx_stack_stack_above(Eo *eo_obj, Evas_Object_Protected_Data *obj, Efl_Gfx_Stack *eo_above)
147{ 149{
@@ -162,7 +164,11 @@ _efl_canvas_object_efl_gfx_stack_stack_above(Eo *eo_obj, Evas_Object_Protected_D
162 { 164 {
163 if (obj->smart.parent != above->smart.parent) 165 if (obj->smart.parent != above->smart.parent)
164 { 166 {
165 ERR("COMPLAIN! evas_object_stack_above(), %p not inside same smart as %p!", eo_obj, eo_above); 167 SERR("Invalid operation: object '%s' %p (parent: '%s' %p) not "
168 "inside same smart parent as above '%s' %p (parent '%s' %p)!",
169 efl_class_name_get(eo_obj), eo_obj, efl_class_name_get(obj->smart.parent),
170 obj->smart.parent, efl_class_name_get(eo_above), eo_above,
171 efl_class_name_get(above->smart.parent), above->smart.parent);
166 return; 172 return;
167 } 173 }
168 evas_object_smart_member_stack_above(eo_obj, eo_above); 174 evas_object_smart_member_stack_above(eo_obj, eo_above);
@@ -171,12 +177,21 @@ _efl_canvas_object_efl_gfx_stack_stack_above(Eo *eo_obj, Evas_Object_Protected_D
171 { 177 {
172 if (above->smart.parent) 178 if (above->smart.parent)
173 { 179 {
174 ERR("COMPLAIN! evas_object_stack_above(), %p stack above %p, but above has smart parent, obj does not", eo_obj, eo_above); 180 SERR("Invalid operation: '%s' %p has no parent but "
181 "above '%s' %p has parent '%s' %p!",
182 efl_class_name_get(eo_obj), eo_obj,
183 efl_class_name_get(eo_above), eo_above,
184 efl_class_name_get(above->smart.parent), above->smart.parent);
175 return; 185 return;
176 } 186 }
177 if (obj->layer != above->layer) 187 if (obj->layer != above->layer)
178 { 188 {
179 ERR("COMPLAIN! evas_object_stack_above(), %p stack above %p, not matching layers", eo_obj, eo_above); 189 SERR("Invalid operation: '%s' %p is on layer %d but "
190 "above '%s' %p is on mismatching layer %d!",
191 efl_class_name_get(eo_obj), eo_obj,
192 obj->layer ? (int) obj->layer->layer : -99999,
193 efl_class_name_get(eo_above), eo_above,
194 above->layer ? (int) above->layer->layer : -99999);
180 return; 195 return;
181 } 196 }
182 if (obj->in_layer) 197 if (obj->in_layer)
@@ -239,7 +254,11 @@ _efl_canvas_object_efl_gfx_stack_stack_below(Eo *eo_obj, Evas_Object_Protected_D
239 { 254 {
240 if (obj->smart.parent != below->smart.parent) 255 if (obj->smart.parent != below->smart.parent)
241 { 256 {
242 ERR("COMPLAIN! evas_object_stack_below(), %p not inside same smart as %p!", eo_obj, eo_below); 257 SERR("Invalid operation: object '%s' %p (parent: '%s' %p) not "
258 "inside same smart parent as below '%s' %p (parent '%s' %p)!",
259 efl_class_name_get(eo_obj), eo_obj, efl_class_name_get(obj->smart.parent),
260 obj->smart.parent, efl_class_name_get(eo_below), eo_below,
261 efl_class_name_get(below->smart.parent), below->smart.parent);
243 return; 262 return;
244 } 263 }
245 evas_object_smart_member_stack_below(eo_obj, eo_below); 264 evas_object_smart_member_stack_below(eo_obj, eo_below);
@@ -248,12 +267,21 @@ _efl_canvas_object_efl_gfx_stack_stack_below(Eo *eo_obj, Evas_Object_Protected_D
248 { 267 {
249 if (below->smart.parent) 268 if (below->smart.parent)
250 { 269 {
251 ERR("COMPLAIN! evas_object_stack_below(), %p stack below %p, but below has smart parent, obj does not", eo_obj, eo_below); 270 SERR("Invalid operation: object '%s' %p has no parent but "
271 "below '%s' %p has different parent '%s' %p!",
272 efl_class_name_get(eo_obj), eo_obj,
273 efl_class_name_get(eo_below), eo_below,
274 efl_class_name_get(below->smart.parent), below->smart.parent);
252 return; 275 return;
253 } 276 }
254 if (obj->layer != below->layer) 277 if (obj->layer != below->layer)
255 { 278 {
256 ERR("COMPLAIN! evas_object_stack_below(), %p stack below %p, not matching layers", eo_obj, eo_below); 279 SERR("Invalid operation: object '%s' %p is on layer %d but "
280 "below '%s' %p is on mismatching layer %d!",
281 efl_class_name_get(eo_obj), eo_obj,
282 obj->layer ? (int) obj->layer->layer : -99999,
283 efl_class_name_get(eo_below), eo_below,
284 below->layer ? (int) below->layer->layer : -99999);
257 return; 285 return;
258 } 286 }
259 if (obj->in_layer) 287 if (obj->in_layer)