- // We need to keep the original parameters in order to pass them to the
- // model-checked process:
- int argc_copy = argc;
- char** argv_copy = argvdup(argc, argv);
- xbt_log_init(&argc_copy, argv_copy);
- sg_config_init(&argc_copy, argv_copy);
-
- if (argc < 2)
- xbt_die("Missing arguments.\n");
-
- // Create a AF_LOCAL socketpair:
- int res;
+ try {
+ if (argc < 2)
+ xbt_die("Missing arguments.\n");
+
+ _sg_do_model_check = 1;
+
+ // The initialisation function can touch argv.
+ // We need to keep the original parameters in order to pass them to the
+ // model-checked process so we make a copy of them:
+ int argc_copy = argc;
+ char** argv_copy = argvdup(argc, argv);
+ xbt_log_init(&argc_copy, argv_copy);
+ sg_config_init(&argc_copy, argv_copy);
+
+ int sock;
+ pid_t model_checked_pid;
+ std::tie(model_checked_pid, sock) = create_model_checked(argv);
+ XBT_DEBUG("Inside the parent process");
+ if (mc_model_checker)
+ xbt_die("MC server already present");