void cpu_dump_state(CPUState *env, FILE *f,

                    int (*cpu_fprintf)(FILE *f, const char *fmt, ...),

                    int flags)

{

    int i, x;



    cpu_fprintf(f, "pc: " TARGET_FMT_lx "  npc: " TARGET_FMT_lx "\n", env->pc,

                env->npc);

    cpu_fprintf(f, "General Registers:\n");

    for (i = 0; i < 4; i++)

        cpu_fprintf(f, "%%g%c: " TARGET_FMT_lx "\t", i + '0', env->gregs[i]);

    cpu_fprintf(f, "\n");

    for (; i < 8; i++)

        cpu_fprintf(f, "%%g%c: " TARGET_FMT_lx "\t", i + '0', env->gregs[i]);

    cpu_fprintf(f, "\nCurrent Register Window:\n");

    for (x = 0; x < 3; x++) {

        for (i = 0; i < 4; i++)

            cpu_fprintf(f, "%%%c%d: " TARGET_FMT_lx "\t",

                    (x == 0 ? 'o' : (x == 1 ? 'l' : 'i')), i,

                    env->regwptr[i + x * 8]);

        cpu_fprintf(f, "\n");

        for (; i < 8; i++)

            cpu_fprintf(f, "%%%c%d: " TARGET_FMT_lx "\t",

                    (x == 0 ? 'o' : x == 1 ? 'l' : 'i'), i,

                    env->regwptr[i + x * 8]);

        cpu_fprintf(f, "\n");

    }

    cpu_fprintf(f, "\nFloating Point Registers:\n");

    for (i = 0; i < 32; i++) {

        if ((i & 3) == 0)

            cpu_fprintf(f, "%%f%02d:", i);

        cpu_fprintf(f, " %016lf", env->fpr[i]);

        if ((i & 3) == 3)

            cpu_fprintf(f, "\n");

    }

#ifdef TARGET_SPARC64

    cpu_fprintf(f, "pstate: 0x%08x ccr: 0x%02x asi: 0x%02x tl: %d fprs: %d\n",

                env->pstate, GET_CCR(env), env->asi, env->tl, env->fprs);

    cpu_fprintf(f, "cansave: %d canrestore: %d otherwin: %d wstate %d "

                "cleanwin %d cwp %d\n",

                env->cansave, env->canrestore, env->otherwin, env->wstate,

                env->cleanwin, env->nwindows - 1 - env->cwp);

#else

    cpu_fprintf(f, "psr: 0x%08x -> %c%c%c%c %c%c%c wim: 0x%08x\n",

                GET_PSR(env), GET_FLAG(PSR_ZERO, 'Z'), GET_FLAG(PSR_OVF, 'V'),

                GET_FLAG(PSR_NEG, 'N'), GET_FLAG(PSR_CARRY, 'C'),

                env->psrs?'S':'-', env->psrps?'P':'-',

                env->psret?'E':'-', env->wim);

#endif

    cpu_fprintf(f, "fsr: 0x%08x\n", GET_FSR32(env));

}

void cpu_dump_state(CPUState *env, FILE *f,

                    int (*cpu_fprintf)(FILE *f, const char *fmt, ...),

                    int flags)

