Ejemplo n.º 1
0
void
IMCC_debug(ARGMOD(imc_info_t * imcc), int level, ARGIN(const char *fmt), ...)
{
    ASSERT_ARGS(IMCC_debug)
    va_list ap;

    if (!(level & imcc->debug))
        return;
    va_start(ap, fmt);
    imcc_vfprintf(imcc, Parrot_io_STDERR(imcc->interp), fmt, ap);
    va_end(ap);
}
Ejemplo n.º 2
0
void
dump_instructions(PARROT_INTERP, ARGIN(const IMC_Unit *unit))
{
    ASSERT_ARGS(dump_instructions)
    const Instruction *ins;
    int                pc;

    Parrot_io_fprintf(interp, Parrot_io_STDERR(interp),
            "\nDumping the instructions status:"
            "\n-------------------------------\n");
    Parrot_io_fprintf(interp, Parrot_io_STDERR(interp),
            "nins line blck deep flags\t    type opnr size   pc  X ins\n");

    for (pc = 0, ins = unit->instructions; ins; ins = ins->next) {
        const Basic_block * const bb = unit->bb_list[ins->bbindex];

        if (bb) {
            Parrot_io_fprintf(interp, Parrot_io_STDERR(interp),
                    "%4i %4d %4d %4d\t%x\t%8x %4d %4d %4d  %c ",
                     ins->index, ins->line, bb->index, bb->loop_depth,
                     ins->flags, (ins->type & ~ITEXT), ins->opnum,
                     ins->opsize, pc, ins->type & ITEXT ? 'X' : ' ');
        }
        else {
             fprintf(stderr, "\t");
        }

        Parrot_io_fprintf(interp, Parrot_io_STDERR(interp), "%s\n", ins->opname);
        ins_print(interp, Parrot_io_STDERR(interp), ins);
        pc += ins->opsize;
    }

    Parrot_io_fprintf(interp, Parrot_io_STDERR(interp), "\n");
}
Ejemplo n.º 3
0
PARROT_EXPORT
PARROT_DOES_NOT_RETURN
void
IMCC_fatal_standalone(PARROT_INTERP, int code, ARGIN(const char *fmt), ...)
{
    ASSERT_ARGS(IMCC_fatal_standalone)
    va_list ap;

    va_start(ap, fmt);
    imcc_vfprintf(interp, Parrot_io_STDERR(interp), fmt, ap);
    va_end(ap);
    Parrot_exit(interp, code);
}
Ejemplo n.º 4
0
PARROT_EXPORT
void
IMCC_debug(PARROT_INTERP, int level, ARGIN(const char *fmt), ...)
{
    ASSERT_ARGS(IMCC_debug)
    va_list ap;

    if (!(level & IMCC_INFO(interp)->debug))
        return;
    va_start(ap, fmt);
    imcc_vfprintf(interp, Parrot_io_STDERR(interp), fmt, ap);
    va_end(ap);
}
Ejemplo n.º 5
0
PARROT_EXPORT
void
IMCC_warning(PARROT_INTERP, ARGIN(const char *fmt), ...)
{
    ASSERT_ARGS(IMCC_warning)
    va_list ap;
    if (IMCC_INFO(interp)->imcc_warn)
        return;

    va_start(ap, fmt);
    imcc_vfprintf(interp, Parrot_io_STDERR(interp), fmt, ap);
    va_end(ap);
}
Ejemplo n.º 6
0
PARROT_EXPORT
int
Parrot_eprintf(NULLOK_INTERP, ARGIN(const char *s), ...)
{
    ASSERT_ARGS(Parrot_eprintf)
    va_list args;
    INTVAL retval;

    va_start(args, s);

    if (interp) {
        retval = Parrot_vfprintf(interp, Parrot_io_STDERR(interp), s, args);
    }
    else {
        /* Be nice about this...
         **   XXX BD Should this use the default Parrot_io_STDOUT or something?
         */
        retval=vfprintf(stderr, s, args);
    }

    va_end(args);

    return retval;
}