proper error output from script running (embryo).

SVN revision: 52942
This commit is contained in:
Carsten Haitzler 2010-10-01 06:53:16 +00:00
parent 307190c594
commit 3d87542724
4 changed files with 101 additions and 12 deletions

View File

@ -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);

View File

@ -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);
}

View File

@ -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));
}
}

View File

@ -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);