{

    int i, x;



    cpu_fprintf(f, "pc: " TARGET_FMT_lx "  npc: " TARGET_FMT_lx "\n", env->pc,

                env->npc);

    cpu_fprintf(f, "General Registers:\n");

    for (i = 0; i < 4; i++)

        cpu_fprintf(f, "%%g%c: " TARGET_FMT_lx "\t", i + '0', env->gregs[i]);

    cpu_fprintf(f, "\n");

    for (; i < 8; i++)

        cpu_fprintf(f, "%%g%c: " TARGET_FMT_lx "\t", i + '0', env->gregs[i]);

    cpu_fprintf(f, "\nCurrent Register Window:\n");

    for (x = 0; x < 3; x++) {

        for (i = 0; i < 4; i++)

            cpu_fprintf(f, "%%%c%d: " TARGET_FMT_lx "\t",

                    (x == 0 ? 'o' : (x == 1 ? 'l' : 'i')), i,

                    env->regwptr[i + x * 8]);

        cpu_fprintf(f, "\n");

        for (; i < 8; i++)

            cpu_fprintf(f, "%%%c%d: " TARGET_FMT_lx "\t",

                    (x == 0 ? 'o' : x == 1 ? 'l' : 'i'), i,

                    env->regwptr[i + x * 8]);

        cpu_fprintf(f, "\n");

    }

    cpu_fprintf(f, "\nFloating Point Registers:\n");

    for (i = 0; i < 32; i++) {

        if ((i & 3) == 0)

            cpu_fprintf(f, "%%f%02d:", i);

        cpu_fprintf(f, " %016lf", env->fpr[i]);

        if ((i & 3) == 3)

            cpu_fprintf(f, "\n");

    }

#ifdef TARGET_SPARC64

    cpu_fprintf(f, "pstate: 0x%08x ccr: 0x%02x asi: 0x%02x tl: %d fprs: %d\n",

                env->pstate, GET_CCR(env), env->asi, env->tl, env->fprs);

    cpu_fprintf(f, "cansave: %d canrestore: %d otherwin: %d wstate %d "

                "cleanwin %d cwp %d\n",

                env->cansave, env->canrestore, env->otherwin, env->wstate,

                env->cleanwin, env->nwindows - 1 - env->cwp);

#else

    cpu_fprintf(f, "psr: 0x%08x -> %c%c%c%c %c%c%c wim: 0x%08x\n",

                GET_PSR(env), GET_FLAG(PSR_ZERO, 'Z'), GET_FLAG(PSR_OVF, 'V'),

                GET_FLAG(PSR_NEG, 'N'), GET_FLAG(PSR_CARRY, 'C'),

                env->psrs?'S':'-', env->psrps?'P':'-',

                env->psret?'E':'-', env->wim);

#endif

    cpu_fprintf(f, "fsr: 0x%08x\n", GET_FSR32(env));

}

        cpu_fprintf(f, " %016lf", env->fpr[i]);
void FUNC_0(CPUState *VAR_0, FILE *VAR_3,

                    int (*VAR_2)(FILE *VAR_3, const char *VAR_3, ...),

                    int VAR_4)

{

    int VAR_5, VAR_6;



    VAR_2(VAR_3, "pc: " TARGET_FMT_lx "  npc: " TARGET_FMT_lx "\n", VAR_0->pc,

                VAR_0->npc);

    VAR_2(VAR_3, "General Registers:\n");

    for (VAR_5 = 0; VAR_5 < 4; VAR_5++)

        VAR_2(VAR_3, "%%g%c: " TARGET_FMT_lx "\t", VAR_5 + '0', VAR_0->gregs[VAR_5]);

    VAR_2(VAR_3, "\n");

    for (; VAR_5 < 8; VAR_5++)

        VAR_2(VAR_3, "%%g%c: " TARGET_FMT_lx "\t", VAR_5 + '0', VAR_0->gregs[VAR_5]);

    VAR_2(VAR_3, "\nCurrent Register Window:\n");

    for (VAR_6 = 0; VAR_6 < 3; VAR_6++) {

        for (VAR_5 = 0; VAR_5 < 4; VAR_5++)

            VAR_2(VAR_3, "%%%c%d: " TARGET_FMT_lx "\t",

                    (VAR_6 == 0 ? 'o' : (VAR_6 == 1 ? 'l' : 'VAR_5')), VAR_5,

                    VAR_0->regwptr[VAR_5 + VAR_6 * 8]);

        VAR_2(VAR_3, "\n");

        for (; VAR_5 < 8; VAR_5++)

            VAR_2(VAR_3, "%%%c%d: " TARGET_FMT_lx "\t",

                    (VAR_6 == 0 ? 'o' : VAR_6 == 1 ? 'l' : 'VAR_5'), VAR_5,

                    VAR_0->regwptr[VAR_5 + VAR_6 * 8]);

        VAR_2(VAR_3, "\n");

    }

    VAR_2(VAR_3, "\nFloating Point Registers:\n");

    for (VAR_5 = 0; VAR_5 < 32; VAR_5++) {

        if ((VAR_5 & 3) == 0)

            VAR_2(VAR_3, "%%VAR_3%02d:", VAR_5);

        VAR_2(VAR_3, " %016lf", VAR_0->fpr[VAR_5]);

        if ((VAR_5 & 3) == 3)

            VAR_2(VAR_3, "\n");

    }

#ifdef TARGET_SPARC64

    VAR_2(VAR_3, "pstate: 0x%08x ccr: 0x%02x asi: 0x%02x tl: %d fprs: %d\n",

                VAR_0->pstate, GET_CCR(VAR_0), VAR_0->asi, VAR_0->tl, VAR_0->fprs);

    VAR_2(VAR_3, "cansave: %d canrestore: %d otherwin: %d wstate %d "

                "cleanwin %d cwp %d\n",

                VAR_0->cansave, VAR_0->canrestore, VAR_0->otherwin, VAR_0->wstate,

                VAR_0->cleanwin, VAR_0->nwindows - 1 - VAR_0->cwp);

#else

    VAR_2(VAR_3, "psr: 0x%08x -> %c%c%c%c %c%c%c wim: 0x%08x\n",

                GET_PSR(VAR_0), GET_FLAG(PSR_ZERO, 'Z'), GET_FLAG(PSR_OVF, 'V'),

                GET_FLAG(PSR_NEG, 'N'), GET_FLAG(PSR_CARRY, 'C'),

                VAR_0->psrs?'S':'-', VAR_0->psrps?'P':'-',

                VAR_0->psret?'E':'-', VAR_0->wim);

#endif

    VAR_2(VAR_3, "fsr: 0x%08x\n", GET_FSR32(VAR_0));

}

