From: raster Date: Fri, 1 Oct 2010 06:53:16 +0000 (+0000) Subject: proper error output from script running (embryo). X-Git-Tag: submit/2.0alpha-wayland/20121127.221958~1024 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=746b4e4523a4f572e9ed032ca36fa94769c32bd1;p=profile%2Fivi%2Fedje.git proper error output from script running (embryo). git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@52942 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/edje_embryo.c b/src/lib/edje_embryo.c index f9d3440..e0c3d4a 100644 --- a/src/lib/edje_embryo.c +++ b/src/lib/edje_embryo.c @@ -3032,17 +3032,29 @@ _edje_embryo_test_run(Edje *ed, const char *fname, const char *sig, const char * if (ret == EMBRYO_PROGRAM_FAIL) { ERR("ERROR with embryo script.\n" - "ENTRY POINT: %s\n" + "OBJECT NAME: %s\n" + "OBJECT FILE: %s\n" + "ENTRY POINT: %s\n" + "SIGNAL/SRC: %s / %s\n" "ERROR: %s", - fname, + ed->collection->part, + ed->file->path, + fname, + sig, src, embryo_error_string_get(embryo_program_error_get(ed->collection->script))); } else if (ret == EMBRYO_PROGRAM_TOOLONG) { ERR("ERROR with embryo script.\n" - "ENTRY POINT: %s\n" + "OBJECT NAME: %s\n" + "OBJECT FILE: %s\n" + "ENTRY POINT: %s\n" + "SIGNAL/SRC: %s / %s\n" "ERROR: Script exceeded maximum allowed cycle count of %i", + ed->collection->part, + ed->file->path, fname, + sig, src, embryo_program_max_cycle_run_get(ed->collection->script)); } embryo_program_data_set(ed->collection->script, pdata); diff --git a/src/lib/edje_message_queue.c b/src/lib/edje_message_queue.c index 8640f76..26b2378 100644 --- a/src/lib/edje_message_queue.c +++ b/src/lib/edje_message_queue.c @@ -642,7 +642,8 @@ _edje_message_process(Edje_Message *em) { Embryo_Function fn; void *pdata; - + int ret; + /* signals are only handled one way */ if (em->type == EDJE_MESSAGE_SIGNAL) { @@ -683,7 +684,32 @@ _edje_message_process(Edje_Message *em) pdata = embryo_program_data_get(em->edje->collection->script); embryo_program_data_set(em->edje->collection->script, em->edje); embryo_program_max_cycle_run_set(em->edje->collection->script, 5000000); - embryo_program_run(em->edje->collection->script, fn); + ret = embryo_program_run(em->edje->collection->script, fn); + if (ret == EMBRYO_PROGRAM_FAIL) + { + ERR("ERROR with embryo script.\n" + "OBJECT NAME: %s\n" + "OBJECT FILE: %s\n" + "ENTRY POINT: %s\n" + "ERROR: %s", + em->edje->collection->part, + em->edje->file->path, + "message", + embryo_error_string_get(embryo_program_error_get(em->edje->collection->script))); + } + else if (ret == EMBRYO_PROGRAM_TOOLONG) + { + ERR("ERROR with embryo script.\n" + "OBJECT NAME: %s\n" + "OBJECT FILE: %s\n" + "ENTRY POINT: %s\n" + "ERROR: Script exceeded maximum allowed cycle count of %i", + em->edje->collection->part, + em->edje->file->path, + "message", + embryo_program_max_cycle_run_get(em->edje->collection->script)); + } + embryo_program_data_set(em->edje->collection->script, pdata); embryo_program_vm_pop(em->edje->collection->script); } diff --git a/src/lib/edje_script_only.c b/src/lib/edje_script_only.c index bd5c0f0..2b56cbe 100644 --- a/src/lib/edje_script_only.c +++ b/src/lib/edje_script_only.c @@ -619,17 +619,25 @@ _call_fn(Edje * ed, const char *fname, Embryo_Function fn) if (ret == EMBRYO_PROGRAM_FAIL) { ERR("ERROR with embryo script.\n" - "ENTRY POINT: %s\n" + "OBJECT NAME: %s\n" + "OBJECT FILE: %s\n" + "ENTRY POINT: %s\n" "ERROR: %s", - fname, - embryo_error_string_get(embryo_program_error_get - (ed->collection->script))); + ed->collection->part, + ed->file->path, + fname, + embryo_error_string_get(embryo_program_error_get(ed->collection->script))); } else if (ret == EMBRYO_PROGRAM_TOOLONG) { ERR("ERROR with embryo script.\n" - "ENTRY POINT: %s\n" + "OBJECT NAME: %s\n" + "OBJECT FILE: %s\n" + "ENTRY POINT: %s\n" "ERROR: Script exceeded maximum allowed cycle count of %i", - fname, embryo_program_max_cycle_run_get(ed->collection->script)); + ed->collection->part, + ed->file->path, + fname, + embryo_program_max_cycle_run_get(ed->collection->script)); } } diff --git a/src/lib/edje_var.c b/src/lib/edje_var.c index 3031355..6cfbc58 100644 --- a/src/lib/edje_var.c +++ b/src/lib/edje_var.c @@ -25,11 +25,32 @@ _edje_var_timer_cb(void *data) free(et); { void *pdata; + int ret; pdata = embryo_program_data_get(ed->collection->script); embryo_program_data_set(ed->collection->script, ed); embryo_program_max_cycle_run_set(ed->collection->script, 5000000); - embryo_program_run(ed->collection->script, fn); + ret = embryo_program_run(ed->collection->script, fn); + if (ret == EMBRYO_PROGRAM_FAIL) + { + ERR("ERROR with embryo script (timer callback).\n" + "OBJECT NAME: %s\n" + "OBJECT FILE: %s\n" + "ERROR: %s", + ed->collection->part, + ed->file->path, + embryo_error_string_get(embryo_program_error_get(ed->collection->script))); + } + else if (ret == EMBRYO_PROGRAM_TOOLONG) + { + ERR("ERROR with embryo script (timer callback).\n" + "OBJECT NAME: %s\n" + "OBJECT FILE: %s\n" + "ERROR: Script exceeded maximum allowed cycle count of %i", + ed->collection->part, + ed->file->path, + embryo_program_max_cycle_run_get(ed->collection->script)); + } embryo_program_data_set(ed->collection->script, pdata); embryo_program_vm_pop(ed->collection->script); _edje_recalc(ed); @@ -74,6 +95,7 @@ _edje_var_anim_cb(void *data __UNUSED__) { Embryo_Function fn; float v; + int ret; v = (t - ea->start) / ea->len; if (v > 1.0) v= 1.0; @@ -89,6 +111,27 @@ _edje_var_anim_cb(void *data __UNUSED__) pdata = embryo_program_data_get(ed->collection->script); embryo_program_data_set(ed->collection->script, ed); embryo_program_max_cycle_run_set(ed->collection->script, 5000000); + ret = embryo_program_run(ed->collection->script, fn); + if (ret == EMBRYO_PROGRAM_FAIL) + { + ERR("ERROR with embryo script (anim callback).\n" + "OBJECT NAME: %s\n" + "OBJECT FILE: %s\n" + "ERROR: %s", + ed->collection->part, + ed->file->path, + embryo_error_string_get(embryo_program_error_get(ed->collection->script))); + } + else if (ret == EMBRYO_PROGRAM_TOOLONG) + { + ERR("ERROR with embryo script (anim callback).\n" + "OBJECT NAME: %s\n" + "OBJECT FILE: %s\n" + "ERROR: Script exceeded maximum allowed cycle count of %i", + ed->collection->part, + ed->file->path, + embryo_program_max_cycle_run_get(ed->collection->script)); + } embryo_program_run(ed->collection->script, fn); embryo_program_data_set(ed->collection->script, pdata); embryo_program_vm_pop(ed->collection->script);