params->verbose = !!DBG_ENABLED();
params->uninitvalue = 0;
params->maxexecutions = 10;
+ params->nofork = false;
}
static void print_usage(const char *program_name, struct model_params *params)
"-x, --maxexec=NUM Maximum number of executions.\n"
" Default: %u\n"
" -o help for a list of options\n"
+ "-n No fork\n"
" -- Program arguments follow.\n\n",
program_name,
params->verbose,
static void parse_options(struct model_params *params, int argc, char **argv)
{
- const char *shortopts = "ht:o:u:x:v::";
+ const char *shortopts = "hnt:o:u:x:v::";
const struct option longopts[] = {
{"help", no_argument, NULL, 'h'},
{"verbose", optional_argument, NULL, 'v'},
case 'h':
print_usage(argv[0], params);
break;
+ case 'n':
+ params->nofork = true;
+ break;
case 'x':
params->maxexecutions = atoi(optarg);
break;
#include "mymemory.h"
#include "common.h"
#include "context.h"
+#include "model.h"
/** PageAlignedAdressUpdate return a page aligned address for the
* address being added as a side effect the numBytes are also changed.
/* switch back here when takesnapshot is called */
snapshotid = fork_snap->currSnapShotID;
-
+ if (model->params.nofork) {
+ setcontext(&fork_snap->shared_ctxt);
+ exit(EXIT_SUCCESS);
+ }
+
while (true) {
pid_t forkedID;
fork_snap->currSnapShotID = snapshotid + 1;