Make exit behaviour of jerry_fatal flag-dependent

* Added new flag `JERRY_FLAG_ABORT_ON_FAIL`.
* Added new internal api function `jerry_is_abort_on_fail` to
  check the status of the flag.
* Changed `jerry_fatal` bail-out function to call `abort` when the
  flag is set and exit code is non-zero (i.e., not only for
  assertion failures).
* Added `--abort-on-fail` command line option to linux and nuttx
  apps to set the flag.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
Akos Kiss
2015-06-02 23:07:10 +02:00
parent 4c10a6d057
commit 9d423d9901
6 changed files with 28 additions and 1 deletions
+4
View File
@@ -166,6 +166,10 @@ int jerry_main (int argc, char *argv[])
{
flags |= JERRY_FLAG_SHOW_OPCODES;
}
else if (!strcmp ("--abort-on-fail", argv[i]))
{
flags |= JERRY_FLAG_ABORT_ON_FAIL;
}
else
{
file_names[files_counter++] = argv[i];