summaryrefslogtreecommitdiff
path: root/src/lib/edje/edje_embryo.c
diff options
context:
space:
mode:
authorShinwoo Kim <cinoo.kim@samsung.com>2016-01-13 11:55:46 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-01-13 14:50:58 +0900
commit1aafaca172101a0a430ac095ad0d96290ff0d61e (patch)
tree1780d4bb1df1a0dabdde3ad1f5f73a813d943f0b /src/lib/edje/edje_embryo.c
parent65715dafc5720df0ceaa47e4c3a21c42c3ac96ef (diff)
Edje: enhance embryo stack broken error message
Summary: Enhance embry stack broken error message Test Plan: Make a run_program run a script Reviewers: raster, zmike, jpeg Reviewed By: jpeg Subscribers: cedric, seoz, jpeg Differential Revision: https://phab.enlightenment.org/D3528
Diffstat (limited to 'src/lib/edje/edje_embryo.c')
-rw-r--r--src/lib/edje/edje_embryo.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/lib/edje/edje_embryo.c b/src/lib/edje/edje_embryo.c
index c4cba4f354..a3fd566273 100644
--- a/src/lib/edje/edje_embryo.c
+++ b/src/lib/edje/edje_embryo.c
@@ -4444,8 +4444,9 @@ _edje_embryo_script_reset(Edje *ed)
4444 4444
4445/* this may change in future - thus "test_run" is its name */ 4445/* this may change in future - thus "test_run" is its name */
4446void 4446void
4447_edje_embryo_test_run(Edje *ed, const char *fname, const char *sig, const char *src) 4447_edje_embryo_test_run(Edje *ed, Edje_Program *pr, const char *sig, const char *src)
4448{ 4448{
4449 char fname[128];
4449 Embryo_Function fn; 4450 Embryo_Function fn;
4450 4451
4451 if (!ed) return; 4452 if (!ed) return;
@@ -4455,6 +4456,7 @@ _edje_embryo_test_run(Edje *ed, const char *fname, const char *sig, const char *
4455 _edje_embryo_globals_init(ed); 4456 _edje_embryo_globals_init(ed);
4456 4457
4457 // _edje_embryo_script_reset(ed); 4458 // _edje_embryo_script_reset(ed);
4459 snprintf(fname, sizeof(fname), "_p%i", pr->id);
4458 fn = embryo_program_function_find(ed->collection->script, (char *)fname); 4460 fn = embryo_program_function_find(ed->collection->script, (char *)fname);
4459 if (fn != EMBRYO_FUNCTION_NONE) 4461 if (fn != EMBRYO_FUNCTION_NONE)
4460 { 4462 {
@@ -4478,20 +4480,24 @@ _edje_embryo_test_run(Edje *ed, const char *fname, const char *sig, const char *
4478 /* like 0.03 - 0.05 seconds or even more */ 4480 /* like 0.03 - 0.05 seconds or even more */
4479 embryo_program_max_cycle_run_set(ed->collection->script, 5000000); 4481 embryo_program_max_cycle_run_set(ed->collection->script, 5000000);
4480 if (embryo_program_recursion_get(ed->collection->script) && (!ed->collection->script_recursion)) 4482 if (embryo_program_recursion_get(ed->collection->script) && (!ed->collection->script_recursion))
4481 ERR("You are running Embryo->EDC->Embryo with script program '%s';\nBy the power of Grayskull, your previous Embryo stack is now broken!", fname); 4483 ERR("You are running Embryo->EDC->Embryo with script program '%s';\n"
4484 "A run_program runs the '%d'th program '%s' in the group '%s' of file %s;\n"
4485 "By the power of Grayskull, your previous Embryo stack is now broken!",
4486 fname, (fn + 1), pr->name, ed->group, ed->path);
4487
4482 ret = embryo_program_run(ed->collection->script, fn); 4488 ret = embryo_program_run(ed->collection->script, fn);
4483 if (ret == EMBRYO_PROGRAM_FAIL) 4489 if (ret == EMBRYO_PROGRAM_FAIL)
4484 { 4490 {
4485 ERR("ERROR with embryo script. " 4491 ERR("ERROR with embryo script. "
4486 "OBJECT NAME: '%s', " 4492 "OBJECT NAME: '%s', "
4487 "OBJECT FILE: '%s', " 4493 "OBJECT FILE: '%s', "
4488 "ENTRY POINT: '%s', " 4494 "ENTRY POINT: '%s (%s)', "
4489 "SIGNAL: '%s', " 4495 "SIGNAL: '%s', "
4490 "SOURCE: '%s', " 4496 "SOURCE: '%s', "
4491 "ERROR: '%s'", 4497 "ERROR: '%s'",
4492 ed->collection->part, 4498 ed->collection->part,
4493 ed->file->path, 4499 ed->file->path,
4494 fname, 4500 fname, pr->name,
4495 sig, src, 4501 sig, src,
4496 embryo_error_string_get(embryo_program_error_get(ed->collection->script))); 4502 embryo_error_string_get(embryo_program_error_get(ed->collection->script)));
4497 } 4503 }
@@ -4500,13 +4506,13 @@ _edje_embryo_test_run(Edje *ed, const char *fname, const char *sig, const char *
4500 ERR("ERROR with embryo script. " 4506 ERR("ERROR with embryo script. "
4501 "OBJECT NAME: '%s', " 4507 "OBJECT NAME: '%s', "
4502 "OBJECT FILE: '%s', " 4508 "OBJECT FILE: '%s', "
4503 "ENTRY POINT: '%s', " 4509 "ENTRY POINT: '%s (%s)', "
4504 "SIGNAL: '%s', " 4510 "SIGNAL: '%s', "
4505 "SOURCE: '%s', " 4511 "SOURCE: '%s', "
4506 "ERROR: 'Script exceeded maximum allowed cycle count of %i'", 4512 "ERROR: 'Script exceeded maximum allowed cycle count of %i'",
4507 ed->collection->part, 4513 ed->collection->part,
4508 ed->file->path, 4514 ed->file->path,
4509 fname, 4515 fname, pr->name,
4510 sig, src, 4516 sig, src,
4511 embryo_program_max_cycle_run_get(ed->collection->script)); 4517 embryo_program_max_cycle_run_get(ed->collection->script));
4512 } 4518 }