On Tue, Mar 14, 2017 at 2:16 AM, Jean-Philippe ANDRÉ <[email protected]> wrote:
> jpeg pushed a commit to branch master.
>
> http://git.enlightenment.org/core/efl.git/commit/?id=5f3515542b57fcc97d848f4aae7804711e0b485a
>
> commit 5f3515542b57fcc97d848f4aae7804711e0b485a
> Author: Jean-Philippe Andre <[email protected]>
> Date:   Mon Mar 13 19:18:02 2017 +0900
>
>     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).
> ---
>  src/lib/evas/canvas/evas_stack.c | 40 
> ++++++++++++++++++++++++++++++++++------
>  1 file changed, 34 insertions(+), 6 deletions(-)
>
> diff --git a/src/lib/evas/canvas/evas_stack.c 
> b/src/lib/evas/canvas/evas_stack.c
> index 55a46b0..7cd8509 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)
>     efl_gfx_stack_above((Evas_Object *)obj, above);
>  }
>
> +#define SERR(x, ...) EINA_SAFETY_ERROR(eina_slstr_printf(x, __VA_ARGS__))
> +
>  EOLIAN void
>  _efl_canvas_object_efl_gfx_stack_stack_above(Eo *eo_obj, 
> Evas_Object_Protected_Data *obj, Efl_Gfx_Stack *eo_above)
>  {
> @@ -162,7 +164,11 @@ _efl_canvas_object_efl_gfx_stack_stack_above(Eo *eo_obj, 
> Evas_Object_Protected_D
>       {
>          if (obj->smart.parent != above->smart.parent)
>            {
> -             ERR("COMPLAIN! evas_object_stack_above(), %p not inside same 
> smart as %p!", eo_obj, eo_above);
> +             SERR("Invalid operation: object '%s' %p (parent: '%s' %p) not "
> +                  "inside same smart parent as above '%s' %p (parent '%s' 
> %p)!",
> +                  efl_class_name_get(eo_obj), eo_obj, 
> efl_class_name_get(obj->smart.parent),
> +                  obj->smart.parent, efl_class_name_get(eo_above), eo_above,
> +                  efl_class_name_get(above->smart.parent), 
> above->smart.parent);
>               return;

nice idea, but I'd rather add new EINA_SAFETY_ERROR_MESSAGE() or
something like that which takes the printf()-like parameters and do
not need the eina_slstr_printf() hack, or per-file definition of that
hack.

an alternative is to use CRITICAL log, that gets the backtrace by
default AFAIR, there is a setting in eina_log.c which can be
overridden from envvars.



-- 
Gustavo Sverzut Barbieri
--------------------------------------
Mobile: +55 (16) 99354-9890

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to