Skip to content

Commit

Permalink
Made another test case pass by putting debug information. Also remove…
Browse files Browse the repository at this point in the history
…d some dependency with embed.c
  • Loading branch information
bluescreen10 committed Nov 29, 2010
1 parent 372f8f7 commit 704e3c4
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/embed/api.c
@@ -1,4 +1,5 @@
#include "parrot/parrot.h" #include "parrot/parrot.h"
#include "parrot/runcore_api.h"
#include "parrot/embed.h" #include "parrot/embed.h"
#include "parrot/api.h" #include "parrot/api.h"
#include "embed_private.h" #include "embed_private.h"
Expand Down Expand Up @@ -53,26 +54,23 @@ Parrot_api_set_runcore(ARGIN(PMC *interp_pmc), const char * corename, Parrot_UIn
ASSERT_ARGS(Parrot_api_set_runcore) ASSERT_ARGS(Parrot_api_set_runcore)
EMBED_API_CALLIN(interp_pmc, interp) EMBED_API_CALLIN(interp_pmc, interp)
if (trace) { if (trace) {
Parrot_set_trace(interp, (Parrot_trace_flags)trace); Parrot_pcc_trace_flags_on(interp, interp->ctx, trace);
Parrot_set_run_core(interp, PARROT_SLOW_CORE); Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "slow"));
} else { } else {
Parrot_Run_core_t core = PARROT_SLOW_CORE;
if (!strcmp(corename, "slow") || !strcmp(corename, "bounds")) if (!strcmp(corename, "slow") || !strcmp(corename, "bounds"))
core = PARROT_SLOW_CORE; Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "slow"));
else if (!strcmp(corename, "fast") || !strcmp(corename, "jit") || !strcmp(corename, "function")) else if (!strcmp(corename, "fast") || !strcmp(corename, "jit") || !strcmp(corename, "function"))
core = PARROT_FAST_CORE; Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "fast"));
else if (!strcmp(corename, "exec")) else if (!strcmp(corename, "exec"))
core = PARROT_EXEC_CORE; Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "exec"));
else if (!strcmp(corename, "trace")) else if (!strcmp(corename, "trace"))
core = PARROT_SLOW_CORE; // !!! Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "slow"));
else if (!strcmp(corename, "profiling")) else if (!strcmp(corename, "profiling"))
core = PARROT_PROFILING_CORE; Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "profiling"));
else if (!strcmp(corename, "gcdebug")) else if (!strcmp(corename, "gcdebug"))
core = PARROT_GC_DEBUG_CORE; Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "gcdebug"));
else else
Parrot_ex_throw_from_c_args(interp, NULL, 1, "Invalid runcore type %s", corename); Parrot_ex_throw_from_c_args(interp, NULL, 1, "Invalid runcore type %s", corename);
Parrot_set_trace(interp, (Parrot_trace_flags)trace);
Parrot_set_run_core(interp, core);
} }
EMBED_API_CALLOUT(interp_pmc, interp) EMBED_API_CALLOUT(interp_pmc, interp)
} }
Expand Down Expand Up @@ -184,6 +182,12 @@ Parrot_api_run_bytecode(ARGMOD(PMC *interp_pmc), ARGIN(PMC *pbc), ARGIN(PMC *mai


PackFile * const pf = (PackFile *)VTABLE_get_pointer(interp, pbc); PackFile * const pf = (PackFile *)VTABLE_get_pointer(interp, pbc);


/* Debugging mode nonsense. */
if (Interp_debug_TEST(interp, PARROT_START_DEBUG_FLAG)) {
Parrot_io_eprintf(interp, "*** Parrot VM: %Ss core ***\n",
interp->run_core->name);
}

if (!pf) if (!pf)
Parrot_ex_throw_from_c_args(interp, NULL, 1, "Could not get packfile"); Parrot_ex_throw_from_c_args(interp, NULL, 1, "Could not get packfile");
if (pf->cur_cs != NULL) if (pf->cur_cs != NULL)
Expand Down

0 comments on commit 704e3c4

Please sign in to comment.