static void gdb_vm_stopped(void *opaque, int reason)

{

    GDBState *s = opaque;

    char buf[256];

    const char *type;

    int ret;



    if (s->state == RS_SYSCALL)

        return;



    /* disable single step if it was enable */

    cpu_single_step(s->env, 0);



    if (reason == EXCP_DEBUG) {

        if (s->env->watchpoint_hit) {

            switch (s->env->watchpoint_hit->flags & BP_MEM_ACCESS) {

            case BP_MEM_READ:

                type = "r";

                break;

            case BP_MEM_ACCESS:

                type = "a";

                break;

            default:

                type = "";

                break;

            }

            snprintf(buf, sizeof(buf), "T%02x%swatch:" TARGET_FMT_lx ";",

                     SIGTRAP, type, s->env->watchpoint_hit->vaddr);

            put_packet(s, buf);

            s->env->watchpoint_hit = NULL;

            return;

        }

	tb_flush(s->env);

        ret = SIGTRAP;

    } else if (reason == EXCP_INTERRUPT) {

        ret = SIGINT;

    } else {

        ret = 0;

    }

    snprintf(buf, sizeof(buf), "S%02x", ret);

    put_packet(s, buf);

}

static void gdb_vm_stopped(void *opaque, int reason)

{

    GDBState *s = opaque;

    char buf[256];

    const char *type;

    int ret;



    if (s->state == RS_SYSCALL)

        return;



    

    cpu_single_step(s->env, 0);



    if (reason == EXCP_DEBUG) {

        if (s->env->watchpoint_hit) {

            switch (s->env->watchpoint_hit->flags & BP_MEM_ACCESS) {

            case BP_MEM_READ:

                type = "r";

                break;

            case BP_MEM_ACCESS:

                type = "a";

                break;

            default:

                type = "";

                break;

            }

            snprintf(buf, sizeof(buf), "T%02x%swatch:" TARGET_FMT_lx ";",

                     SIGTRAP, type, s->env->watchpoint_hit->vaddr);

            put_packet(s, buf);

            s->env->watchpoint_hit = NULL;

            return;

        }

	tb_flush(s->env);

        ret = SIGTRAP;

    } else if (reason == EXCP_INTERRUPT) {

        ret = SIGINT;

    } else {

        ret = 0;

    }

    snprintf(buf, sizeof(buf), "S%02x", ret);

    put_packet(s, buf);

}

static void FUNC_0(void *VAR_0, int VAR_1)

{

    GDBState *s = VAR_0;

    char VAR_2[256];

    const char *VAR_3;

    int VAR_4;



    if (s->state == RS_SYSCALL)

        return;



    

    cpu_single_step(s->env, 0);



    if (VAR_1 == EXCP_DEBUG) {

        if (s->env->watchpoint_hit) {

            switch (s->env->watchpoint_hit->flags & BP_MEM_ACCESS) {

            case BP_MEM_READ:

                VAR_3 = "r";

                break;

            case BP_MEM_ACCESS:

                VAR_3 = "a";

                break;

            default:

                VAR_3 = "";

                break;

            }

            snprintf(VAR_2, sizeof(VAR_2), "T%02x%swatch:" TARGET_FMT_lx ";",

                     SIGTRAP, VAR_3, s->env->watchpoint_hit->vaddr);

            put_packet(s, VAR_2);

            s->env->watchpoint_hit = NULL;

            return;

        }

	tb_flush(s->env);

        VAR_4 = SIGTRAP;

    } else if (VAR_1 == EXCP_INTERRUPT) {

        VAR_4 = SIGINT;

    } else {

        VAR_4 = 0;

    }

    snprintf(VAR_2, sizeof(VAR_2), "S%02x", VAR_4);

    put_packet(s, VAR_2);

}

static void FUNC_0(void *VAR_0, int VAR_1)
{ GDBState *s = VAR_0; char VAR_2[256]; const char *VAR_3; int VAR_4; if (s->state == RS_SYSCALL)
return; cpu_single_step(s->env, 0); if (VAR_1 == EXCP_DEBUG) { if (s->env->watchpoint_hit) { switch (s->env->watchpoint_hit->flags & BP_MEM_ACCESS) { case BP_MEM_READ:
VAR_3 = "r"; break; case BP_MEM_ACCESS:
VAR_3 = "a"; break; default:
VAR_3 = ""; break; } snprintf(VAR_2, sizeof(VAR_2), "T%02x%swatch:" TARGET_FMT_lx ";", SIGTRAP, VAR_3, s->env->watchpoint_hit->vaddr); put_packet(s, VAR_2); s->env->watchpoint_hit = NULL; return; } tb_flush(s->env); VAR_4 = SIGTRAP; } else if (VAR_1 == EXCP_INTERRUPT) { VAR_4 = SIGINT; } else { VAR_4 = 0; } snprintf(VAR_2, sizeof(VAR_2), "S%02x", VAR_4); put_packet(s, VAR_2); }