void FUNC_0(CPUState *VAR_0, FILE *VAR_3,
int (*VAR_2)(FILE *VAR_3, const char *VAR_3, ...),
int VAR_4)
{ int VAR_5, VAR_6; VAR_2(VAR_3, "pc: " TARGET_FMT_lx "  npc: " TARGET_FMT_lx "\n", VAR_0->pc,
VAR_0->npc); VAR_2(VAR_3, "General Registers:\n"); for (VAR_5 = 0; VAR_5 < 4; VAR_5++) VAR_2(VAR_3, "%%g%c: " TARGET_FMT_lx "\t", VAR_5 + '0', VAR_0->gregs[VAR_5]); VAR_2(VAR_3, "\n"); for (; VAR_5 < 8; VAR_5++) VAR_2(VAR_3, "%%g%c: " TARGET_FMT_lx "\t", VAR_5 + '0', VAR_0->gregs[VAR_5]); VAR_2(VAR_3, "\nCurrent Register Window:\n"); for (VAR_6 = 0; VAR_6 < 3; VAR_6++) { for (VAR_5 = 0; VAR_5 < 4; VAR_5++) VAR_2(VAR_3, "%%%c%d: " TARGET_FMT_lx "\t",
(VAR_6 == 0 ? 'o' : (VAR_6 == 1 ? 'l' : 'VAR_5')), VAR_5,
VAR_0->regwptr[VAR_5 + VAR_6 * 8]); VAR_2(VAR_3, "\n"); for (; VAR_5 < 8; VAR_5++) VAR_2(VAR_3, "%%%c%d: " TARGET_FMT_lx "\t",
(VAR_6 == 0 ? 'o' : VAR_6 == 1 ? 'l' : 'VAR_5'), VAR_5,
VAR_0->regwptr[VAR_5 + VAR_6 * 8]); VAR_2(VAR_3, "\n"); } VAR_2(VAR_3, "\nFloating Point Registers:\n"); for (VAR_5 = 0; VAR_5 < 32; VAR_5++) { if ((VAR_5 & 3) == 0)
VAR_2(VAR_3, "%%VAR_3%02d:", VAR_5); VAR_2(VAR_3, " %016lf", VAR_0->fpr[VAR_5]); if ((VAR_5 & 3) == 3)
VAR_2(VAR_3, "\n"); } #ifdef TARGET_SPARC64
VAR_2(VAR_3, "pstate: 0x%08x ccr: 0x%02x asi: 0x%02x tl: %d fprs: %d\n",
VAR_0->pstate, GET_CCR(VAR_0), VAR_0->asi, VAR_0->tl, VAR_0->fprs); VAR_2(VAR_3, "cansave: %d canrestore: %d otherwin: %d wstate %d "
"cleanwin %d cwp %d\n",
VAR_0->cansave, VAR_0->canrestore, VAR_0->otherwin, VAR_0->wstate,
VAR_0->cleanwin, VAR_0->nwindows - 1 - VAR_0->cwp); #else
VAR_2(VAR_3, "psr: 0x%08x -> %c%c%c%c %c%c%c wim: 0x%08x\n",
GET_PSR(VAR_0), GET_FLAG(PSR_ZERO, 'Z'), GET_FLAG(PSR_OVF, 'V'),
GET_FLAG(PSR_NEG, 'N'), GET_FLAG(PSR_CARRY, 'C'),
VAR_0->psrs?'S':'-', VAR_0->psrps?'P':'-',
VAR_0->psret?'E':'-', VAR_0->wim); #endif
VAR_2(VAR_3, "fsr: 0x%08x\n", GET_FSR32(VAR_0)); }