Skip to content

Commit

Permalink
Revert "Set the executable name from prt0, to avoid an API call. Show…
Browse files Browse the repository at this point in the history
… usage messages from prt0 if necessary, fix handling of -h and -V. a few other related cleanups"

This reverts commit 3631eec.

The profiling runcore expects the executable name to be available before
entering the runcore (and executing prt0).

Conflicts:

	frontend/parrot2/prt0.pir
  • Loading branch information
plobsing committed Aug 29, 2011
1 parent 64b5979 commit b1a3ae2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
10 changes: 9 additions & 1 deletion frontend/parrot2/main.c
Expand Up @@ -148,7 +148,8 @@ main(int argc, const char *argv[])
fprintf(stderr, "PARROT VM: No interpreter. Cannot get error details\n");
exit(EXIT_FAILURE);
}
if (!Parrot_set_config_hash(interp)) {
if (!(Parrot_set_config_hash(interp) &&
Parrot_api_set_executable_name(interp, argv[0]))) {
fprintf(stderr, "PARROT VM: Could not initialize new interpreter\n");
show_last_error_and_exit(interp);
}
Expand Down Expand Up @@ -681,6 +682,13 @@ parseflags(Parrot_PMC interp, int argc, ARGIN(const char *argv[]),
exit(EXIT_FAILURE);
}

/* reached the end of the option list and consumed all of argv */
if (argc == opt.opt_index) {
fprintf(stderr, "Missing program name\n");
usage(stderr);
exit(EXIT_FAILURE);
}

args->progargv = argv + opt.opt_index;
args->progargc = argc - opt.opt_index;
args->sysargv = sysargs;
Expand Down
11 changes: 0 additions & 11 deletions src/pmc/parrotinterpreter.pmc
Expand Up @@ -435,17 +435,6 @@ Returns the PMC global value for C<key>.
return PMCNULL;
}

VTABLE void set_pmc_keyed_int(INTVAL key, PMC * value) {
Interp * const new_interp = PMC_interp(SELF);
if (key >= 0 && key < IGLOBALS_SIZE) {
VTABLE_set_pmc_keyed_int(new_interp, new_interp->iglobals, key,
value);
return;
}
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS,
"Cannot set interp global %d (max: %d)", key, IGLOBALS_SIZE);
}

/*

=item C<PMC *get_pmc_keyed(PMC *key)>
Expand Down

0 comments on commit b1a3ae2

Please sign in to comment.